Fusee: Add kernel patches for 1.0.0.

This commit is contained in:
Michael Scire 2018-06-24 15:20:16 -06:00
parent 284677c486
commit 040cfa90d3

View file

@ -27,6 +27,40 @@ typedef struct {
} kernel_info_t; } kernel_info_t;
/* Patch definitions. */ /* Patch definitions. */
/*
stp x10, x11, [sp, #-0x10]!
mov w11, w14
lsl x11, x11, #2
ldr x11, [x28, x11]
mov x9, #0x0000ffffffffffff
and x8, x11, x9
mov x9, #0xffff000000000000
and x11, x11, x9
mov x9, #0xfffe000000000000
cmp x11, x9
beq #8
ldr x8, [x10,#0x250]
ldp x10, x11, [sp],#0x10
*/
static const uint8_t MAKE_KERNEL_PATTERN_NAME(100, proc_id_send)[] = {0x48, 0x29, 0x41, 0xF9, 0xC9, 0xF5, 0x7E, 0xD3, 0xCE, 0x09, 0x00, 0x11, 0x48, 0x6A, 0x29, 0xF8};
static const instruction_t MAKE_KERNEL_HOOK_NAME(100, proc_id_send)[] = {0xA9BF2FEA, 0x2A0E03EB, 0xD37EF56B, 0xF86B6B8B, 0x92FFFFE9, 0x8A090168, 0xD2FFFFE9, 0x8A09016B, 0xD2FFFFC9, 0xEB09017F, 0x54000040, 0xF9412948, 0xA8C12FEA};
/*
stp x10, x11, [sp, #-0x10]!
mov w10, w28
lsl x10, x10, #2
ldr x10, [x13, x10]
mov x9, #0x0000ffffffffffff
and x8, x10, x9
mov x9, #0xffff000000000000
and x10, x10, x9
mov x9, #0xfffe000000000000
cmp x10, x9
beq #8
ldr x8, [x11,#0x250]
ldp x10, x11, [sp],#0x10
*/
static const uint8_t MAKE_KERNEL_PATTERN_NAME(100, proc_id_recv)[] = {0x68, 0x29, 0x41, 0xF9, 0x89, 0xF7, 0x7E, 0xD3, 0x9C, 0x0B, 0x00, 0x11, 0x48, 0x69, 0x29, 0xF8};
static const instruction_t MAKE_KERNEL_HOOK_NAME(100, proc_id_recv)[] = {0xA9BF2FEA, 0x2A1C03EA, 0xD37EF54A, 0xF86A69AA, 0x92FFFFE9, 0x8A090148, 0xD2FFFFE9, 0x8A09014A, 0xD2FFFFC9, 0xEB09015F, 0x54000040, 0xF9412968, 0xA8C12FEA};
/* /*
mov w10, w23 mov w10, w23
lsl x10, x10, #2 lsl x10, x10, #2
@ -98,7 +132,22 @@ static const instruction_t MAKE_KERNEL_HOOK_NAME(500, proc_id_recv)[] = {0xF9403
/* Hook Definitions. */ /* Hook Definitions. */
static const kernel_hook_t g_kernel_hooks_100[] = { static const kernel_hook_t g_kernel_hooks_100[] = {
/* TODO */ { /* Send Message Process ID Patch. */
.pattern_size = 0x10,
.pattern = MAKE_KERNEL_PATTERN_NAME(100, proc_id_send),
.pattern_hook_offset = 0x0,
.payload_num_instructions = 13,
.branch_back_offset = 0x4,
.payload = MAKE_KERNEL_HOOK_NAME(100, proc_id_send)
},
{ /* Receive Message Process ID Patch. */
.pattern_size = 0x10,
.pattern = MAKE_KERNEL_PATTERN_NAME(100, proc_id_recv),
.pattern_hook_offset = 0x0,
.payload_num_instructions = 13,
.branch_back_offset = 0x4,
.payload = MAKE_KERNEL_HOOK_NAME(100, proc_id_recv)
}
}; };
static const kernel_hook_t g_kernel_hooks_200[] = { static const kernel_hook_t g_kernel_hooks_200[] = {
/* TODO */ /* TODO */
@ -151,6 +200,7 @@ static const kernel_hook_t g_kernel_hooks_500[] = {
/* Kernel Infos. */ /* Kernel Infos. */
static const kernel_info_t g_kernel_infos[] = { static const kernel_info_t g_kernel_infos[] = {
{ /* 1.0.0. */ { /* 1.0.0. */
.hash = {0xB8, 0xC5, 0x0C, 0x68, 0x25, 0xA9, 0xB9, 0x5B, 0xD2, 0x4D, 0x2C, 0x7C, 0x81, 0x7F, 0xE6, 0x96, 0xF2, 0x42, 0x4E, 0x1D, 0x78, 0xDF, 0x3B, 0xCA, 0x3D, 0x6B, 0x68, 0x12, 0xDD, 0xA9, 0xCB, 0x9C},
.free_code_space_offset = 0x4597C, .free_code_space_offset = 0x4597C,
KERNEL_HOOKS(100) KERNEL_HOOKS(100)
}, },