Skip to content

Commit 4f26025

Browse files
Fixed YAY0 Decompression Issue
-Fixed problem with decompression algorithm. Instead of reading third byte from compressed data it now reads it from non-compressed data. This now results in the correct size of data as well.
1 parent c1c9a23 commit 4f26025

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PeepsCompress/PeepsCompress/YAY0.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ namespace PeepsCompress
1010
{
1111
class YAY0 : SlidingWindowAlgorithm
1212
{
13+
1314
public override byte[] compress(byte[] file, int offset)
1415
{
1516
throw new NotImplementedException();
1617
}
17-
1818
public override byte[] decompress(BinaryReader br, int offset, FileStream inputFile)
1919
{
2020
List<byte> newFile = new List<byte>();
@@ -74,7 +74,9 @@ public override byte[] decompress(BinaryReader br, int offset, FileStream inputF
7474

7575
if (byte1Lower == 0)
7676
{
77+
inputFile.Seek(uncompressedOffset, SeekOrigin.Begin);
7778
finalLength = br.ReadByte() + 0x12;
79+
uncompressedOffset++;
7880
}
7981
else
8082
{
@@ -91,12 +93,13 @@ public override byte[] decompress(BinaryReader br, int offset, FileStream inputF
9193
}
9294
}
9395
}
96+
9497
}
9598
catch (Exception ex)
9699
{
97100
MessageBox.Show(ex.Message);
98101
}
99-
102+
100103
return newFile.ToArray();
101104
}
102105
else

0 commit comments

Comments
 (0)