Skip to content

Commit

Permalink
(arc): recognize LZSS compression.
Browse files Browse the repository at this point in the history
  • Loading branch information
morkt committed Mar 11, 2019
1 parent 51191ba commit ae7db58
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ArcFormats/Abel/ArcARC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ Stream OpenCmpEntry (ArcFile arc, Entry entry)
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);
}
}
Expand Down

0 comments on commit ae7db58

Please sign in to comment.