Persona 5 Royal (Steam)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
LinkOFF
Posts: 88
Joined: Thu Aug 11, 2016 6:52 pm

Persona 5 Royal (Steam)

Post by LinkOFF »

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:
Image
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.

Full archive - https://drive.google.com/file/d/17sGnpH ... sp=sharing
EXE(Denuvo) - https://drive.google.com/file/d/1fW01jo ... sp=sharing
Switch version of the game is decrypted.
LinkOFF
Posts: 88
Joined: Thu Aug 11, 2016 6:52 pm

Re: Persona 5 Royal (Steam)

Post by LinkOFF »

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.

It's looks like this:
Image
LinkOFF
Posts: 88
Joined: Thu Aug 11, 2016 6:52 pm

Re: Persona 5 Royal (Steam)

Post by LinkOFF »

I found out that only the first 1024 bytes are encrypted (start from 0x20). I applied xor difference to another chunk, but nothing.