Hello everyone!
I am beginning the long process of reverse engineering the various inner workings of Solatorobo: Red the Hunter. I'm very new to the field of DS ROM hacking, and am in the early days of this project, so the first thing I thought I would do to get my feet wet would be to write a custom extraction utility for the game's proprietary asset packages, known as CCB files. These files have a basic header and a file table containing data about the various attributes of the file, and finally compressed data. So far, I've spotted two kinds of compression being used within these CCB files, LZ11 and RLUncomp. I'm not worrying about RLUncomp for the moment, I'm just focusing on LZ11.
One of the strangest things about these CCB files is that the data within them is compressed twice. It goes through one pass of LZ11 compression and produces output exactly like what you would see from a regular LZ11 compression utility. The second pass is the strange one. The data is further compressed, but doesn't actually get any smaller. In a way, it's basically just being obfuscated. An LZ11 decoder will decode both passes just fine, and you wind up right back at the original uncompressed data, but I can't figure out a good reason why a second pass of compression would not compress the data further.
The only documentation I can find on LZ11 compression are some decompression utilities, one known as LZX from Github user PeterLemon (I can't post links due to being a new user, sorry) and one in the DSDecmp utility. However, these resources only provide some header information, not very well documented C code, and a few other bits and pieces.
Can anyone either provide or point me to some more detailed information about the LZ11 compression and decompression algorithms? One of the main reasons I'm writing this tool is that Console Tool is currently the only tool that supports reading CCB files, and even then, it can only extract them as far as I can tell. I want to figure out how the CCB format works so that I can reconstruct new CCB files and reinsert them into the ROM. Also, Console Tool does not allow batch extraction, which is going to be a huge pain if large numbers of assets need to be modified.
TL;DR: Does anyone know how LZ11 compression/decompression actually works?
Thanks everyone!
I am beginning the long process of reverse engineering the various inner workings of Solatorobo: Red the Hunter. I'm very new to the field of DS ROM hacking, and am in the early days of this project, so the first thing I thought I would do to get my feet wet would be to write a custom extraction utility for the game's proprietary asset packages, known as CCB files. These files have a basic header and a file table containing data about the various attributes of the file, and finally compressed data. So far, I've spotted two kinds of compression being used within these CCB files, LZ11 and RLUncomp. I'm not worrying about RLUncomp for the moment, I'm just focusing on LZ11.
One of the strangest things about these CCB files is that the data within them is compressed twice. It goes through one pass of LZ11 compression and produces output exactly like what you would see from a regular LZ11 compression utility. The second pass is the strange one. The data is further compressed, but doesn't actually get any smaller. In a way, it's basically just being obfuscated. An LZ11 decoder will decode both passes just fine, and you wind up right back at the original uncompressed data, but I can't figure out a good reason why a second pass of compression would not compress the data further.
The only documentation I can find on LZ11 compression are some decompression utilities, one known as LZX from Github user PeterLemon (I can't post links due to being a new user, sorry) and one in the DSDecmp utility. However, these resources only provide some header information, not very well documented C code, and a few other bits and pieces.
Can anyone either provide or point me to some more detailed information about the LZ11 compression and decompression algorithms? One of the main reasons I'm writing this tool is that Console Tool is currently the only tool that supports reading CCB files, and even then, it can only extract them as far as I can tell. I want to figure out how the CCB format works so that I can reconstruct new CCB files and reinsert them into the ROM. Also, Console Tool does not allow batch extraction, which is going to be a huge pain if large numbers of assets need to be modified.
TL;DR: Does anyone know how LZ11 compression/decompression actually works?
Thanks everyone!