FW100_ipl_update (update :P)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
0okm0000
Posts: 116
Joined: Fri Jan 13, 2006 9:51 am
Contact:

FW100_ipl_update (update :P)

Post by 0okm0000 »

CAUTION :
 人柱版。实验用。超危险。无保证,责任自负。
 任何事也会发生。最好避免使用。
 安全出口 → http://www.playstation.jp/psp/

 人柱版。実験用。超危険。無保証自己責任。
 なにが起きても知りません。避けて通るのが吉。
 非常出口 → http://www.playstation.jp/psp/

 To sacrifice yourself. Experimental. Extremely dangerous.
 No warranty. Use on your own risk and responsibility.
 Anything may happen. We recommend you to avoid seeing/downloading/using this.
 Emergency exit -> http://www.playstation.jp/psp/
 * this CAUTION copy from SEC(nem) :p

groepaz wrote:there is no "mix". its just about programming the 1.0 ipl into another firmware, which is pretty much pointless other than for seeing it actually works (or not). merely an interisting experiment for people who know what they are doing.
if you dont know exactly what it does and what you could use it for by looking at the posted code, forget it. you dont need it at all.
Don't use "IPL Data" from "ridge racers's kbooti.bin"
it will brick your PSP !!!

Code: Select all

// most of code from moonlight & PspPet

#include <pspkernel.h>
#include <psptypes.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <pspdebug.h>

PSP_MODULE_INFO&#40;"FW100_ipl_update", 0x1000, 1, 1&#41;;

PSP_MAIN_THREAD_ATTR&#40;0&#41;;

PSP_HEAP_SIZE_KB&#40;0&#41;;

#define printf pspDebugScreenPrintf

int &#40;* sceIplUpdateClearIpl&#41;&#40;void&#41;;
int &#40;* sceIplUpdateSetIpl&#41;&#40;void&#41;;

/*** This function from PspPet PSARDUMPER ***/
static u32 FindProc&#40;const char* szMod, const char* szLib, u32 nid&#41;
&#123;
    SceModule* modP = sceKernelFindModuleByName&#40;szMod&#41;;
    if &#40;modP == NULL&#41;
    &#123;
        printf&#40;"Failed to find mod '%s'\n", szMod&#41;;
        return 0;
    &#125;
    SceLibraryEntryTable* entP = &#40;SceLibraryEntryTable*&#41;modP->ent_top;
    while &#40;&#40;u32&#41;entP < &#40;&#40;u32&#41;modP->ent_top + modP->ent_size&#41;&#41;
    &#123;
        if &#40;entP->libname != NULL && strcmp&#40;entP->libname, szLib&#41; == 0&#41;
        &#123;
            // found lib
            int i;
            int count = entP->stubcount + entP->vstubcount;
            u32* nidtable = &#40;u32*&#41;entP->entrytable;
            for &#40;i = 0; i < count; i++&#41;
            &#123;
                if &#40;nidtable&#91;i&#93; == nid&#41;
                &#123;
                    u32 procAddr = nidtable&#91;count+i&#93;;
                    printf&#40;"entry found&#58; '%s' '%s' = $%x\n", szMod, szLib, &#40;int&#41;procAddr&#41;;
                    return procAddr;
                &#125;
            &#125;
            printf&#40;"Found mod '%s' and lib '%s' but not nid=$%x\n", szMod, szLib, nid&#41;;
            return 0;
        &#125;
        entP++;
    &#125;
    printf&#40;"Found mod '%s' but not lib '%s'\n", szMod, szLib&#41;;
    return 0;
&#125;

void ErrorExit&#40;char *error&#41;
&#123;
	printf&#40;"%s\n", error&#41;;
	sceKernelDelayThread&#40;30 * 1000 * 1000&#41;;
	sceKernelExitGame&#40;&#41;;	
&#125;

