RE4 GameCube location compression

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
TTEMMA
Posts: 5
Joined: Sun Oct 18, 2015 7:41 pm

RE4 GameCube location compression

Post by TTEMMA »

Hi.
At the moment I'm trying to disassemble the compression into Resident Evil 4 on the Gamecube.
There is a complex and not understandable compression. At the beginning of the decompression, the game generates a table.
It stores items from 0 to 0x500, but the number of each number is divided in a strange way. For example, if value < 0x300 (for example, 0x012C) then the table will record 26(0x1A) items with a value of 0x012C. If value > 0x300 (for example, 0x0400) the table will record 25(0x19) items with a value of 0x0400.

Decompression is even stranger, each byte is decompressed by 4 bytes from the compressed file (4 bytes are divided into a flag that is built dynamically and is not stored in a compressed file).

I ask for help with mastering the compression algorithm, perhaps, in my description, you saw some familiar compression algorithm for yourself.

Thank You
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: RE4 GameCube location compression

Post by aluigi »

Can you provide some sample files of the game that use this compression?
TTEMMA
Posts: 5
Joined: Sun Oct 18, 2015 7:41 pm

Re: RE4 GameCube location compression

Post by TTEMMA »

Compressed data start from 0x20, compressed size and decompressed contain in first 0x20 bytes

https://drive.google.com/open?id=1Cn_pj ... 61ZQjhOP19
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: RE4 GameCube location compression

Post by aluigi »

No idea about what would be the algorithm and moreover about what decompressed data we should expect.
TTEMMA
Posts: 5
Joined: Sun Oct 18, 2015 7:41 pm

Re: RE4 GameCube location compression

Post by TTEMMA »

Okay, i upload 2 files:
r100.bin - compressed
r100decoded.bin - decompressed

Maybe this help you

https://drive.google.com/open?id=11HmKD ... VOsYGPfEwR