Example #1
0
File: cfw.c Project: nastys/rxTools
static int loadExecReboot()
{
	File fd;

	if (!FileOpen(&fd, "/rxTools/system/reboot.bin", 0))
		return 1;

	if (FileRead(&fd, (void*)0x080F0000, 0x8000, 0) < 0)
		return 1;

	FileClose(&fd);
	_softreset();
	return 0;
}
Example #2
0
static FRESULT loadExecReboot()
{
	FIL fd;
	FRESULT r;
	UINT br;

	r = f_open(&fd, SYS_PATH "/reboot.bin", FA_READ);
	if (r != FR_OK)
		return r;

	r = f_read(&fd, (void*)0x080F0000, 0x8000, &br);
	if (r != FR_OK)
		return r;

	f_close(&fd);
	_softreset();
}
Example #3
0
//Just patches signatures check, loads in sysnand
void DevMode(){
    u8* firm = 0x24000000;
    nand_readsectors(0, 0xF0000/0x200, firm, FIRM0);
    if(strncmp((char*)firm, "FIRM", 4))
    nand_readsectors(0, 0xF0000/0x200, firm, FIRM1);

    unsigned char sign1[] = {0xC1, 0x17, 0x49, 0x1C, 0x31, 0xD0, 0x68, 0x46, 0x01, 0x78, 0x40, 0x1C, 0x00, 0x29, 0x10, 0xD1};
    unsigned char sign2[] = {0xC0, 0x1C, 0x76, 0xE7, 0x20, 0x00, 0x74, 0xE7, 0x22, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F};
    unsigned char patch1[] = { 0x00, 0x20, 0x4E, 0xB0, 0x70, 0xBD };
    unsigned char patch2[] = { 0x00, 0x20};

    for(int i = 0; i < 0xF0000; i++){
        if(!memcmp(firm + i, sign1, 16)){
            memcpy(firm + i, patch1, 6);
        }
        if(!memcmp(firm + i, sign2, 16)){
            memcpy(firm + i, patch2, 2);
        }
    }
    memcpy(0x080F0000, GetFilePack("reboot.bin"), 0x8000);
	_softreset();
}
Example #4
0
void firmlaunch(u8* firm){
	memcpy(FIRM_ADDR, firm, 0x200000); 	//Fixed size, no FIRM right now is that big
	memcpy(0x080F0000, GetFilePack("reboot.bin"), 0x8000);
	_softreset();
}