Last edited by requinDr; December 27th, 2023 at 12:14 PM.
Quick update: I just got a reimplementation of the LenZuCompressor decompressor (mostly) working! The checksum seems to fail, but visual inspection of the output looks correct. Implementation is available here. It's still a mess, and I need to actually figure out what all of the different pieces mean, but it does seem to work. I will update the OP with a detailed description of the format as I do more work on it.
The algorithm looks very similar in principle to DEFLATE; it's an LZ77 encoding that uses Huffman codes (or something very similar) to differentiate between backreferences and literals.
Last edited by DaNike; December 29th, 2023 at 07:31 AM.
OP has been updated with some details of the LenZuCompressor format, and some notes on other files in the game's archives.
I've just finished an actually readable reimplementation of the decompressor here.
A bit of an update regarding my testing.
mrgd00 *.mzp files
It was used before in other games like TsukiRe I believe and I was able to successfully extract many images using https://github.com/Hintay/PS-HuneX_T...e/master/tools
It only requires _extract_mzp.py, _extract_mzp_tiles.py and mzx folder, then follow instructions https://github.com/Hintay/PS-HuneX_T...05-EXTR_mzp.md.
I have extracted all .hfa files so I tried extracting the mzp starting from data00000 and it worked until folder data02001.
From there the program only ouput Unknown type 0x0C.
I assume it's because from there the files are too large. I know there are more programs able to work with .mzp, but I haven't tried them yet because there aren't much point
Regarding .ccit files
Looking at folder data00100 there are only font related files.
All .mzp are, once extracted, .png bitmap fonts (I think it's what it's called, I'm not familiar with it)
The .ccit files in the folder use LenZuCompressor, so they can be extracted with one of the methods provided in this thread.
As suspected by OP, they are metadata files for the fonts. There is a pattern of characters matching the images. Though I'm not able to see much more than that, like character position and size.
Quite a nightmare really since to make a French patch we are missing a few characters, at least on Switch it's a regular .otf file
Last edited by requinDr; January 11th, 2024 at 01:36 PM. Reason: Typo
Has anyone managed to work with the game's script yet? I remember that on Switch it was much easier to extract/edit it.
I can't find where the text boundaries are defined in the games archives. It's possible that they're in the compiled script files, I haven't spent time trying to reverse those. If they are there, it will be difficult to export the script in the same way as the Switch version.
But there was a quickbms script that extracted the script, at least for the switch version, it worked on tsukihime and mahoyo
The text boundaries are the exact same as the Switch/PS4 version. The amount of strings are the same.
(This is also the reason why I was able to diff the Switch vs Steam releases easily: https://gist.github.com/Alyinghood/7...6a7fccbedb5ece )
This is due to the fact that that specific type of image is not supported by the tool, not due to the size of the file.
Last edited by Alyinghood; January 11th, 2024 at 11:39 AM.
The amount of strings is the same, however, since the text is different, the locations in script_text_en.ctd where each string ends is different. In the Switch builds, that information is stored alongside the script text, as a binary file with a sequence of offsets, and the bounds for a given string can be found by indexing into that file. I have so far found no such file in the PC release, though it looks like it might be indexing by line number.
How decomress CompressedBG_MT? How to use hunex_decompression.c?
- - - Updated - - -
I think maybe you should try compiling the .c file and then try to open the file you need with the .exe compiled on cmd.
And how to compile and use it?
Alyinghood gave instructions for hunex_decompression_reuse_exe.c, and I was able to build unpack.exe.
But unpack.exe doesn't do anything with .cbg files.
That's why I'm asking about hunex_decompression.c.
Chatgpt said this after I sent it the code:
To decompress files using the compiled program, you can run it from the command line, providing the input and output file paths. For example:
your_program_name compressed_file.lz uncompressed_file.txt
Program updated to handle CompressedBG_MT.
https://gist.github.com/Alyinghood/2...082bd019482ae3
The same decompression function handles mrgd00, CompressedBG_MT, and LenZuCompressor files. So you can swap out the compression method if you want.
Last edited by Alyinghood; January 17th, 2024 at 09:01 AM.