]> Chaos Git - corbenik/corbenik.git/commitdiff
Adjust pattern window on firmlaunch to NOT include code that changes T_T
authorJon Feldman <chaos.kagami@gmail.com>
Wed, 8 Feb 2017 18:24:23 +0000 (13:24 -0500)
committerJon Feldman <chaos.kagami@gmail.com>
Wed, 8 Feb 2017 18:41:14 +0000 (13:41 -0500)
boot/patch/reboot.c

index 3a56b0b09d5a3eb0e96ea8bacaa1ebf43c2a8c6c..b31fb3edb4ce682632651ddf5c4163f390a080f0 100644 (file)
@@ -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);