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.
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.
#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)
{
#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)
{
#include "patch.h"
+/*
+ find 4, 0x25, 0x79, 0x0B, 0x99
+ set 2, 0xE3, 0xA0
+ */
+
void
disable_nim_updates(u64 progId, u8* code, u32 size)
{
#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} ;
#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)
{
#include "patch.h"
+/*
+ find 8, u"Ver."
+ set 8, u".hax"
+ */
+
void
settings_string(u64 progId, u8* code, u32 size)
{
#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)
{
#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)
{
#include "patch.h"
+/*
+ find 5, 0x06, 0x46, 0x10, 0x48, 0xFC
+ set 2, 0x00, 0x26
+ */
+
void
secureinfo_sigpatch(u64 progId, u8* code, u32 size)
{