Add stub ioctl 0x64, doesn't do much yet

This commit is contained in:
Ash 2018-05-31 21:11:20 +10:00
parent 8aed06c564
commit 4a5e8f3d19
3 changed files with 20 additions and 0 deletions

View File

@ -56,6 +56,7 @@ void mcp_run_patches(u32 ios_elf_start)
patch_table_entries(ios_elf_start, mcp_patches_table, patch_count);
section_write_word(ios_elf_start, 0x050254D6, THUMB_BL(0x050254D6, MCP_LoadFile_patch));
section_write_word(ios_elf_start, 0x05025242, THUMB_BL(0x05025242, MCP_ioctl64_patch));
// patch MCP syslogs
//section_write_word(ios_elf_start, 0x05055438, ARM_B(0x05055438, 0x0503DCF8));

View File

@ -114,3 +114,10 @@ int _MCP_LoadFile_patch(ipcmessage* msg) {
return real_MCP_LoadFile(msg);
}
int _MCP_ioctl64_patch(ipcmessage* msg) {
log_printf("Hi from ioctl 0x64! ipc: %08X\n", msg);
/* DO NOT RETURN 0, this affects the codepaths back in the native ARM code */
return 1;
}

View File

@ -8,3 +8,15 @@ MCP_LoadFile_patch:
.arm
ldr r12, =_MCP_LoadFile_patch
bx r12
.extern _MCP_ioctl64_patch
.global MCP_ioctl64_patch
MCP_ioctl64_patch:
.thumb
ldr r0, [r7,#0xC]
bx pc
nop
.arm
ldr r12, =_MCP_ioctl64_patch
bx r12