Add stub MCP_LoadFile patch - It works!

This commit is contained in:
Ash 2018-05-08 20:17:40 +10:00
parent 82a58b7fe0
commit 8f1bba1f9f
No known key found for this signature in database
GPG Key ID: 461BAD1D1531729D
3 changed files with 16 additions and 0 deletions

View File

@ -55,6 +55,8 @@ void mcp_run_patches(u32 ios_elf_start)
u32 patch_count = (u32)(((u8*)mcp_patches_table_end) - ((u8*)mcp_patches_table)) / sizeof(patch_table_t);
patch_table_entries(ios_elf_start, mcp_patches_table, patch_count);
section_write_word(ios_elf_start, 0x050254D6, THUMB_BL(0x050254D6, MCP_LoadFile_patch));
// patch MCP syslogs
//section_write_word(ios_elf_start, 0x05055438, ARM_B(0x05055438, 0x0503DCF8));
//section_write_word(ios_elf_start, 0x05056C2C, ARM_B(0x05056C2C, 0x0503DCF8));

View File

@ -0,0 +1,4 @@
int _MCP_LoadFile_patch(int arg1, int arg2, int arg3, int arg4, char arg5) {
int (*real_func)(int arg1, int arg2, int arg3, int arg4, char arg5) = (void*)0x0501CAA8 + 1; //thumb
return real_func(arg1, arg2, arg3, arg4, arg5);
}

View File

@ -0,0 +1,10 @@
.extern _MCP_LoadFile_patch
.global MCP_LoadFile_patch
MCP_LoadFile_patch:
.thumb
bx pc
nop
.arm
ldr r12, =_MCP_LoadFile_patch
bx r12