Offtopic: Into Commodore 64 (6502) coding, pixeling or music?
Xentax is looking for new members for the C64 activities!
Just drop us a message at forum@xentax.com and join the Scene Team!

Forum rules: Click here

Okami HD - PC File Encrypted

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
User avatar
Scorpion2k7
ultra-n00b
Posts: 6
Joined: Thu Jan 17, 2013 5:39 pm
Location: Italy
Has thanked: 3 times
Been thanked: 1 time

Okami HD - PC File Encrypted

Post by Scorpion2k7 » Wed Dec 13, 2017 11:51 pm

I need help to decrypt Okami HD PC files.
I uploaded an example of an encrypted and decrypted file
You do not have the required permissions to view the files attached to this post.

ffgriever
beginner
Posts: 28
Joined: Fri Dec 15, 2017 5:21 pm
Has thanked: 1 time
Been thanked: 27 times

Re: Okami HD - PC File Encrypted

Post by ffgriever » Fri Dec 15, 2017 5:35 pm

It's blowfish with 256bit key. The key had to be (obviously) in the game. I wrote yesterday a tool to decrypt/encrypt it (I'm porting our Polish translation project from PS2 to PC). Don't mind "compress/decompress" in usage, I've copied that part from my another tool ^^. Have fun.

http://ff12.pl/down/okami-encdec.zip

PS. Your encrypted file doesn't match your decrypted file. I guess you either used a memory dump, where pointers might've been overwritten or you've used a files from another system (PS2/WII/PS3).

User avatar
Acewell
VIP member
VIP member
Posts: 1275
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2417 times
Been thanked: 747 times

Re: Okami HD - PC File Encrypted

Post by Acewell » Sat Dec 16, 2017 12:00 am

ffgriever wrote:It's blowfish with 256bit key. The key had to be (obviously) in the game.
nice work! :D what was the key, if you don't mind me asking? :scaredy:

ffgriever
beginner
Posts: 28
Joined: Fri Dec 15, 2017 5:21 pm
Has thanked: 1 time
Been thanked: 27 times

Re: Okami HD - PC File Encrypted

Post by ffgriever » Sat Dec 16, 2017 1:09 am

AceWell wrote:nice work! :D what was the key, if you don't mind me asking? :scaredy:

Code: Select all

YaKiNiKuM2rrVrPJpGMkfe3EK4RbpbHw
I guess someone was hungry... :D

User avatar
GMMan
veteran
Posts: 139
Joined: Fri Nov 05, 2010 10:14 pm
Been thanked: 54 times

Re: Okami HD - PC File Encrypted

Post by GMMan » Mon Dec 18, 2017 6:00 pm

Quick observation: the actual key is read from the file data_pc/config/flower.cip. It's encrypted with master key

Code: Select all

M2m2sukiYAKIx3pcWgj4Mue3Nh7gapQe
Messing about with some other stuff...
You can run the game with decrypted files by changing the constructor for m2::ResourceReadConfig in hx::SingletonObject<class m2::ResourceReadConfig>::getSingletonInstance(void) (it's the instruction assigning a 1 to a static location near the end of the function, change that to assign 0). The decrypted files need to be in the "data" folder instead of "data_pc". There are also two places you need to patch because apparently someone forgot to turn off a thread when encryption isn't used and it would crash. Search references to m2::ResourceReadConfig::GetUseCipherResource(void) and nop the conditional jump in the last two references. Note you'll need to retain flower.cip even though you don't need to do so usually if they didn't leave that thread running.
Currently researching: Alpha Prime scripting (AI and mods)
Queued: EE .cache repacking, CustomPak repacking, Gameloft Scrambled Zip multitool, GRAF Extractor Skeleton repacking, Gun Metal filenames CRC

ffgriever
beginner
Posts: 28
Joined: Fri Dec 15, 2017 5:21 pm
Has thanked: 1 time
Been thanked: 27 times

Re: Okami HD - PC File Encrypted

Post by ffgriever » Tue Dec 19, 2017 10:57 am

Thanks. Nice finds. It will be helpful for quick changes and testing. To be honest, though, I've never understood this kind of forced and useless code. What was the point? The implementation was simple and didn't take much time, but has certainly cost a measurable amount of money to develop and test. I've got a feeling that it has more to do with board of directors wishes than developers' actual plans.
"- You need to add some protection, you know, that flashy, sparky, magic thing or code or whatever it's called to protect something, wait, assets right, that's what you call it? But make it fast and don't generate any more costs."
(a day has passed)
"- It's protected, see?! This encryption cannot be bruteforced within billions of years!" (then whispering to himself "...but the keys are under the doormat").
"- Jolly good! Now our shareholders will be relieved!"
Just a random rant :D . Even though I enjoy challenge, I'm actually glad it's that obvious this time, as I don't have as much free time to spare as I had 10 or 15 years ago.

User avatar
GMMan
veteran
Posts: 139
Joined: Fri Nov 05, 2010 10:14 pm
Been thanked: 54 times

Re: Okami HD - PC File Encrypted

Post by GMMan » Thu Dec 21, 2017 6:26 pm

It also helps that it literally tells you it's Blowfish.
Currently researching: Alpha Prime scripting (AI and mods)
Queued: EE .cache repacking, CustomPak repacking, Gameloft Scrambled Zip multitool, GRAF Extractor Skeleton repacking, Gun Metal filenames CRC

neuokami
ultra-n00b
Posts: 2
Joined: Tue Oct 01, 2019 5:00 pm

Re: Okami HD - PC File Encrypted

Post by neuokami » Wed Oct 02, 2019 3:21 am

ffgriever wrote:
Fri Dec 15, 2017 5:35 pm
It's blowfish with 256bit key. The key had to be (obviously) in the game. I wrote yesterday a tool to decrypt/encrypt it (I'm porting our Polish translation project from PS2 to PC). Don't mind "compress/decompress" in usage, I've copied that part from my another tool ^^. Have fun.

http://ff12.pl/down/okami-encdec.zip

PS. Your encrypted file doesn't match your decrypted file. I guess you either used a memory dump, where pointers might've been overwritten or you've used a files from another system (PS2/WII/PS3).
HI, I am a member of the team who have made Chinese localization version of Okami PS2 PS3 and PC. What I have been doing is helping translation, modifying the illustrations. Although the localization process has already been completed and all the texture in the game has been translated as well, I still have some regrets, I want to make Clover logo back in the game, the tech support who provide me the unpacked dds files in my team wouldn't help me with that.

Here is the file name of logo in the opening scene
8A74C5148C436C429FD631EF67ED0EF7:Capcom
171D331CF51A649D37CA2C4C15A3F8B8:Criware
E30ED897FD16CC6607B04DEBCB2D103C:hexa drive

I was wonder if you could tell me where to find these files or how to find .dds in .dat.
Best regards.
You do not have the required permissions to view the files attached to this post.

neuokami
ultra-n00b
Posts: 2
Joined: Tue Oct 01, 2019 5:00 pm

Re: Okami HD - PC File Encrypted

Post by neuokami » Wed Oct 02, 2019 8:56 am

I was foolish, problem solved.

Post Reply