MSQ wrote:spiritovod, anakronus
Thank you for the script, this works perfectly on the larger CPK files! I am sorry for the confusion regarding the differences in platforms, I did not realise the files were different in this case.
Edit: The CPK containers are not encrypted, I just messed up my game files (I might have accidentally encrypted them?) not too sure, but I can confirm that after clean reinstalling, the files definitely have the CPK header by default and by no means are fully encrypted. Sorry about this!
To further my knowledge of this topic: would there be a way to create a tool that decrypts the crilayla streams while they are still inside the CPK, or is it a must that each stream must be unpacked then decrypted. Thanks again!
I am not sure if it fits your criteria, but I've made modified the CriPakTools source code to run quickbms to decrypt the blowfish encryption.
Here's the program with source code included:
https://drive.google.com/file/d/1UxyqVh ... sp=sharing
Source:
https://drive.google.com/file/d/1SgG3uv ... sp=sharing
I've added a new -q argument to take in blowfish encryption key while decrypting files. It will automatically decrypts the encrypted data using quickbms before passing it back to the original program to decrypt (thus automatically decompress CRILAYLA compression)
Usage:
CriPakTools -x -i "the_path_to_CPK_you_want_to_decrypt" -d "the_path_to_decrypted_folder" -q "blowfish_encryption_key"
e.g.
If I want to extract psg00.cpk
CriPakTools -x -i "psg00.cpk" -d "unpacked" -q "CryptedByMititei"
If you are interested in repacking the CPK files (to mod), unfortunately I don't have many luck using the original CriPakTools to have good result (the pointers are all over the place).
Due to this, I made a workaround that instead of injecting / replace the files, the program will encrypt the files inside the repacked CPK.
I've added a new argument -p for this
Usage:
CriPakTools -p -i "the_path_to_CPK_you_want_to_encrypt" -o "output_encrypted_CPK_path" -q "blowfish_encryption_key"
e.g.
CriPakTools -p -i "psg00.cpk" -o "psg00-encrypted.cpk" -q "CryptedByMititei"
However, due to the limitation of CriPakTools, there's some CPK that's going to spew out error due to wrong ITOC header reading code.
If that's the case I would suggest to manually extract the encrypted data chunk from CPK, and manually decrypt it using the bms script.
The decrypted data should have a CRILAYLA header, and if it does, copy and replace the data inside the original encrypted CPK with it, and you should be able to decrypt them normally using any cpk decompression tool.
For repack do the same step but in reverse.
Hopefully this helps with the asset extractions.