This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PGD Decryption
#7
(03-06-2011, 09:17 PM)Hykem Wrote: Thanks to Darth's help, I was finally able to decrypt and reverse the necessary parts of the PGD header struct which, in turn, allowed to sucessfully decrypt most of the known existing PGD files. Wink

-----------------------------------------------------------------------------------
[PGD File header]:
Code:
0x00: 00 50 47 44 01 00 00 00 01 00 00 00 00 00 00 00 -> " PGD" and three bit fields that act as flags for version and encryption mode.
0x10: AES-128 bit hash key used for header decryption.
0x20: Generated hash from the 0x10 key.
0x30 - 0x50: Encrypted header of the PGD which when decrypted reveals a new hash key and four bit fields. The first is NULL, the second represents the decrypted data size, the third is the decrypting chunk size and the fourth is the data hash address.
0x60: File hash.
0x70: Hash generated from the sceIoIoctl key.
0x80: Encrypted hash generated from the sceIoIoctl key.
0x90: Data hash.
0xA0: Encrypted data hash.
-----------------------------------------------------------------------------------

By using the hash key obtained at 0x30 and decrypting the whole file again, starting at 0x90 this time, it's now possible to obtain the original plain binary file. This works great for smaller files, but for huge files, like in KHBBS case, Java needs to work with streams to avoid running out of heap.
I'll commit all this for now in order to be tested with the other games that make a less important usage of these files, but I'm still working on integrating a read/write decryption that works by chunks for the big data files.

Enjoy! Big Grin

You're great man... ;-)
Reply


Messages In This Thread
PGD Decryption - by Hykem - 03-05-2011, 08:04 PM
RE: PGD Decryption - by BlackDaemon - 03-05-2011, 09:05 PM
RE: PGD Decryption - by Darth1701 - 03-06-2011, 07:13 AM
RE: PGD Decryption - by Hykem - 03-06-2011, 05:47 PM
RE: PGD Decryption - by hyperspeedgx - 03-06-2011, 09:12 PM
RE: PGD Decryption - by Hykem - 03-06-2011, 09:17 PM
RE: PGD Decryption - by skyeyes83 - 03-07-2011, 12:07 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)