From ae7db58c1100d94a19d663fc818cee006c4fe6e3 Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 11 Mar 2019 10:43:14 +0400 Subject: [PATCH] (arc): recognize LZSS compression. --- ArcFormats/Abel/ArcARC.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ArcFormats/Abel/ArcARC.cs b/ArcFormats/Abel/ArcARC.cs index 5c9c4ff1..fc7924bb 100644 --- a/ArcFormats/Abel/ArcARC.cs +++ b/ArcFormats/Abel/ArcARC.cs @@ -110,6 +110,16 @@ namespace GameRes.Formats.Abel uint offset = arc.File.View.ReadUInt32 (entry.Offset+8); if (offset >= entry.Size) return base.OpenEntry (arc, entry); + long cmp_offset = entry.Offset + offset; + if (arc.File.View.ReadByte (cmp_offset) == 0) + { + uint packed_size = arc.File.View.ReadUInt32 (cmp_offset+5); + if (packed_size == entry.Size - (offset+0x11)) + { + var input = arc.File.CreateStream (cmp_offset+0x11, packed_size); + return new LzssStream (input); + } + } return arc.File.CreateStream (entry.Offset+offset, entry.Size-offset); } }