diff --git a/popsloader/core/exports.exp b/popsloader/core/exports.exp index 5d9d1b9..1246e20 100644 --- a/popsloader/core/exports.exp +++ b/popsloader/core/exports.exp @@ -8,4 +8,8 @@ PSP_EXPORT_FUNC_HASH(module_start) PSP_EXPORT_VAR_HASH(module_info) PSP_EXPORT_END +PSP_EXPORT_START(sceIdMgr_driver, 0x0011, 0x0001) +PSP_EXPORT_FUNC_NID(sceIdMgr_driver_F464F91C, 0xF464F91C) +PSP_EXPORT_END + PSP_END_EXPORTS diff --git a/popsloader/core/main.c b/popsloader/core/main.c index 900ac04..7d50640 100644 --- a/popsloader/core/main.c +++ b/popsloader/core/main.c @@ -194,27 +194,6 @@ static int replace_module(int modid, SceSize argsize, void *argp, int *modstatus return 0; } - if(pops_fw_version == FW_500 && 0 == strcmp(modname, "scePops_Manager")) { - SceUID modid; - SceModule2 *mod_; - char path[256]; - - sprintf(path, "%sidmanager.prx", get_module_prefix()); - modid = sceKernelLoadModule(path, 0, NULL); - -#ifdef DEBUG - if(modid < 0) { - printk("%s: load module %s -> 0x%08X\n", __func__, path, modid); - sceKernelDelayThread(2000000); - } -#endif - - mod_ = (SceModule2*) sceKernelFindModuleByUID(modid); - fix_nid((SceModule*)mod_); - - modid = sceKernelStartModule(modid, 0, 0, 0, 0); - } - modid = sceKernelLoadModule(redir_path, 0, NULL); if(modid < 0) { @@ -275,6 +254,7 @@ int custom_start_module(int modid, SceSize argsize, void *argp, int *modstatus, { int ret, i; char modpath[128]; + SceModule2 *mod; for(i=0; imodname, "sceImpose_Driver")) { + fix_nid((SceModule*)mod); + } + return -1; } @@ -318,13 +304,11 @@ int test_thread(SceSize args, void *argp) return 0; } -#if 0 // for those FW required idmanager.prx int sceIdMgr_driver_F464F91C(void) { return 0; } -#endif int module_start(SceSize args, void* argp) { @@ -333,7 +317,7 @@ int module_start(SceSize args, void* argp) pops_fw_version = FW_639; psp_fw_version = sceKernelDevkitVersion(); psp_model = sceKernelGetModel(); - printk_init(); + printk_init("ms0:/core.txt"); mount_memory_stick(); if(-1 == load_config() || g_conf.pops_fw_version == psp_fw_version) { diff --git a/popsloader/core/nid_500_to_620.c b/popsloader/core/nid_500_to_620.c index d876c4f..958c181 100644 --- a/popsloader/core/nid_500_to_620.c +++ b/popsloader/core/nid_500_to_620.c @@ -35,7 +35,6 @@ static nid_entry SysMemForKernel_nid[] = { { 0x5339A163, 0xA4AC3934, }, { 0x950BCB31, 0xFEB5C72B, }, { 0xD7E24299, 0xF5780DAA, }, - { 0x4803B7F1, 0x02AEA33F, }, // for idmanager.prx }; static nid_entry ModuleMgrForKernel_nid[] = { diff --git a/popsloader/core/nid_500_to_635.c b/popsloader/core/nid_500_to_635.c index c9ca98a..16c1f3f 100644 --- a/popsloader/core/nid_500_to_635.c +++ b/popsloader/core/nid_500_to_635.c @@ -35,7 +35,6 @@ static nid_entry SysMemForKernel_nid[] = { { 0x5339A163, 0xF2FEAFD5, }, { 0x950BCB31, 0x52B54B93, }, { 0xD7E24299, 0x208F4820, }, - { 0x4803B7F1, 0x25A760F0, }, // for idmanager.prx }; static nid_entry ModuleMgrForKernel_nid[] = { diff --git a/popsloader/popcorn/Makefile b/popsloader/popcorn/Makefile index ea1155f..3f13ec1 100644 --- a/popsloader/popcorn/Makefile +++ b/popsloader/popcorn/Makefile @@ -3,7 +3,7 @@ all: TARGET = popcorn -OBJS = main.o icon.o popcorn_patch_offset.o $(PRO_HOME)/Stargate/analog_patch.o +OBJS = main.o icon.o popcorn_patch_offset.o imports.o $(PRO_HOME)/Stargate/analog_patch.o OBJS += $(PRO_HOME)/Common/utils.o $(PRO_HOME)/Common/strsafe.o $(PRO_HOME)/Common/libs.o CFLAGS = -Os -G0 -Wall -I. -I$(PRO_HOME)/Common -I$(PRO_HOME)/include diff --git a/popsloader/popcorn/imports.S b/popsloader/popcorn/imports.S new file mode 100644 index 0000000..2f1b58a --- /dev/null +++ b/popsloader/popcorn/imports.S @@ -0,0 +1,8 @@ + .set noreorder + +#include "pspstub.s" + + STUB_START "SysMemForKernel",0x40000011,0x00020005 + STUB_FUNC 0x419DB8F4,sceKernelRegisterGetIdFunc + STUB_FUNC 0x6373995D,sceKernelGetModel + STUB_END diff --git a/popsloader/popcorn/main.c b/popsloader/popcorn/main.c index 5640fd6..aa50b51 100644 --- a/popsloader/popcorn/main.c +++ b/popsloader/popcorn/main.c @@ -37,6 +37,7 @@ struct Hooks { }; extern void patch_analog_imports(SceModule *mod); +extern int sceKernelRegisterGetIdFunc(int (*)(char *path, u8 *key)); SEConfig conf; @@ -931,6 +932,13 @@ static void setup_psx_fw_version(u32 fw_version) _SysMemUserForUser_315AD3A0(fw_version); } +static int get_keys(char *filename, u8 *keys) +{ + memcpy(keys, g_keys, sizeof(g_keys)); + + return 0; +} + int module_start(SceSize args, void* argp) { char keypath[128]; @@ -959,6 +967,7 @@ int module_start(SceSize args, void* argp) if(ret == 0) { g_keys_bin_found = 1; printk("keys.bin found\n"); + sceKernelRegisterGetIdFunc(&get_keys); } }