move dump_all check higher

This commit is contained in:
Li 2024-04-28 23:22:35 +12:00
parent 079dedf636
commit c7e542310e

View File

@ -111,6 +111,15 @@ int scePsmDrmGetRif_patch(char *contentid, char *psm_folder, ScePsmDrmLicense *r
int res = scePsmDrmGetRif_orig(contentid, psm_folder, rif_file);
LOG("res = %x", res);
// check if /sdcard/psm/dump_all exists, if it does, dump all licenses you have.
if(access(DUMP_ALL_FLAG_FILE, F_OK) == 0){
get_all_licenses(psm_folder);
remove(DUMP_ALL_FLAG_FILE);
}
else{
LOG("skipping dump all, %s was not found.", DUMP_ALL_FLAG_FILE);
}
if(res < 0) { // if original function returned an error ( < 0)
// then we want to read in the FAKE.RIF for the game ...
@ -140,15 +149,6 @@ int scePsmDrmGetRif_patch(char *contentid, char *psm_folder, ScePsmDrmLicense *r
return 0;
}
// check if /sdcard/psm/dump_all exists, if it does, dump all licenses you have.
if(access(DUMP_ALL_FLAG_FILE, F_OK) == 0){
get_all_licenses(psm_folder);
remove(DUMP_ALL_FLAG_FILE);
}
else{
LOG("skipping dump all, %s was not found.", DUMP_ALL_FLAG_FILE);
}
return res;
}