Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
DeathChaos
Posts: 10
Joined: Fri Jul 20, 2018 2:27 pm

Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Post by DeathChaos »

I've tried every public CPK file extractor that i could find, but they dont account for file properties, so when they get to any encrypted file in the CPK, they error out and extraction fails, rendering the rest of the files in the CPK after the first encrypted file unable to extract.

Is there an extractor that can either extract the file without decrypting, or skip extracting encrypted files so that we may successfully get the rest of the files?

The game contains 3 CPK files,
- dataR.cpk (5.18GB)
- ps4_movieR.cpk (11.3GB)
- ps4R.cpk (8.67GB)

The game got an update/patch that added a smaller CPK (4mb), this CPK also contains encrypted files and thus has the same issue.

Link to patch cpk file: https://cdn.discordapp.com/attachments/377899265424621569/743884253485596793/patch1R.cpk.

edit: ps4R.cpk link: https://drive.google.com/file/d/1aCjLaxZNkyAdyMdGvBwOFFaHLJxx1-Dj/view?usp=sharing

extracts less than 10 files before hitting an encrypted one and failing
Last edited by DeathChaos on Fri Aug 14, 2020 7:41 pm, edited 1 time in total.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Post by Ekey »

Not encrypted. Works fine with CriPakTools.
DeathChaos
Posts: 10
Joined: Fri Jul 20, 2018 2:27 pm

Re: Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Post by DeathChaos »

Ekey wrote:Not encrypted. Works fine with CriPakTools.


I will upload ps4R.cpk to google drive, that one contains encrypted files.

Edit: What version of CriPakTools? Seems to fail extraction for me on patch cpk.
Last edited by DeathChaos on Fri Aug 14, 2020 6:06 pm, edited 1 time in total.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Post by Ekey »

Even if the files are encrypted there, without reverse engineering is indispensable.

PS: https://github.com/ShrineFox/CriPakTools
DeathChaos
Posts: 10
Joined: Fri Jul 20, 2018 2:27 pm

Re: Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Post by DeathChaos »

Even that tool fails extracting the patch cpk file like the others.

Code: Select all

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at LibCPK.CPK.get_next_bits(Byte[] input, Int32& offset_p, Byte& bit_pool_p, Int32& bits_left_p, Int32 bit_count) in D:\Github\cpk\CriPakTools\LibCPK\CPK.cs:line 913
   at LibCPK.CPK.DecompressCRILAYLA(Byte[] input, Int32 USize) in D:\Github\cpk\CriPakTools\LibCPK\CPK.cs:line 792
   at CriPakTools.Program.Main(String[] args) in D:\Github\cpk\CriPakTools\CriPakTools\Program.cs:line 214
DeathChaos
Posts: 10
Joined: Fri Jul 20, 2018 2:27 pm

Re: Extracting files form CPK with Encrypted files (Persona 5 Royal JP)

Post by DeathChaos »

Unfortunately it doesn't seem to work even after enabling the Heroes Decrypt option.