PDA

View Full Version : Custom IPL sample



wraggster
August 30th, 2007, 14:48
Moonlight (http://forums.ps2dev.org/viewtopic.php?t=8850) posted this a few days ago, (only of note to coders and hackers):


This is an example (with source) of a very simple custom ipl with only 2 features :)
The custom ipl extends the 1.50 one. The copyrighted material (sony 1.50 original ipl) has to be provided by the user in form of the 1.50 updater.

Download:

http://www.megaupload.com/?d=A0SN4362

Feature for user:

- It bypasses ta-082+ brick, so you can have a ta-082+ without any key patched running 1.50 kernel based firmwares.

Feature for programmer:

- It dumps 0xbfc00000, the psp boot code prior to ipl, to the address 0x883e0000 (which is not touched by 1.50 kernel). To get the boot code in a 1.50 original firmware, just run kdumper, and extract 0x3e0000-0x3effff from the kmem.bin file -> that's the psp boot code. If you are in a cfw, you will have to execute the kdumper as a recovery or autoboot, because the 3.XX kernel overwrites the 0x883e0000 memory.

Note that this ipl is flashed to the nand, not written to the ms.

Some info about the ipl, etc.

- The first instruction executed by the PSP at boot is 0xbfc00000. This memory address is not the same than the 0xbfc00000 that can be accesed when the system has booted.

- The memory is read only, so variables cannot be written. Because of this, the psp boot code copies code from itself to the scratchpad memory (0x80010000).

- There is memory section 0xbfd00000-0xbfd01000. This is the one that will be converted later in the 0xbfc00000 that programmers usually know.

- One of the first things SCE ipl's do is to reset the main cpu. In the 1.50 ipl, this happen at address 0x040f0070-0x040f0084. When the cpu is reseted, what 0xbfc00000 memory was cannot be accesed anymore. The 0xbfd00000 memory gets remapped as 0xbfc00000, and 0xbfd00000 is now an invalid memory address.

- Since 2.60, SCE aproached that fact to encrypt their ipl's: they used as a seed for a prng the 0xbfc00000 memory before the reset, to decrypt main.bin (main.gz), knowing that it would be impossible to dump it after the reset. They also played with the two meanings of 0xbfc00000 to cause confussion.
While it appeared to be an intelligent move to hide their ipl's, it wasn't really that intelligent: they made us to have much curiosity for that memory, and we didn't stop until we dumped it :) That curiosity ended in service mode. If they hadn't hidden their ipl's... maybe Pandora wouldn't exist today, who knows.

- IPL is executed when returning from sleep mode too. Main.bin follows two different branches depending if it is plain boot or sleep mode return, as obviously the kernel is not booted again. The code branch can be seen at address 0x04000490 in main.bin of the 1.50 ipl:

Code:

u32 x;
func04005074(&x);

if (x & 0x80)
sleep mode return;
else
plain boot;



The function 0x04005074 is equivalent to the syscon function sceSyscon_driver_F775BC34.

- When not in service mode, the memory stick power is off, and the memory stick routines causes an infinite loop. To use the memory stick in a nand ipl, you have to power on the ms yourself.

- The service mode conditional can be found beginning at address 0x8001004c in the psp boot code:

Code:

if ((*(u32 *)0xbe240004) & 0x10)
{
use memory stick ipl routines;
}
else
{
use nand ipl routines;
}

Cloudhunter
August 30th, 2007, 15:06
Might be good to say that it was created by Dark_AleX :)

Cloudy

nukester
August 30th, 2007, 17:03
can this be used straight after i have used padora's battery and then upgrade to 3.52 m33

E.J.
August 30th, 2007, 19:42
Wow, very impressive!!, so Sony dug their own grave!, jaja

Shiori
August 30th, 2007, 22:05
Custom ipl's?

... This means new worlds for psp. :)...

