From afc6f51ff207dcfad86b04df1390e8973e6e29e2 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sat, 14 May 2016 20:26:32 +0200 Subject: [PATCH] Revised and working RO patch --- injector/source/patcher.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/injector/source/patcher.c b/injector/source/patcher.c index 671e6a4d..b7075cf6 100644 --- a/injector/source/patcher.c +++ b/injector/source/patcher.c @@ -478,33 +478,38 @@ void patchCode(u64 progId, u8 *code, u32 size) static const u8 sigCheckPattern[] = { 0x30, 0x40, 0x2D, 0xE9, 0x02, 0x50, 0xA0, 0xE1 }; - - static const u8 sha256ChecksPattern[] = { - 0x02, 0x11, 0x10, 0xE2, 0x1F, 0x00, 0x00, 0x4A + static const u8 sha256ChecksPattern1[] = { + 0x30, 0x40, 0x2D, 0xE9, 0x24, 0xD0, 0x4D, 0xE2 + }; + static const u8 sha256ChecksPattern2[] = { + 0xF8, 0x4F, 0x2D, 0xE9, 0x01, 0x70, 0xA0, 0xE1 }; - static const u8 sigCheckPatch[] = { + static const u8 stub[] = { 0x00, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1 // mov r0, #0; bx lr }; - static const u8 sha256ChecksPatch[] = { - 0x00, 0x00, 0xA0, 0xE3, 0x00, 0x10, 0xF0, 0xE3 // mov r0, #0; mnvs r1, #0 - }; - //Disable CRR0 signature (RSA2048 with SHA256) check patchMemory(code, size, sigCheckPattern, sizeof(sigCheckPattern), 0, - sigCheckPatch, - sizeof(sigCheckPatch), 1 + stub, + sizeof(stub), 1 ); - //Disable CRO0/CRR0 SHA256 hash checks + //Disable CRO0/CRR0 SHA256 hash checks (section hashes, and hash table) patchMemory(code, size, - sha256ChecksPattern, - sizeof(sha256ChecksPattern), -4, - sha256ChecksPatch, - sizeof(sigCheckPatch), 1 + sha256ChecksPattern1, + sizeof(sha256ChecksPattern1), 0, + stub, + sizeof(stub), 1 + ); + + patchMemory(code, size, + sha256ChecksPattern2, + sizeof(sha256ChecksPattern2), 0, + stub, + sizeof(stub), 1 ); break;