XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Jan 19, 2018 12:37 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Okami HD - PC File Encrypted
PostPosted: Wed Dec 13, 2017 11:51 pm 
Offline
ultra-n00b
User avatar

Joined: Thu Jan 17, 2013 5:39 pm
Posts: 5
Location: Italy
Has thanked: 2 times
Have thanks: 1 time














You can make the ads go away by registering

I need help to decrypt Okami HD PC files.
I uploaded an example of an encrypted and decrypted file


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: Okami HD - PC File Encrypted
PostPosted: Fri Dec 15, 2017 5:35 pm 
Offline
n00b

Joined: Fri Dec 15, 2017 5:21 pm
Posts: 13
Has thanked: 1 time
Have thanks: 16 times
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).


Top
 Profile  
 
 Post subject: Re: Okami HD - PC File Encrypted
PostPosted: Sat Dec 16, 2017 12:00 am 
Offline
VIP member
VIP member

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 987
Has thanked: 1983 times
Have thanks: 520 times
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:

_________________
Noesis
Hex2obj
QuickBMS
TextureFinder
Unity Assets Bundle Extractor


Top
 Profile  
 
 Post subject: Re: Okami HD - PC File Encrypted
PostPosted: Sat Dec 16, 2017 1:09 am 
Offline
n00b

Joined: Fri Dec 15, 2017 5:21 pm
Posts: 13
Has thanked: 1 time
Have thanks: 16 times
AceWell wrote:
nice work! :D what was the key, if you don't mind me asking? :scaredy:


Code:
YaKiNiKuM2rrVrPJpGMkfe3EK4RbpbHw

I guess someone was hungry... :D


Top
 Profile  
 
 Post subject: Re: Okami HD - PC File Encrypted
PostPosted: Mon Dec 18, 2017 6:00 pm 
Offline
veteran
User avatar

Joined: Fri Nov 05, 2010 10:14 pm
Posts: 139
Has thanked: 0 time
Have thanks: 49 times
Quick observation: the actual key is read from the file data_pc/config/flower.cip. It's encrypted with master key
Code:
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


Top
 Profile  
 
 Post subject: Re: Okami HD - PC File Encrypted
PostPosted: Tue Dec 19, 2017 10:57 am 
Offline
n00b

Joined: Fri Dec 15, 2017 5:21 pm
Posts: 13
Has thanked: 1 time
Have thanks: 16 times
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.

Quote:
"- 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.


Top
 Profile  
 
 Post subject: Re: Okami HD - PC File Encrypted
PostPosted: Thu Dec 21, 2017 6:26 pm 
Offline
veteran
User avatar

Joined: Fri Nov 05, 2010 10:14 pm
Posts: 139
Has thanked: 0 time
Have thanks: 49 times
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group