int module_start(SceSize args, void* argp) { int thid; psp_fw_version = sctrlKernelDevkitVersion(); setup_patch_offset_table(psp_fw_version); psp_model = sctrlKernelGetModel(); g_args = args; g_argp = argp; thid = sceKernelCreateThread("fastRecovery", main_thread, 0x1A, 0x1000, 0, NULL); if(thid>=0) { sceKernelStartThread(thid, 0, NULL); } return 0; }
int module_start(SceSize args, void* argp) { char keypath[128]; int ret; SceIoStat stat; psp_fw_version = sceKernelDevkitVersion(); setup_patch_offset_table(psp_fw_version); psp_model = sceKernelGetModel(); memset(&conf, 0, sizeof(conf)); sctrlSEGetConfig(&conf); printk_init("ms0:/popcorn.txt"); printk("Popcorn: init_file = %s psp_fw_version = 0x%08X psp_model = %d\n", sceKernelInitFileName(), (uint)psp_fw_version, (int)psp_model); get_keypath(keypath, sizeof(keypath)); ret = sceIoGetstat(keypath, &stat); g_keys_bin_found = 0; if(ret == 0) { ret = load_key(keypath, g_keys, sizeof(g_keys)); if(ret == 0) { g_keys_bin_found = 1; printk("keys.bin found\n"); } } g_is_custom_ps1 = is_custom_ps1(); g_icon0_status = get_icon0_status(); if(g_is_custom_ps1) { setup_psx_fw_version(psp_fw_version); } g_previous = sctrlHENSetStartModuleHandler(&popcorn_patch_chain); patch_scePops_Manager(); sync_cache(); return 0; }
// 0x00000340 int module_start(SceSize args, void* argp) { SceModule2 *pMod; int fd, key_config; SEConfig config; psp_model = sceKernelGetModel(); psp_fw_version = sceKernelDevkitVersion(); setup_patch_offset_table(psp_fw_version); printk_init("ms0:/LOG_GALAXY.TXT"); printk("PROGalaxyController started: 0x%08X\n", (uint)psp_fw_version); key_config = sceKernelApplicationType(); sctrlSEGetConfig(&config); if(config.iso_cache && psp_model != PSP_1000 && key_config == PSP_INIT_KEYCONFIG_GAME) { int bufsize; bufsize = config.iso_cache_total_size * 1024 * 1024 / config.iso_cache_num; if((bufsize % 512) != 0) { bufsize &= ~(512-1); } if(bufsize == 0) { bufsize = 512; } infernoCacheSetPolicy(config.iso_cache_policy); infernoCacheInit(bufsize, config.iso_cache_num); } g_iso_fn = sctrlSEGetUmdFile(); pMod = (SceModule2*)sceKernelFindModuleByName("sceThreadManager"); if(pMod != NULL) { // sceKernelCreateThread export _sw((u32)&myKernelCreateThread, pMod->text_addr + g_offs->sceKernelCreateThread); // sceKernelStartThread export _sw((u32)&myKernelStartThread, pMod->text_addr + g_offs->sceKernelStartThread); } else { printk("sceThreadManager cannot be found?!\n"); } clear_cache(); while( 1 ) { fd = sceIoOpen(g_iso_fn, PSP_O_RDONLY, 0); if(fd >= 0) { break; } sceKernelDelayThread(10000); } sceIoClose(fd); printk("%s: finished\n", __func__); return 0; }
//entry point int main(int argc, char * argv[]) { pspDebugScreenInit(); psp_fw_version = sceKernelDevkitVersion(); #if defined(CONFIG_660) || defined(CONFIG_661) if((psp_fw_version == FW_660) || (psp_fw_version == FW_661)) { goto version_OK; } #endif #ifdef CONFIG_639 if(psp_fw_version == FW_639) { goto version_OK; } #endif #ifdef CONFIG_620 if(psp_fw_version == FW_620) { goto version_OK; } #endif #ifdef CONFIG_635 if(psp_fw_version == FW_635) { goto version_OK; } #endif pspDebugScreenPrintf("Sorry. This program doesn't support your FW(0x%08X).\n", (uint)psp_fw_version); sceKernelDelayThread(5*1000000); goto exit; version_OK: setup_patch_offset_table(psp_fw_version); //puzzle installer path strcpy(installerpath, argv[0]); char * slash = strrchr(installerpath, '/'); if (slash) slash[1] = '\0'; write_files(installerpath); strcat(installerpath, "installer.prx"); printk_init("ms0:/launcher.txt"); printk("Hello exploit\n"); if(sctrlHENGetVersion() >= 0) { install_in_cfw(); return 0; } #if defined(CONFIG_660) || defined(CONFIG_661) if((psp_fw_version == FW_660) || (psp_fw_version == FW_661)) { do_exploit_660(); } #endif #ifdef CONFIG_639 if(psp_fw_version == FW_639) { do_exploit_639(); } #endif #if defined(CONFIG_620) || defined(CONFIG_635) if(psp_fw_version == FW_620 || psp_fw_version == FW_635) { do_exploit(); } #endif exit: //trigger reboot sceKernelExitGame(); //kill thread sceKernelExitDeleteThread(0); //return return 0; }