Skip to content

Commit

Permalink
cleanup and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAaronLopezGarcia committed Jun 5, 2024
1 parent b4c15ea commit fb12bba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
17 changes: 5 additions & 12 deletions core/compat/psp/rebootex/patches.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ int loadcoreModuleStartPSP(void * arg1, void * arg2, void * arg3, int (* start)(
return start(arg1, arg2, arg3);
}

#ifdef PAYLOADEX
#ifndef MS_IPL
void xor_cipher(u8* data, u32 size, u8* key, u32 key_size)
{
u32 i;
Expand All @@ -40,8 +38,6 @@ int MEPRXDecrypt(PSP_Header* prx, unsigned int size, unsigned int * newsize){
xor_cipher((u8*)prx + 0x150, prx->comp_size, &prx->scheck[0x38], 0x20);
return 0;
}
#endif
#endif

// patch reboot on psp
void patchRebootBuffer(){
Expand Down Expand Up @@ -255,8 +251,6 @@ int patch_bootconf_updaterumd(char *buffer, int length)
return result;
}

#ifdef PAYLOADEX
#ifndef MS_IPL
int patch_bootconf_pro(char *buffer, int length){

struct {
Expand Down Expand Up @@ -304,8 +298,6 @@ int patch_bootconf_pro(char *buffer, int length){

return result;
}
#endif
#endif

int UnpackBootConfigPatched(char **p_buffer, int length)
{
Expand All @@ -318,8 +310,6 @@ int UnpackBootConfigPatched(char **p_buffer, int length)
memcpy(buffer, *p_buffer, length);
*p_buffer = buffer;

#ifdef PAYLOADEX
#ifndef MS_IPL
if (cfw_type == CFW_PRO){
newsize = patch_bootconf_pro(buffer, result);
if (newsize > 0) result = newsize;
Expand All @@ -335,8 +325,6 @@ int UnpackBootConfigPatched(char **p_buffer, int length)
}
return result;
}
#endif
#endif

// Insert SystemControl
newsize = AddPRX(buffer, "/kd/init.prx", PATH_SYSTEMCTRL+sizeof(PATH_FLASH0)-2, 0x000000EF);
Expand Down Expand Up @@ -471,6 +459,11 @@ int _sceBootLfatOpen(char * filename)
return 0;
}

if (strcmp(filename, "/kd/init.prx") == 0){
unPatchLoadCorePRXDecrypt();
unPatchLoadCoreCheckExec();
}

#ifdef MS_IPL
strcpy(path, "/TM/DCARK");
strcat(path, filename);
Expand Down
9 changes: 0 additions & 9 deletions loader/rebootex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ int ARKPRXDecrypt(PSP_Header* prx, unsigned int size, unsigned int * newsize)

if (prx->oe_tag == 0xC6BA41D3 && extraPRXDecrypt){ // decrypt ME firmware file
extraPRXDecrypt(prx, size, newsize);
unPatchLoadCorePRXDecrypt();
}

// Read GZIP Size
Expand Down Expand Up @@ -129,14 +128,6 @@ int CheckExecFilePatched(unsigned char * addr, void * arg2)
}
#endif

#ifdef PAYLOADEX
#ifndef MS_IPL
if (extraPRXDecrypt){
unPatchLoadCoreCheckExec();
}
#endif
#endif

//return success
return 0;
}
Expand Down

0 comments on commit fb12bba

Please sign in to comment.