Skip to content

Commit

Permalink
fixed sceImpose_driver_4B02F047 -> sceImpose_driver_C94AC8E2.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 26, 2011
1 parent bf3ddd4 commit 582036b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
50 changes: 50 additions & 0 deletions popsloader/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,37 @@ static SceUID _sceKernelLoadModule(const char *path, int flags, SceKernelLMOptio
return modid;
}

static int (*sceImposeGetParamNew)(int param) = NULL;

// sceImpose_driver_4B02F047 -> sceImpose_driver_C94AC8E2
// TODO resolve all param
int _sceImposeGetParamOld(int param)
{
int new_param, ret;

new_param = param;

switch(new_param) {
case 512:
new_param = 0x80000002;
break;
case 0x20000:
new_param = 0x400;
break;
case 0x1000:
new_param = 0x200;
break;
case 0x4000:
new_param = 0x80000005;
break;
}

ret = sceImposeGetParamNew(new_param);
// printk("%s: 0x%08X/0x%08X -> 0x%08X\n", __func__, param, new_param, ret);

return ret;
}

static int replace_module(int modid, SceSize argsize, void *argp, int *modstatus, SceKernelSMOption *opt, char *modname, char *redir_path)
{
SceModule2 *mod;
Expand Down Expand Up @@ -281,6 +312,25 @@ static int popsloader_patch_chain(SceModule2 *mod)
{
printk("%s: %s\n", __func__, mod->modname);

if(0 == strcmp(mod->modname, "sceImpose_Driver")) {
SceModule2 *mod_;
u32 sceImposeGetParam_NID;

if(psp_fw_version == FW_620) {
sceImposeGetParam_NID = 0xC94AC8E2;
} else if(psp_fw_version == FW_635 || psp_fw_version == FW_639) {
sceImposeGetParam_NID = 0x4C4DF719;
} else {
asm("break");
}

sceImposeGetParamNew = (void*)sctrlHENFindFunction("sceImpose_Driver", "sceImpose_driver", sceImposeGetParam_NID);
mod_ = (SceModule2*)sceKernelFindModuleByName("scePops_Manager");

hook_import_bynid((SceModule*)mod_, "sceImpose_driver", 0x4B02F047, _sceImposeGetParamOld, 0);
hook_import_bynid((SceModule*)mod_, "sceImpose_driver", 0x531C9778, _sceImposeGetParamOld, 0);
}

if(g_previous)
return g_previous(mod);

Expand Down
3 changes: 1 addition & 2 deletions popsloader/core/nid_500_to_620.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ static nid_entry LoadExecForKernel_nid[] = {

static nid_entry sceImpose_driver_nid[] = {
{ 0x0BBCA0BF, 0x55864BD7, },
{ 0x4B02F047, 0xC94AC8E2, },
{ 0xA516434B, 0x4D849B71, },
{ 0xDA315C59, 0x25011AAB , },
{ 0xDA315C59, 0x25011AAB, },
};

static nid_entry sceSysreg_driver_nid[] = {
Expand Down
1 change: 0 additions & 1 deletion popsloader/core/nid_500_to_635.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static nid_entry LoadExecForKernel_nid[] = {

static nid_entry sceImpose_driver_nid[] = {
{ 0x0BBCA0BF, 0x44F17A7A, },
{ 0x4B02F047, 0x4C4DF719, },
{ 0xA516434B, 0xEBC850AC, },
{ 0xDA315C59, 0x027F21C6 , },
};
Expand Down

0 comments on commit 582036b

Please sign in to comment.