I have a question, I'm looking at a game archive and the structure resembles lz77, RLE.
I know this is broad..but am I on the right track, it appears that the compression is starting around x15

LZ77 compression scheme.
The compressed data will be in the pattern of 1 bite that is gathered by 8 flag bit and 8 chunks.
Ex) [Flag][chunk0][chunk 1][chunk2][chunk3][chunk4][chunk5][chunk6][chunk7][flag][chunk0][chunk1]....
Each bit of the flag indicates whether the chunk was compressed or not.1 means compressed chunk, 0 will be the chunk has not been compressed and has a size of 1 bite.
#0bite represents # 0 chunk, while #7bit represents #7 bit.
There are 4 types of compressed chunk.
If the first bite of the chunk’s lower nibble has a value of 0, thats mean it is a long compression.1 means RLE, 2means Copy, the rest means compressed.
Long compressed chunks are formed with 3 bites.
If the 3bite comes in the order of [H0:L0][H1:L1][H2:L2] ,( H is upper nibble,4 bit), L is lower nibble. They are enclosed by bite. L0 is 0.
The enclosed 12 bit which is the order of H1 L1 H0, helps you to understand how much backwards you have to refer in advance starting from current cursor.
Add 0x10 to 8bit which is enclosed by H2 L2, that tells you how much bite you have to bring.
If it is 30 12 24 , after seeing L0 which is 0, you know it is a long compressed chunk . 0x123 tells you how much you have to refer backward from previous.
and (0x24 + 0x10)is how much bite you have to bring from there.
RLE chunks are formed by 2 bite.
L0 has to follow 1. Add3 to H0 tells you how many times you have to repeat.[H1:L1]tells repeating bite.
If it 21 78, that means 0x78 words was repeated 2+3 times.
Copy chunks are formed by 2+nbite.
In case L0 is 2, add0x12 to H1 L1 H0, you will know how much bite you have to copy. You just have to copy the data shows after that.
Compressed chunk is formed by 2bite.
The value of L0 same as previously brought data’s bite. H1 L1 H0 tells you how much you have to go backward from the current cursor.
There are 3 points in total.
1. The point that indicates from previous to present .
2. The point that indicates the present of compressed input file.
3. After decompressing and saving, the point that is used for output.
It reads one bite from the input point. Input point will move automatically.
After seeing the bite, it will make an assumption that it is a copy chunk.
After reading another bite, it will calculate the length of n. input point will move automatically.
for(i = 0; i < n; i++) {
c = fgetc(input point);
fputc(c, output point);
Previous [previous point ] = c; previous point++;
}
Previous size was 4kb. Since the range of previous point was 0~4095, after4095, instead of 4096, it will move back to 0.
Previous point= (previous point+ 1) % 4096;