int main_thread(SceSize args, void *argp) { int mode = 1; if(g_args >= 4) mode = g_argp->mode; patch_sceLoadExec(mode); sctrlKernelExitVSH(NULL); return 0; }
void patch_module(SceModule2 *mod) { //patch loadexec for installer reboot stage if(0 == strcmp(mod->modname, "sceMediaSync")) { patch_sceLoadExec(); } //replace vsh_module with installer if(0 == strcmp(mod->modname, "vsh_module")) { patch_vsh_module(mod->text_addr); } //log module start printk("Starting %s (%u, %u)!\n", mod->modname, (uint)mod->mpid_text, (uint)mod->mpid_data); }
static int syspatch_module_chain(SceModule2 *mod) { int apitype; apitype = sceKernelInitApitype(); #ifdef DEBUG printk("Starting %s Apitype: 0x%X\n", mod->modname, apitype); hook_import_bynid((SceModule*)mod, "KDebugForKernel", 0x84F370BC, printk, 0); #endif if (is_system_booted()) { if(0 == strcmp(mod->modname, "sceNpSignupPlugin_Module")) { patch_npsignup(mod->text_addr); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceVshNpSignin_Module")) { patch_npsignin(mod->text_addr); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceNp")) { patch_np(mod->text_addr, 9, 90); sync_cache(); goto exit; } if(conf.usbversion && 0 == strcmp(mod->modname, "sceUSB_Stor_Ms_Driver")) { patch_sceUSB_Stor_Ms_Driver((SceModule*)mod); goto exit; } system_booted_action(); patch_module_for_version_spoof((SceModule*)mod); goto exit; } if(0 == strcmp(mod->modname, "sceLoadExec")) { u32 key_config; key_config = sceKernelApplicationType(); if (key_config == PSP_INIT_KEYCONFIG_GAME) { if(PSP_1000 != psp_model) { prepatch_partitions(); sync_cache(); } } goto exit; } if(0 == strcmp(mod->modname, "sceSYSCON_Driver")) { resolve_syscon_driver((SceModule*)mod); goto exit; } // load after lflash if(0 == strcmp(mod->modname, "sceDisplay_Service")) { load_config(); patch_sceLoadExec(); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceMediaSync")) { patch_sceMediaSync(mod->text_addr); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceUmdMan_driver")) { patch_sceUmdMan_driver((SceModule*)mod); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceUmdCache_driver")) { patch_umdcache(mod->text_addr); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceWlan_Driver")) { patch_sceWlan_Driver(mod->text_addr); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "scePower_Service")) { patch_scePower_Service(mod->text_addr); sync_cache(); goto exit; } if(0 == strcmp(mod->modname, "sceMesgLed")) { patch_mesgled((SceModule*)mod); sync_cache(); goto exit; } if (0 == strcmp(mod->modname, "sceImpose_Driver")) { patch_sceChkreg(); disable_PauseGame(mod->text_addr); usb_charge(); sync_cache(); goto exit; } if(psp_model == PSP_GO && 0 == strcmp(mod->modname, "pspMarch33_Driver")) { patch_pspMarch33_Driver(mod->text_addr); sync_cache(); goto exit; } #ifdef DEBUG if(0 == strcmp(mod->modname, "sceKernelLibrary")) { printk_sync(); printk("printk synchronized\n"); goto exit; } #endif exit: if (previous) return (*previous)(mod); return 0; }