John-K / pspdecrypt

Simple tool to decrypt PSP binaries
GNU General Public License v3.0
103 stars 22 forks source link

Add support for the devkit kbooti/IPL blocks #31

Open mathieulh opened 3 years ago

mathieulh commented 3 years ago

The devkit kbooti/bootdispi/formati/dformat...., which contain devkit IPL blocks aren't supported yet,

These are the changes that need to be done:

All files that start with the following 0x10 bytes need to have the initial 0x1000 bytes skipped as the IPL only starts at 0x1000 in the file:

119D57D9E9DBA671F21092278A53E44D // kbooti 0.4.0

38045D6178F2501329690FCDF18F0930 // kbooti 0.6.0

C823470DD088E9126CE1E4F45CC90D0B // kbooti 0.7.0

D1ECAA62F333D3294519D95FF3402F8B // kbooti 0.9.0

027A247EB68166EEAC05EC157A328DFF // kbooti 2.6.0

1E9AD1BA7F28E2FE3DC329BD43B18B79 // kbooti 2.7.1

F3A5DBD7BA2064CD0786CE78B0EB6683 // kbooti 3.5.0

If the IPL blocks are using kbooti 3.5.0 (the file starts with the 0xF3A5DBD7BA2064CD0786CE78B0EB6683 bytes), then an xor step needs to be applied to the kirk1 header of each blocks (0x40 bytes of each blocks)

XOR key: 0E82DE13A84BB23E1FEC71542153C45A A97D9B6A461B761DD1B921E594E08D4F 96402C0524660D700C8FFEB089D53E0E 6390CE0E5E71CBA581915314993E3474

A specific seed hash key also needs to be used to decrypt later IPL stages:

8E939AF03C553F7775317044853D9323 6C7F856DCF97F759EFC3236762E80AF7 4A9561D58704E6538410D9EEBFED2E97 EE4C8B042BC817DFD3D91EF6714055F7

See here for more info here https://playstationdev.wiki/pspdevwiki/index.php?title=Keys#3.5.0_DTP-T1000_Lib-PSP_iplloader

If kbooti 0.4.0 or 0.6.0 are used, the IPL format only uses a single block (like stage 3 IPLs on retails)