]> Chaos Git - corbenik/corbenik.git/commitdiff
Convert relevant patches to bytecode (in headers)
authorchaoskagami <chaos.kagami@gmail.com>
Wed, 1 Jun 2016 13:48:18 +0000 (09:48 -0400)
committerchaoskagami <chaos.kagami@gmail.com>
Wed, 1 Jun 2016 13:48:18 +0000 (09:48 -0400)
doc/bytecode.md
external/loader/source/patch/block_cart_update.c
external/loader/source/patch/block_eshop_update.c
external/loader/source/patch/block_nim_update.c
external/loader/source/patch/errdisp.c
external/loader/source/patch/friends_ver.c
external/loader/source/patch/mset_str.c
external/loader/source/patch/regionfree.c
external/loader/source/patch/ro_sigs.c
external/loader/source/patch/secinfo_sigs.c

index 3a7422104749bad0cff85cd771c5b0cbefc85b6d..56839f4c7ac3cf62df04d89955d2b3fb17dae4f1 100644 (file)
@@ -5,6 +5,10 @@ Instructions are one byte and have a variable number of bytes afterwards.
 
 Unless otherwise noted, if an instruction doesn't succeed, it will abort.
 
+nop : 1 byte : Opcode 0x00
+       Does nothing. Not actually treated as an instruction,
+    rather just skipped over. This is mainly just for compatibility.
+
 rel <mode> : 2 bytes : Opcode 0x01
        Chooses firmware relativity.
 
@@ -75,10 +79,11 @@ test <size> <data...> : 2 bytes : opcode 0x06
                Pattern to test.
 
 jmp <offset> : 3 bytes : opcode 0x07
-       Jumps to <offset> within the bytecode, and resumes execution from there.
+       Jumps to the Nth instruction within the bytecode, and
+    resumes execution from there.
 
        <offset> : 2 bytes
-               Offset to jump to.
+               Index to jump to.
 
 rewind : 1 byte : opcode 0x08
        Resets the location to the beginning of the space we're working off.
index 9e19a9a1ca2fd890f20cea24dee97a95e559f710..362a7d2b72f3f7a73762525a908ab840d17706c3 100644 (file)
@@ -1,5 +1,13 @@
 #include "patch.h"
 
