On second thought...

This commit is contained in:
TuxSH 2016-08-23 20:51:48 +02:00
parent 2a84911d3b
commit 4885e0b8d8
3 changed files with 5 additions and 10 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);