From: Jon Feldman Date: Wed, 8 Feb 2017 18:24:23 +0000 (-0500) Subject: Adjust pattern window on firmlaunch to NOT include code that changes T_T X-Git-Tag: v0.3.1~11 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=aa8ef0498496aef92f7475e06816c4ed7776a2e0;p=corbenik%2Fcorbenik.git Adjust pattern window on firmlaunch to NOT include code that changes T_T --- diff --git a/boot/patch/reboot.c b/boot/patch/reboot.c index 3a56b0b..b31fb3e 100644 --- a/boot/patch/reboot.c +++ b/boot/patch/reboot.c @@ -26,7 +26,7 @@ int patch_reboot(firm_h* firm_loc) { // Look for firmlaunch code - const uint8_t pattern[] = { 0xDE, 0x1F, 0x8D, 0xE2 }; + const uint8_t pattern[] = { 0xE2, 0x20, 0x20, 0x90 }; uint32_t process9Size, process9MemAddr; uint8_t *process9Offset = @@ -36,7 +36,12 @@ patch_reboot(firm_h* firm_loc) wait(); - uint8_t *off = memfind(process9Offset, process9Size, pattern, 4) - 0x10; + uint8_t *off = memfind(process9Offset, process9Size, pattern, 4); + + if (!off) + return 1; + + off -= 0x13; fprintf(stderr, "reboot: firmlaunch @ %lx\n", (uint32_t)off);