+/*
+  find 4, 0x0C, 0x18, 0xE1, 0xD8
+  set  4, 0x0B, 0x18, 0x21, 0xC8
+
+  find 4, 0x0C, 0x18, 0xE1, 0xD8
+  set  4, 0x0B, 0x18, 0x21, 0xC8
+*/
+
 void
 disable_cart_updates(u64 progId, u8* code, u32 size)
 {
index 18ad438b4fcd454d18f1f870bb7d8a6e13c8a37a..b2894f669bf6781423f3ac68b9d72bee45945f98 100644 (file)
@@ -1,5 +1,10 @@
 #include "patch.h"
 
+/*
+  find 4, 0x30, 0xB5, 0xF1, 0xB0
+  set  6, 0x00, 0x20, 0x08, 0x60, 0x70, 0x47
+ */
+
 void
 disable_eshop_updates(u64 progId, u8* code, u32 size)
 {
index d765cbef117f7befeacf411d1513525d83a90e60..1e049a06138055bdeb90c111189a5b27c4dbf64c 100644 (file)
@@ -1,5 +1,10 @@
 #include "patch.h"
 
+/*
+  find 4, 0x25, 0x79, 0x0B, 0x99
+  set  2, 0xE3, 0xA0
+ */
+
 void
 disable_nim_updates(u64 progId, u8* code, u32 size)
 {
index 8578d939fe7d72c3c34bb9c1c9594552e1865729..8446b8f5d7f622ed868546f9825b4fa5f4a83c84 100644 (file)
@@ -1,5 +1,17 @@
 #include "patch.h"
 
+/*
+  find 8, 0x14, 0x00, 0xD0, 0xE5, 0xDB, 0x9A, 0x9F, 0xED
+  set  4, 0x00, 0x00, 0xA0, 0xE3
+
+  find 8, 0x14, 0x00, 0xD0, 0xE5, 0x01, 0x00, 0x10, 0xE3
+  set  4, 0x00, 0x00, 0xA0, 0xE3
+  find 8, 0x14, 0x00, 0xD0, 0xE5, 0x01, 0x00, 0x10, 0xE3
+  set  4, 0x00, 0x00, 0xA0, 0xE3
+  find 8, 0x14, 0x00, 0xD0, 0xE5, 0x01, 0x00, 0x10, 0xE3
+  set  4, 0x00, 0x00, 0xA0, 0xE3
+ */
+
 void errdisp_devpatch(u64 progId, u8* code, u32 size) {
        static const u8 unitinfoCheckPattern1[] = {0x14, 0x00, 0xD0, 0xE5, 0xDB, 0x9A, 0x9F, 0xED};
        static const u8 unitinfoCheckPattern2[] = {0x14, 0x00, 0xD0, 0xE5, 0x01, 0x00, 0x10, 0xE3} ;
index 618cb7ac85354983243408c62ecd130899aa9472..f24c2284f7a3bd47d117405d4887be8964145cef 100644 (file)
@@ -1,5 +1,11 @@
 #include "patch.h"
 
+/*
+  find 8, 0xE0, 0x1E, 0xFF, 0x2F, 0xE1, 0x01, 0x01, 0x01
+  fwd 9
+  set 1, 0x06
+ */
+
 void
 fake_friends_version(u64 progId, u8* code, u32 size)
 {
index ee269bd1945ff7c9bfabc1f1ac3e688fb0c5a258..1569199b6b7475f883927404f9bd301a81d10409 100644 (file)
@@ -1,5 +1,10 @@
 #include "patch.h"
 
+/*
+  find 8, u"Ver."
+  set  8, u".hax"
+ */
+
 void
 settings_string(u64 progId, u8* code, u32 size)
 {
index a7eca93248156d134989bcdff79d88f6f162f0fb..f8e677e9fd56ecfdbdf25c830e96865bcfdad6d3 100644 (file)
@@ -1,5 +1,11 @@
 #include "patch.h"
 
+/*
+  find 8, 0x00, 0x00, 0x55, 0xE3, 0x01, 0x10, 0xA0, 0xE3
+  back 16
+  set  8, 0x01, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1
+ */
+
 void
 region_patch(u64 progId, u8* code, u32 size)
 {
index 6e98d77b233f703c557f338865e8dcacd314f6fb..b44d8219b0efb1abbe8f95a1f097b8d189e264a1 100644 (file)
@@ -1,5 +1,16 @@
 #include "patch.h"
 
+/*
+  find 8, 0x30, 0x40, 0x2D, 0xE9, 0x02, 0x50, 0xA0, 0xE1
+  set  8, 0x00, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1
+
+  find 8, 0x30, 0x40, 0x2D, 0xE9, 0x24, 0xD0, 0x4D, 0xE2
+  set  8, 0x00, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1
+
+  find 8, 0xF8, 0x4F, 0x2D, 0xE9, 0x01, 0x70, 0xA0, 0xE1
+  set  8, 0x00, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1
+ */
+
 void
 ro_sigpatch(u64 progId, u8* code, u32 size)
 {
index 34f6225d5de659c4c563d7ebc5a0ef67c0bc1f7b..525b386e0694fe80ee6c0832a609aec41512bde3 100644 (file)
@@ -1,5 +1,10 @@
 #include "patch.h"
 
+/*
+  find 5, 0x06, 0x46, 0x10, 0x48, 0xFC
+  set  2, 0x00, 0x26
+ */
+
 void
 secureinfo_sigpatch(u64 progId, u8* code, u32 size)
 {