From aa8ef0498496aef92f7475e06816c4ed7776a2e0 Mon Sep 17 00:00:00 2001 From: Jon Feldman Date: Wed, 8 Feb 2017 13:24:23 -0500 Subject: [PATCH] Adjust pattern window on firmlaunch to NOT include code that changes T_T --- boot/patch/reboot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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); -- 2.39.5