Editing Pandora
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 21: | Line 21: | ||
= Official JigKick = | = Official JigKick = | ||
The official Jigkick is running as a battery emulator which communicates to the PSP's System Controller | The official Jigkick is running as a battery emulator which communicates to the PSP's System Controller, it passes an authentication using special key IDs set during the challenge when the battery serial is 0xFFFFFFFF if it passes, the GPIO that sets service mode is enabled. | ||
= DTP-T1000/Development Tool JIG Memory Stick Test Mode = | |||
Starting from kbooti 0.7.0, a special JIG test mode exists, it will read an IPL block at 0x2000 on the Memory Stick instead of address 0xBFE01000 if the specific condition is met: | Starting from kbooti 0.7.0, a special JIG test mode exists, it will read an IPL block at 0x2000 on the Memory Stick instead of address 0xBFE01000 if the specific condition is met: | ||
Line 56: | Line 38: | ||
In kbooti revision 3.5.0 this mode skips the XOR step (overwrites the xor key with 00s in the scratchpad) on the kirk header, allowing to use a regular IPL block to achieve code execution and dump the payload (without the xor key). | In kbooti revision 3.5.0 this mode skips the XOR step (overwrites the xor key with 00s in the scratchpad) on the kirk header, allowing to use a regular IPL block to achieve code execution and dump the payload (without the xor key). | ||
= DTP-H1500/Testing Tool JIG Mode = | |||
The Battery emulator will simulate a Pandora battery (serial 0xFFFFFFFF) when the P24 switch on the S3503 DIPSW is set to 1. | The Battery emulator will simulate a Pandora battery (serial 0xFFFFFFFF) when the P24 switch on the S3503 DIPSW is set to 1. | ||
Line 62: | Line 44: | ||
= Custom IPL = | = Custom IPL = | ||
[[JigKick Battery]] and [[Magic Memory Stick]] allow loading [[IPL]] from [[Memory Stick]] instead of NAND, which is useful for unbricking. But the [[IPL]] still has to be encrypted and signed to be accepted by | [[JigKick Battery]] and [[Magic Memory Stick]] allow loading [[IPL]] from [[Memory Stick]] instead of NAND, which is useful for unbricking. But the [[IPL]] still has to be encrypted and signed to be accepted by [[PRE-IPL]]. This was first solved by Bruteforce attack (?2005? ?2007?). Then in 2011 [[KIRK Crypto Engine]] command 1 key got retrieved thanks to PS3 hack, and allowed properly encrypting and signing IPL, as demonstrated by mathieulh in 2018. | ||
== IPL Bruteforce Attack == | == IPL Bruteforce Attack == | ||
See [https://events.ccc.de/congress/2007/Fahrplan/attachments/1040_psphacking.odp 24C3 Talk by Tyranid (2007)]. [http://uofw.github.io/upspd/docs/SilverSpring_Blog/my.malloc.us/silverspring/pandora-exploit/index.html | See [https://events.ccc.de/congress/2007/Fahrplan/attachments/1040_psphacking.odp 24C3 Talk by Tyranid (2007)]. [http://uofw.github.io/upspd/docs/SilverSpring_Blog/my.malloc.us/silverspring/pandora-exploit/index.html PRE-IPL exploit writeup by SilverSpring] | ||
The fake encrypted data is bruteforced to decrypt into your chosen data (to be able to exploit the [[ | The fake encrypted data is bruteforced to decrypt into your chosen data (to be able to exploit the [[PRE-IPL]]). And the signature for your fake encrypted data is bruteforced again to make it appear valid in the eyes of the crypto engine so that it will will go ahead and decrypt your fake encrypted data. | ||
The [[ | The [[PRE-IPL]] exploit works like this: | ||
<pre> | <pre> | ||
Line 90: | Line 72: | ||
Which means load 0xF50-byte data to 0x040F1EA0. 0xB71C6EBA is the checksum of the previous block. Then entry address is 0 since it hasn't reached the end yet and there are more blocks to load. Once it has loaded all the IPL blocks, the very last block will have entry address of where the whole IPL has been loaded (typically 0x040F0000). And will then jump to that address. | Which means load 0xF50-byte data to 0x040F1EA0. 0xB71C6EBA is the checksum of the previous block. Then entry address is 0 since it hasn't reached the end yet and there are more blocks to load. Once it has loaded all the IPL blocks, the very last block will have entry address of where the whole IPL has been loaded (typically 0x040F0000). And will then jump to that address. | ||
PRE-IPL pseudocode for loading and decrypting the IPL: | |||
<pre> | <pre> | ||
Line 130: | Line 112: | ||
</pre> | </pre> | ||
As the | As the PRE-IPL loads the first IPL block (the fake one), it decrypts the block in-place, ie. the decrypted block just overwrites your encrypted block. The fake block only decrypts into four bytes of all 0's so it ends up only overwriting the first four bytes of your fake block (with four 0's) after decryption. | ||
The fake signed block: | The fake signed block: | ||
Line 156: | Line 138: | ||
A slight flaw in the crypto engine allowed bruteforce to be performed on a magnitude-times smaller scale than normally required. | A slight flaw in the crypto engine allowed bruteforce to be performed on a magnitude-times smaller scale than normally required. | ||
After decryption, the | After decryption, the PRE-IPL thinks the data is now a decrypted IPL block. | ||
So note the first 0x10 bytes: | So note the first 0x10 bytes: | ||
Line 296: | Line 278: | ||
</pre> | </pre> | ||
* IPL Block for Prototype (0.4 and 0.6) | * IPL Block for Prototype (0.4 and 0.6) PRE-IPL, containing the following MIPS assembly instructions (the jal instruction is not used because of the address length, instead the address is stored to a register using the load immediate instruction, then the jump register instruction is used to jump to it, assembly is used to artificially make the jump because older IPL blocks cannot contain an entrypoint value, the old PRE-IPL instead jumps to 0x88400000 as an hardcoded entrypoint address): | ||
<pre> | <pre> | ||
.set noreorder | .set noreorder | ||
Line 308: | Line 290: | ||
</pre> | </pre> | ||
This block will jump to 0xBFE01100 so you can use this block as if you were using a Pandora IPL block on the prototype | This block will jump to 0xBFE01100 so you can use this block as if you were using a Pandora IPL block on the prototype PRE-IPL, which saves you time from encrypting new IPLs every time you need to test a new build. | ||
Note: There is no 0xBFC00100 IPL block for the prototype | Note: There is no 0xBFC00100 IPL block for the prototype PRE-IPL because they do not load IPL blocks there and you cannot use that address as it would overwrite the PRE-IPL code itself which does not use a payload section/address and runs entirely from 0xBFC00000. | ||
<pre> | <pre> | ||
Line 333: | Line 315: | ||
</pre> | </pre> | ||
* IPL Block for 0.7.0 and later (up to 2.7.1) | * IPL Block for 0.7.0 and later (up to 2.7.1) PRE-IPL, containing the previously mentioned jr MIPS assembly instruction to address 0xBFE01100 | ||
This IPL block has been tested successfully on 2.6.0 and 2.7.1 kbooti. | This IPL block has been tested successfully on 2.6.0 and 2.7.1 kbooti. | ||
Line 361: | Line 343: | ||
These are available in binary format here: [https://mega.nz/#F!MlFi1QqZ!fGo2pkCEmjFiPynKtDC0Hg download link]. | These are available in binary format here: [https://mega.nz/#F!MlFi1QqZ!fGo2pkCEmjFiPynKtDC0Hg download link]. | ||
The 0xBFD00100 version of these blocks work as-is by replacing the time attacked forged block with the properly encrypted ones supplied. The 0xBFE01100 and 0xBFCD00100 version (which only works on Development Tool units), may require you to rebuild/recompile your custom IPLs using 0xBFE01100 or 0xBFCD00100 as the entrypoints respectively, as well as using a modified iplboot | The 0xBFD00100 version of these blocks work as-is by replacing the time attacked forged block with the properly encrypted ones supplied. The 0xBFE01100 and 0xBFCD00100 version (which only works on Development Tool units), may require you to rebuild/recompile your custom IPLs using 0xBFE01100 or 0xBFCD00100 as the entrypoints respectively, as well as using a modified iplboot as the one used by retail custom IPLs uses PRE-IPL hardcoded addresses. It may be wiser to rebuild it as a fully valid IPL instead using ipltool [https://github.com/zecoxao/ipltool], although using the Pandora compatible IPL block instead would allow you to port retail custom IPL projects on devkit with minimal efforts. | ||
Keep in mind that under normal circumstances neither the Memory Stick nor the NAND devices are initialized by the DTP-T1000 | Keep in mind that under normal circumstances neither the Memory Stick nor the NAND devices are initialized by the DTP-T1000 PRE-IPL. Reading or writing to and from either of these devices will require you to add the initialization routine to your IPL (most likely within your iplboot binary). | ||
The IPL SDK (available here: [https://github.com/mathieulh/PSP_IPL_SDK]) contains full low-level driver implementation for both devices which you can use in your projects. | The IPL SDK (available here: [https://github.com/mathieulh/PSP_IPL_SDK]) contains full low-level driver implementation for both devices which you can use in your projects. |