This project has moved and is read-only. For the latest updates, please go here.

Start of remaining data in compressed files

Jun 14, 2010 at 7:30 PM
In the description of compressed files bytes 0x08 to0x0B are described as a 4 byte unsigned integer containing the uncompressed size of the remaining data. I am not sure where the remaining data starts. Is it at byte 0x0C after this size, at byte 0x10 after another 4 fixed bytes ("@@@@"), or at byte 0x12 after the identifier of deflate?
Jun 14, 2010 at 9:29 PM

It actually depends how you're decoding the compressed data; from byte 0x10 onwards is a zlib data stream, however, as there is only one zlib compression format (deflate) the two bytes at 0x10 and 0x11 can be considered a fixed part of the header and 0x12 onwards as a deflate data stream instead. In both cases the same uncompressed data comes out, and it's the size of this which is put into 0x08-0x0B.

For the purposes of this project, and since .NET has a deflate decompressor and not a zlib decompressor, I've taken the first 0x12 bytes as the header and used deflate on the rest.