From 07bbff7d1118107b68bdf5efc34a3241a5763da1 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sat, 15 Apr 2017 23:11:53 +0200 Subject: [PATCH] Fix patchSvcBreak11 --- source/firm.c | 2 +- source/patches.c | 4 ++-- source/patches.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/firm.c b/source/firm.c index bcf80cb..b33226f 100755 --- a/source/firm.c +++ b/source/firm.c @@ -190,7 +190,7 @@ u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32 emuHeader, boo u32 codeSetOffset, stackAddress = getInfoForArm11ExceptionHandlers(arm11Section1, firm->section[1].size, &codeSetOffset); ret += installArm11Handlers(arm11ExceptionsPage, stackAddress, codeSetOffset, arm11DAbtHandler, baseK11VA + ((u8 *)arm11DAbtHandler - arm11Section1)); - patchSvcBreak11(arm11Section1, arm11SvcTable); + patchSvcBreak11(arm11Section1, arm11SvcTable, baseK11VA); ret += patchKernel11Panic(arm11Section1, firm->section[1].size); //ARM9 exception handlers diff --git a/source/patches.c b/source/patches.c index a05d38f..9d939a2 100644 --- a/source/patches.c +++ b/source/patches.c @@ -404,10 +404,10 @@ u32 patchSvcBreak9(u8 *pos, u32 size, u32 kernel9Address) return 0; } -void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable) +void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable, u32 baseK11VA) { //Same as above, for NATIVE_FIRM ARM11 - u32 *addr = (u32 *)(pos + arm11SvcTable[0x3C] - 0xFFF00000); + u32 *addr = (u32 *)(pos + arm11SvcTable[0x3C] - baseK11VA); *addr = 0xE12FFF7F; } diff --git a/source/patches.h b/source/patches.h index 10436e3..50f0dbd 100644 --- a/source/patches.h +++ b/source/patches.h @@ -53,7 +53,7 @@ u32 implementSvcGetCFWInfo(u8 *pos, u32 *arm11SvcTable, u32 baseK11VA, u8 **free u32 patchArm9ExceptionHandlersInstall(u8 *pos, u32 size); u32 getInfoForArm11ExceptionHandlers(u8 *pos, u32 size, u32 *codeSetOffset); u32 patchSvcBreak9(u8 *pos, u32 size, u32 kernel9Address); -void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable); +void patchSvcBreak11(u8 *pos, u32 *arm11SvcTable, u32 baseK11VA); u32 patchKernel9Panic(u8 *pos, u32 size); u32 patchKernel11Panic(u8 *pos, u32 size); u32 patchP9AccessChecks(u8 *pos, u32 size);