int main&#40;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	SceKernelModuleInfo modinfo;
	u32 base;
	SceUID fd;
	SceUID mod;

	mod = sceKernelLoadModule&#40;"ms0&#58;/UPDATE/FW150_ipl_update.prx", 0, NULL&#41;;
	if &#40;mod < 0&#41;
		ErrorExit&#40;"Error loading update module.\n"&#41;;

	if &#40;sceKernelQueryModuleInfo&#40;mod, &modinfo&#41; < 0&#41;
		ErrorExit&#40;"Cannot query module info.\n"&#41;;

	base = modinfo.text_addr;
	printf&#40;"modinfo.text_addr &#58; %.8X\n", modinfo.text_addr&#41;;

		fd = sceIoOpen&#40;"ms0&#58;/UPDATE/FW100_ipl.bin", PSP_O_RDONLY, 0777&#41;;
		if &#40;fd < 0&#41;
			ErrorExit&#40;"Cannot read IPL Data\n"&#41;;
		printf&#40;"Reading IPL Data...\n\n"&#41;;
		sceIoRead&#40;fd, &#40;void *&#41;&#40;base+0x900&#41;, 0x37000&#41;;
		sceIoClose&#40;fd&#41;;

		fd = sceIoOpen&#40;"ms0&#58;/UPDATE/FW100_ipl_update.elf", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777&#41;;
		if &#40;fd < 0&#41;
			ErrorExit&#40;"Cannot save ELF\n"&#41;;
		printf&#40;"Writing ELF...\n\n"&#41;;
		sceIoWrite&#40;fd, &#40;void *&#41;&#40;base&#41;, 0x40000&#41;;
		sceIoClose&#40;fd&#41;;

	mod = sceKernelStartModule&#40;mod, 0, NULL, NULL, NULL&#41;;
	if &#40;mod < 0&#41;
		ErrorExit&#40;"Error Start update module.\n"&#41;;
	sceIplUpdateClearIpl = &#40;void *&#41;FindProc&#40;"IplUpdater", "sceIplUpdate_driver", 0x26093B04&#41;;
	sceIplUpdateSetIpl = &#40;void *&#41;FindProc&#40;"IplUpdater", "sceIplUpdate_driver", 0xEE7EB563&#41;;

	printf&#40;"start sceIplUpdateClearIpl & sceIplUpdateSetIpl\n"&#41;;
	sceIplUpdateClearIpl&#40;&#41;;
	sceIplUpdateSetIpl&#40;&#41;;

	ErrorExit&#40;"Finished. Exiting in 30 seconds\n"&#41;;

	return 0;
&#125;
i test it with my FW1.50PSP, it's work
& find 1.00IPL can work with FW1.50 :D
now my psp is FW1.50 + 1.00IPL :P

more information
About the 1.00 downgrade idea
http://mphwebsite.tuxfamily.org/punBB/v ... ?pid=12110

sceLflashFatfmtStartFatfmt
http://forums.ps2dev.org/viewtopic.php? ... date#41886
moonlight wrote:Also, the 1.50 updater call to these functions from iplupdate.prx:

sceIplUpdateClearIpl() -- no parameters, it erases the blocks of the ipl.

sceIplUpdateSetIpl() -- no parameters. it writes the 1.50 ipl which is embedded in the own iplupdater.prx (contrary to the +2.00 updaters, where the ipl is in the psar)

The iplupdater also exports sceIplUpdateUpdateIpl, but the updater doesn't import it, and it seems that it's not called, it doesn't seem to be an export available for vsh mode. (maybe it's called inside the iplupdater, but i haven't seen that call). Looking at the dissasembly, that function doesn't write to the flash, not at least using the sceNand functions.

Another difference between the 1.50 updater and the 2.XX updaters, is that the iplupdater from 1.50 doesn't use any verification function from sceNand, like sceNandVerifyEcc, etc. (I don't know if it does another kind of verification).

In theory, and only in theory, we can use the following procedure for a 1.00 downgrader:

