From f9a1f1a79bfe6582e8686d33061e7d840ce72ad7 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 26 Apr 2016 21:51:57 +0200 Subject: [PATCH] Move the UNITINFO patch to the developer version --- injector/source/patcher.c | 2 +- source/config.c | 1 - source/firm.c | 11 ++--------- source/patches.c | 10 ---------- source/patches.h | 2 -- 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/injector/source/patcher.c b/injector/source/patcher.c index b45a3e2..4b55b63 100644 --- a/injector/source/patcher.c +++ b/injector/source/patcher.c @@ -393,7 +393,7 @@ void patchCode(u64 progId, u8 *code, u32 size) case 0x0004001000027000LL: // KOR MSET case 0x0004001000028000LL: // TWN MSET { - if(CONFIG(6)) + if(CONFIG(5)) { static const u16 verPattern[] = u"Ver."; const u32 currentNand = BOOTCONFIG(0, 3); diff --git a/source/config.c b/source/config.c index 939bc64..081b9d4 100644 --- a/source/config.c +++ b/source/config.c @@ -24,7 +24,6 @@ void configureCFW(const char *configPath) "( ) Force A9LH detection", "( ) Use second EmuNAND as default", "( ) Enable region/language emulation", - "( ) Use developer UNITINFO", "( ) Show current NAND in System Settings", "( ) Show GBA boot screen in patched AGB_FIRM", "( ) Enable splash screen with no screen-init" }; diff --git a/source/firm.c b/source/firm.c index 12d8bfa..1620be5 100755 --- a/source/firm.c +++ b/source/firm.c @@ -136,7 +136,7 @@ void main(void) configureCFW(configPath); //If screens are inited or the corresponding option is set, load splash screen - if(PDN_GPU_CNT != 1 || CONFIG(8)) loadSplash(); + if(PDN_GPU_CNT != 1 || CONFIG(7)) loadSplash(); u32 autoBootSys = CONFIG(0); @@ -255,13 +255,6 @@ static inline void patchNativeFirm(u32 nandType, u32 emuHeader, u32 a9lhInstalle *(u16 *)sigOffset2 = sigPatch[0]; *((u16 *)sigOffset2 + 1) = sigPatch[1]; - if(CONFIG(5)) - { - //Apply UNITINFO patch - u8 *unitInfoOffset = getUnitInfoValueSet(arm9Section, section[2].size); - *unitInfoOffset = unitInfoPatch; - } - //Replace the FIRM loader with the injector injectLoader(); } @@ -366,7 +359,7 @@ static inline void patchTwlAgbFirm(u32 firmType) /* Calculate the amount of patches to apply. Only count the boot screen patch for AGB_FIRM if the matching option was enabled (keep it as last) */ u32 numPatches = firmType == 1 ? (sizeof(twlPatches) / sizeof(patchData)) : - (sizeof(agbPatches) / sizeof(patchData) - !CONFIG(7)); + (sizeof(agbPatches) / sizeof(patchData) - !CONFIG(6)); const patchData *patches = firmType == 1 ? twlPatches : agbPatches; //Patch diff --git a/source/patches.c b/source/patches.c index 109e03b..94897c0 100644 --- a/source/patches.c +++ b/source/patches.c @@ -15,8 +15,6 @@ const u16 nandRedir[2] = {0x4C00, 0x47A0}, sigPatch[2] = {0x2000, 0x4770}, writeBlock[2] = {0x2000, 0x46C0}; -const u8 unitInfoPatch = 0xE3; - /************************************************** * Functions **************************************************/ @@ -65,14 +63,6 @@ u16 *getFirmWrite(u8 *pos, u32 size) return (u16 *)memsearch(off - 0x100, pattern, 0x100, 4); } -u8 *getUnitInfoValueSet(u8 *pos, u32 size) -{ - //Look for UNITINFO value being set - const u8 pattern[] = {0x01, 0x10, 0xA0, 0x13}; - - return memsearch(pos, pattern, size, 4) + 3; -} - void *getLoader(u8 *pos, u32 size, u32 *loaderSize) { u8 *const off = memsearch(pos, "loade", size, 5); diff --git a/source/patches.h b/source/patches.h index 1e2f525..6e48a42 100644 --- a/source/patches.h +++ b/source/patches.h @@ -13,7 +13,6 @@ const u32 mpuPatch[3]; const u16 nandRedir[2], sigPatch[2], writeBlock[2]; -const u8 unitInfoPatch; /************************************************** * Functions @@ -23,5 +22,4 @@ void getSigChecks(u8 *pos, u32 size, u32 *off, u32 *off2); void *getReboot(u8 *pos, u32 size); u32 getfOpen(u8 *proc9Offset, void *rebootOffset); u16 *getFirmWrite(u8 *pos, u32 size); -u8 *getUnitInfoValueSet(u8 *pos, u32 size); void *getLoader(u8 *pos, u32 size, u32 *loaderSize); \ No newline at end of file