diff --git a/source/firm.c b/source/firm.c index 00f92a9..466a5c7 100755 --- a/source/firm.c +++ b/source/firm.c @@ -319,7 +319,7 @@ static inline void patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32 } //Apply UNITINFO patch - if(DEV_OPTIONS == 1) patchUnitInfoValueSet(arm9Section, section[2].size, NATIVE_FIRM); + if(DEV_OPTIONS == 1) patchUnitInfoValueSet(arm9Section, section[2].size); if(DEV_OPTIONS != 2) { @@ -361,7 +361,7 @@ static inline void patchLegacyFirm(FirmwareType firmType) } //Apply UNITINFO patch - if(DEV_OPTIONS == 1) patchUnitInfoValueSet(arm9Section, section[3].size, firmType); + if(DEV_OPTIONS == 1) patchUnitInfoValueSet(arm9Section, section[3].size); if(DEV_OPTIONS != 2) { @@ -390,9 +390,6 @@ static inline void patchSafeFirm(void) } else patchFirmWriteSafe(arm9Section, section[2].size); - //Apply UNITINFO patch - if(DEV_OPTIONS == 1) patchUnitInfoValueSet(arm9Section, section[2].size, SAFE_FIRM); - if(DEV_OPTIONS != 2) { //Kernel9/Process9 debugging diff --git a/source/patches.c b/source/patches.c index dcfb790..8f527ed 100644 --- a/source/patches.c +++ b/source/patches.c @@ -295,14 +295,12 @@ void patchP9AccessChecks(u8 *pos, u32 size) } -void patchUnitInfoValueSet(u8 *pos, u32 size, FirmwareType firmType) +void patchUnitInfoValueSet(u8 *pos, u32 size) { //Look for UNITINFO value being set during kernel sync const u8 pattern[] = {0x01, 0x10, 0xA0, 0x13}; - const u8 patternSafe[] = {0x00, 0x20, 0x91, 0xE2, 0x01, 0x20, 0xA0, 0x13}; - bool safe = firmType == SAFE_FIRM && !isN3DS; - u8 *off = (!safe) ? memsearch(pos, pattern, size, 4) : (memsearch(pos, patternSafe, size, 8) + 4); + u8 *off = memsearch(pos, pattern, size, 4); off[0] = (*(vu8 *)0x10010010 == 0) ? 1 : 0; off[3] = 0xE3; diff --git a/source/patches.h b/source/patches.h index e427f32..ee3b54a 100644 --- a/source/patches.h +++ b/source/patches.h @@ -50,7 +50,7 @@ void patchKernel11Panic(u8 *pos, u32 size); void patchArm11SvcAccessChecks(u8 *pos, u32 size); void patchK11ModuleChecks(u8 *pos, u32 size); void patchP9AccessChecks(u8 *pos, u32 size); -void patchUnitInfoValueSet(u8 *pos, u32 size, FirmwareType firmType); +void patchUnitInfoValueSet(u8 *pos, u32 size); void reimplementSvcBackdoor(u8 *pos, u32 size); void implementSvcGetCFWInfo(u8 *pos, u32 size); void applyLegacyFirmPatches(u8 *pos, FirmwareType firmType); \ No newline at end of file