On second thought...
This commit is contained in:
parent
2a84911d3b
commit
4885e0b8d8
@ -319,7 +319,7 @@ static inline void patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Apply UNITINFO patch
|
//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)
|
if(DEV_OPTIONS != 2)
|
||||||
{
|
{
|
||||||
@ -361,7 +361,7 @@ static inline void patchLegacyFirm(FirmwareType firmType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Apply UNITINFO patch
|
//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)
|
if(DEV_OPTIONS != 2)
|
||||||
{
|
{
|
||||||
@ -390,9 +390,6 @@ static inline void patchSafeFirm(void)
|
|||||||
}
|
}
|
||||||
else patchFirmWriteSafe(arm9Section, section[2].size);
|
else patchFirmWriteSafe(arm9Section, section[2].size);
|
||||||
|
|
||||||
//Apply UNITINFO patch
|
|
||||||
if(DEV_OPTIONS == 1) patchUnitInfoValueSet(arm9Section, section[2].size, SAFE_FIRM);
|
|
||||||
|
|
||||||
if(DEV_OPTIONS != 2)
|
if(DEV_OPTIONS != 2)
|
||||||
{
|
{
|
||||||
//Kernel9/Process9 debugging
|
//Kernel9/Process9 debugging
|
||||||
|
@ -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
|
//Look for UNITINFO value being set during kernel sync
|
||||||
const u8 pattern[] = {0x01, 0x10, 0xA0, 0x13};
|
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[0] = (*(vu8 *)0x10010010 == 0) ? 1 : 0;
|
||||||
off[3] = 0xE3;
|
off[3] = 0xE3;
|
||||||
|
@ -50,7 +50,7 @@ void patchKernel11Panic(u8 *pos, u32 size);
|
|||||||
void patchArm11SvcAccessChecks(u8 *pos, u32 size);
|
void patchArm11SvcAccessChecks(u8 *pos, u32 size);
|
||||||
void patchK11ModuleChecks(u8 *pos, u32 size);
|
void patchK11ModuleChecks(u8 *pos, u32 size);
|
||||||
void patchP9AccessChecks(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 reimplementSvcBackdoor(u8 *pos, u32 size);
|
||||||
void implementSvcGetCFWInfo(u8 *pos, u32 size);
|
void implementSvcGetCFWInfo(u8 *pos, u32 size);
|
||||||
void applyLegacyFirmPatches(u8 *pos, FirmwareType firmType);
|
void applyLegacyFirmPatches(u8 *pos, FirmwareType firmType);
|
Reference in New Issue
Block a user