public override Stream OpenEntry(ArcFile arc, Entry entry) { if (0xFF435031 != arc.File.View.ReadUInt32(entry.Offset)) { return(base.OpenEntry(arc, entry)); } var data = arc.File.View.ReadBytes(entry.Offset, entry.Size); data = PackOpener.Decompress(data) ?? data; return(new BinMemoryStream(data, entry.Name)); }
public override Stream OpenEntry(ArcFile arc, Entry entry) { if (0xFF435031 != arc.File.View.ReadUInt32(entry.Offset)) { return(base.OpenEntry(arc, entry)); } var packed = new byte[entry.Size]; arc.File.View.Read(entry.Offset, packed, 0, entry.Size); var unpacked = PackOpener.Decompress(packed); if (null == unpacked) { return(new MemoryStream(packed)); } return(new MemoryStream(unpacked)); }