- Extract iplupdater.prx and flashfmt.prx from the 1.50 update.
- Load them, and hack in ram the iplupdater.prx writing the 1.00 ipl on its "iplbuffer", which is easy to locate looking at the disassembly.
- call sceLflashFatfmtStartFatfmt
- Write the flash0 files of an 1.00 dump using sceIo
- call sceIplUpdateClearIpl
- call sceIplUpdateSetIpl

Using sony code to write the ipl and formatting the flash prior to writing the files should be safer, but it won't be me who tries it :)
Last edited by 0okm0000 on Wed Jul 05, 2006 4:05 pm, edited 4 times in total.
PSP hardware hack
http://0okm.blogspot.com/
ghost333
Posts: 1
Joined: Fri Apr 07, 2006 4:16 am

Post by ghost333 »

does this work?
u tested?
Alcahest
Posts: 135
Joined: Fri Mar 25, 2005 2:08 am

Post by Alcahest »

Hmm what would this allow us to do?
Launch PBPs on 1.50 without the need for the Kxploit?
Sounds interesting! :D
Later,

Alcahest
kururin
Posts: 36
Joined: Wed Jul 05, 2006 7:19 am

Post by kururin »

looks like someone was right and new about it :


http://forums.ps2dev.org/viewtopic.php?t=4249&start=150
Mathieulh wrote:Well the IPL itself changes in every fw versions, just because it performs a checksum of most of the critical prx in flash0:/kd/
Of course special IPL revisions (kbooti.bin) does not perform those checksums :) And one of them has a flaw allowing to run decrypted prx :)

However the newer retail IPLs requires to run encrypted prx that matches the checksum otherwise the psp wont boot, that's why you can't run an 1.00 fw with the 1.50 IPL (even if it does have the 1.00 prx keys required to load those)

Some IPL such as the one from v2.00 adds some securities such as ELF = USER mode..... or 2.50 IPL that adds Version = 2.50 .....
They also add/change some failsafe features from 1.50 to 2.50
But mostly every IPL revisions do the same job

BTW: The DEM-100 Kbooti.bin and the psp kboot.bin shares the same encryption keys so a kbooti.bin from a debug unit can be flashed into a retail psp :) Interesting isn't it ?

(If the mods wanna know how I got this information I just decrypted the kbooti.bin located in the japanese version of the ridge racers UMD's modules, it's the DEM-100's 1.0.2's IPL revision (the 1.00 fw is the same as the DEM-100 1.0.3 so it's a pre 1.00 IPL))
TestType
Posts: 23
Joined: Tue Dec 13, 2005 4:04 am
Location: Iceland

Post by TestType »

0okm0000 released this on his website about a month ago or more and has updated it since.
It's a upgrader/downgrader for fw 1.0 units. It enables 1.0 users to upgrade to 1.5 while being able to go back to fw 1.5. It does not however work as a downgrader for 1.5 units to fw 1.0. Something due to the bad sectors of the flash having to be the same as before and this program backs up your flash to match them, I've forgotten the details unfortunately.

Taken from pspupdates post of the update:
For those who don't know, this application allows you to safely upgrade your 'rare' 1.0 PSP to 1.5, try out whatever you want, and then, come back to 1.0. Great, isn't it? The only catch is that you can't just downgrade any PSP. You need to have a backup of your own firmware. Anyone else's backup won't work.
PSP: Japanese Firmware 1.0 :: 1gb SanDisk Memory Stick
Alcahest
Posts: 135
Joined: Fri Mar 25, 2005 2:08 am

Post by Alcahest »

No i think this is something different.
I've used Ookm's DHT prog on my 1.0.
But now, it's about having a mix of fw 1.0 & fw 1.50 apparently.
Later,

Alcahest
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

there is no "mix". its just about programming the 1.0 ipl into another firmware, which is pretty much pointless other than for seeing it actually works (or not). merely an interisting experiment for people who know what they are doing. if you dont know exactly what it does and what you could use it for by looking at the posted code, forget it. you dont need it at all.
Post Reply