From b4c854dfe805543b822e7df7cf9ab1e14bf10929 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 1 Nov 2016 20:50:04 +0100 Subject: [PATCH] Minor stuff --- source/patches.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/patches.c b/source/patches.c index 1e18265..d60124f 100644 --- a/source/patches.c +++ b/source/patches.c @@ -482,10 +482,11 @@ u32 patchK11ModuleChecks(u8 *pos, u32 size, u8 **freeK11Space) /* We have to detour a function in the ARM11 kernel because builtin modules are compressed in memory and are only decompressed at runtime */ - u32 ret = 0; + u32 ret; //Check that we have enough free space - if(*(u32 *)(*freeK11Space + k11modules_bin_size - 4) == 0xFFFFFFFF) + if(*(u32 *)(*freeK11Space + k11modules_bin_size - 4) != 0xFFFFFFFF) ret = 0; + else { //Look for the code that decompresses the .code section of the builtin modules const u8 pattern[] = {0xE5, 0x48, 0x00, 0x9D}; @@ -504,6 +505,8 @@ u32 patchK11ModuleChecks(u8 *pos, u32 size, u8 **freeK11Space) *off = 0xEB000000 | (((((u32)*freeK11Space) - ((u32)off + 8)) >> 2) & 0xFFFFFF); *freeK11Space += k11modules_bin_size; + + ret = 0; } }