From 7ea2a0a278042c919e6ede87091da0f1e608a38f Mon Sep 17 00:00:00 2001 From: TuxSH Date: Wed, 25 May 2016 20:50:45 +0200 Subject: [PATCH] Remove the anti-DG check on 11.0 firmware (and future ones) --- source/firm.c | 3 +++ source/patches.c | 9 +++++++++ source/patches.h | 1 + 3 files changed, 13 insertions(+) diff --git a/source/firm.c b/source/firm.c index 3ed09e8..7f38968 100755 --- a/source/firm.c +++ b/source/firm.c @@ -290,6 +290,9 @@ static inline void patchNativeFirm(u32 nandType, u32 emuHeader, u32 a9lhMode) //Apply signature patches patchSignatureChecks(process9Offset, process9Size); + //Apply anti-anti-DG patches for >= 11.0 firmwares + if(nativeFirmType == 1) patchTitleInstallMinVersionCheck(process9Offset, process9Size); + //Apply emuNAND patches if(nandType) { diff --git a/source/patches.c b/source/patches.c index 6d7af9a..834e950 100644 --- a/source/patches.c +++ b/source/patches.c @@ -34,6 +34,15 @@ void patchSignatureChecks(u8 *pos, u32 size) off2[1] = sigPatch[1]; } +void patchTitleInstallMinVersionCheck(u8 *pos, u32 size) +{ + const u8 pattern[] = {0x89, 0x0A, 0x81, 0x42, 0x02, 0xD2}; + + u8 *off = memsearch(pos, pattern, size, 6); + + if(off != NULL) off[5] = 0xE0; +} + void patchFirmlaunches(u8 *pos, u32 size, u32 process9MemAddr) { //Look for FIRM reboot code diff --git a/source/patches.h b/source/patches.h index c2e51be..a39fb40 100644 --- a/source/patches.h +++ b/source/patches.h @@ -17,6 +17,7 @@ typedef struct patchData { u8 *getProcess9(u8 *pos, u32 size, u32 *process9Size, u32 *process9MemAddr); void patchSignatureChecks(u8 *pos, u32 size); +void patchTitleInstallMinVersionCheck(u8 *pos, u32 size); void patchFirmlaunches(u8 *pos, u32 size, u32 process9MemAddr); void patchFirmWrites(u8 *pos, u32 size); void patchFirmWriteSafe(u8 *pos, u32 size);