From 973640f023654c8363f4400abb32915562a3364c Mon Sep 17 00:00:00 2001 From: Aurora Date: Mon, 10 Oct 2016 13:29:34 +0200 Subject: [PATCH] Remove assumptions --- source/emunand.c | 4 ++-- source/firm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/emunand.c b/source/emunand.c index 235117a..e630f72 100644 --- a/source/emunand.c +++ b/source/emunand.c @@ -177,7 +177,7 @@ u32 patchEmuNand(u8 *arm9Section, u32 arm9SectionSize, u8 *process9Offset, u32 p //Copy EmuNAND code u8 *freeK9Space; - ret += getFreeK9Space(arm9Section + 0x13500, arm9SectionSize - 0x13500, &freeK9Space); + ret += getFreeK9Space(arm9Section, arm9SectionSize, &freeK9Space); if(!ret) { memcpy(freeK9Space, emunand_bin, emunand_bin_size); @@ -198,7 +198,7 @@ u32 patchEmuNand(u8 *arm9Section, u32 arm9SectionSize, u8 *process9Offset, u32 p ret += patchNandRw(process9Offset, process9Size, (u32)(freeK9Space - arm9Section + kernel9Address)); //Set MPU - ret += patchMpu(arm9Section + 0x13500, arm9SectionSize - 0x13500); + ret += patchMpu(arm9Section, arm9SectionSize); } return ret; diff --git a/source/firm.c b/source/firm.c index ec12891..f856897 100755 --- a/source/firm.c +++ b/source/firm.c @@ -127,7 +127,7 @@ u32 patchNativeFirm(u32 firmVersion, FirmwareSource nandType, u32 emuHeader, u32 //Find the Process9 .code location, size and memory address u32 process9Size, process9MemAddr; - u8 *process9Offset = getProcess9Info(arm9Section + 0x15000, firm->section[2].size - 0x15000, &process9Size, &process9MemAddr); + u8 *process9Offset = getProcess9Info(arm9Section, firm->section[2].size, &process9Size, &process9MemAddr); //Find the Kernel11 SVC table and handler, exceptions page and free space locations u32 baseK11VA;