Exemplo n.º 1
0
int is_homebrews_runlevel(void)
{
	int apitype;

	apitype = sceKernelInitApitype();
	
	if(apitype == 0x152 || apitype == 0x141) {
		return 1;
	}

	return 0;
}
Exemplo n.º 2
0
int main_thread(SceSize args, void *argp)
{
	int exit = 0, init_key = 0, model = 0, light = 0;
	SceCtrlData pad;
	sceCtrlPeekBufferPositive(&pad, 1);

	if(pad.Buttons & PSP_CTRL_LTRIGGER)
	{
		exit = 1;
	}
	else if(pad.Buttons & PSP_CTRL_RTRIGGER)
	{
		light = 1;
	}

	if(!exit)
	{
		init_key = sceKernelInitKeyConfig();

		if(init_key == PSP_INIT_KEYCONFIG_VSH) // VSH MODE SPOTTED
		{
			loadStartModuleWithArgs("ms0:/seplugins/cfe/cfe_vsh.prx", 1, 0, NULL);
		}
		else
		{
			model = sceKernelGetModel();

			if(model == PSP_MODEL_SLIM_AND_LITE) // PSP SLIM SPOTTED
			{
				if(sceKernelInitApitype() == PSP_INIT_APITYPE_DISC) 
				{
					if(!light) loadStartModuleWithArgs("ms0:/seplugins/cfe/cfe_game.prx", 8, 0, NULL);
						else loadStartModuleWithArgs("ms0:/seplugins/cfe/cfe_light.prx", 1, 0, NULL);
				}
				else
				{
					loadStartModuleWithArgs("ms0:/seplugins/cfe/cfe_light.prx", 1, 0, NULL);
				}
			}
			else // PSP FAT SPOTTED
			{
				loadStartModuleWithArgs("ms0:/seplugins/cfe/cfe_light.prx", 1, 0, NULL);
			}
		}
	}

	sceKernelStopUnloadSelfModule(0, NULL, NULL, NULL);
	return 0;
}
Exemplo n.º 3
0
void disable_PauseGame(u32 text_addr)
{
	int i, apitype;

	if(psp_model != PSP_GO) {
		return;
	}

	apitype = sceKernelInitApitype();

	if(g_high_memory_enabled || (conf.iso_cache && apitype == 0x125)) {
		for(i=0; i<g_offs->impose_patch.nr_nop; i++) {
			_sw(NOP, text_addr + g_offs->impose_patch.offset + i * 4);
		}
	}
}
Exemplo n.º 4
0
int load_plugins(void)
{
	unsigned int key = sceKernelApplicationType();
	int apitype;

	apitype = sceKernelInitApitype();

	if(rebootex_conf.recovery_mode) {
		return 0;
	}

	if(conf.plugvsh && key == PSP_INIT_KEYCONFIG_VSH && is_vsh_plugins_enabled()) {
		if(psp_model == PSP_GO) {
			load_plugin("ef0:/seplugins/vsh.txt", WAIT_MEMORY_STICK_TIMEOUT);
		}

		// pspgo has smaller wait time
		load_plugin("ms0:/seplugins/vsh.txt", psp_model == PSP_GO ? WAIT_MEMORY_STICK_TIMEOUT / 10 : WAIT_MEMORY_STICK_TIMEOUT);
	} //game mode
	else if(conf.pluggame && ( key == PSP_INIT_KEYCONFIG_GAME || apitype == 0x123) ) {
		if(psp_model == PSP_GO && sctrlKernelBootFrom() == 0x50) {
			load_plugin("ef0:/seplugins/game.txt", WAIT_MEMORY_STICK_TIMEOUT);
		} else {
			load_plugin("ms0:/seplugins/game.txt", WAIT_MEMORY_STICK_TIMEOUT);
		}
	} //ps1 mode
	else if(conf.plugpop && key == PSP_INIT_KEYCONFIG_POPS) {
		if(psp_model == PSP_GO && sctrlKernelBootFrom() == 0x50) {
			load_plugin("ef0:/seplugins/pops.txt", WAIT_MEMORY_STICK_TIMEOUT);
		} else {
			load_plugin("ms0:/seplugins/pops.txt", WAIT_MEMORY_STICK_TIMEOUT);
		}
	}
	
	//return success
	return 0;
}
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;
}