nukester
August 30th, 2007, 23:09
Moonlight (http://forums.ps2dev.org/viewtopic.php?t=8850) posted this a few days ago, (only of note to coders and hackers):


This is an example (with source) of a very simple custom ipl with only 2 features :)
The custom ipl extends the 1.50 one. The copyrighted material (sony 1.50 original ipl) has to be provided by the user in form of the 1.50 updater.

Download:

http://www.megaupload.com/?d=A0SN4362

Feature for user:

- It bypasses ta-082+ brick, so you can have a ta-082+ without any key patched running 1.50 kernel based firmwares.

Feature for programmer:

- It dumps 0xbfc00000, the psp boot code prior to ipl, to the address 0x883e0000 (which is not touched by 1.50 kernel). To get the boot code in a 1.50 original firmware, just run kdumper, and extract 0x3e0000-0x3effff from the kmem.bin file -> that's the psp boot code. If you are in a cfw, you will have to execute the kdumper as a recovery or autoboot, because the 3.XX kernel overwrites the 0x883e0000 memory.

Note that this ipl is flashed to the nand, not written to the ms.

Some info about the ipl, etc.

- The first instruction executed by the PSP at boot is 0xbfc00000. This memory address is not the same than the 0xbfc00000 that can be accesed when the system has booted.

- The memory is read only, so variables cannot be written. Because of this, the psp boot code copies code from itself to the scratchpad memory (0x80010000).

- There is memory section 0xbfd00000-0xbfd01000. This is the one that will be converted later in the 0xbfc00000 that programmers usually know.

- One of the first things SCE ipl's do is to reset the main cpu. In the 1.50 ipl, this happen at address 0x040f0070-0x040f0084. When the cpu is reseted, what 0xbfc00000 memory was cannot be accesed anymore. The 0xbfd00000 memory gets remapped as 0xbfc00000, and 0xbfd00000 is now an invalid memory address.

- Since 2.60, SCE aproached that fact to encrypt their ipl's: they used as a seed for a prng the 0xbfc00000 memory before the reset, to decrypt main.bin (main.gz), knowing that it would be impossible to dump it after the reset. They also played with the two meanings of 0xbfc00000 to cause confussion.
While it appeared to be an intelligent move to hide their ipl's, it wasn't really that intelligent: they made us to have much curiosity for that memory, and we didn't stop until we dumped it :) That curiosity ended in service mode. If they hadn't hidden their ipl's... maybe Pandora wouldn't exist today, who knows.

- IPL is executed when returning from sleep mode too. Main.bin follows two different branches depending if it is plain boot or sleep mode return, as obviously the kernel is not booted again. The code branch can be seen at address 0x04000490 in main.bin of the 1.50 ipl:

Code:

u32 x;
func04005074(&x);

if (x & 0x80)
sleep mode return;
else
plain boot;



The function 0x04005074 is equivalent to the syscon function sceSyscon_driver_F775BC34.

- When not in service mode, the memory stick power is off, and the memory stick routines causes an infinite loop. To use the memory stick in a nand ipl, you have to power on the ms yourself.

- The service mode conditional can be found beginning at address 0x8001004c in the psp boot code:

Code:

if ((*(u32 *)0xbe240004) & 0x10)
{
use memory stick ipl routines;
}
else
{
use nand ipl routines;
}


can this be used straight after i have used padora's battery and then upgrade to 3.52 m33

burrito
August 30th, 2007, 23:30
If you upgrade to 3.52 M33-4, then install this custom IPL, then dump the nand with pandora, you can now flash the nand to any motherboard psp because of the custom ipl.

Buddy4point0
August 30th, 2007, 23:36
yea.... so what does this doo?

blaz3d
August 30th, 2007, 23:41
- It bypasses ta-082+ brick, so you can have a ta-082+ without any key patched running 1.50 kernel based firmwares.

this would also mean that you would be able to upgrade to above 3.40 with ta-082+ boards with their id storage un-changed. if used in the way burrito describes. correct me if im wrong

Prasoc
August 31st, 2007, 13:20
haha custom ipls what will they think of next :)