Hello. I need help with unpacking CPK archive of Persona 5 Royal. Every tool I've tried can extract only ~80% of the archive because some data is encrypted:
I unpack it manually (see attached file). This is common chunk with CRILAYLA magic, but it's body looks encrypted.
I think it must be decrypted before decompression.
And I found this code.
I use this code to decompress encrypted CRILAYLA chunk, but I got Index Out of Range Exception in GetNextBits method (offsetP is -1 during decompression). LAYLA codec use backwards method for decompression data (from tail of compressed body to it's head). I tried to catch the exception and decompress this chunk, but some data in header of the file is corrupted. Which means only part of the data encrypted.