mirror of
https://github.com/wiiu-env/MochaPayload.git
synced 2024-12-01 20:14:14 +01:00
Add custom ioctl to read the OTP
This commit is contained in:
parent
6f5829e73f
commit
7388fa001f
@ -28,5 +28,6 @@
|
|||||||
#define KERNEL_WRITE32 2
|
#define KERNEL_WRITE32 2
|
||||||
#define KERNEL_MEMCPY 3
|
#define KERNEL_MEMCPY 3
|
||||||
#define KERNEL_GET_CFW_CONFIG 4
|
#define KERNEL_GET_CFW_CONFIG 4
|
||||||
|
#define KERNEL_READ_OTP 5
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -71,6 +71,11 @@ int kernel_syscall_0x81(u32 command, u32 arg1, u32 arg2, u32 arg3) {
|
|||||||
//kernel_memcpy((void*)arg1, &cfw_config, sizeof(cfw_config));
|
//kernel_memcpy((void*)arg1, &cfw_config, sizeof(cfw_config));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case KERNEL_READ_OTP: {
|
||||||
|
int (*read_otp_internal)(int index, void* out_buf, u32 size) = (int (*)(int, void*, u32)) 0x08120248;
|
||||||
|
read_otp_internal(0, (void*)(arg1), 0x400);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#define IOCTL_REPEATED_WRITE 0x05
|
#define IOCTL_REPEATED_WRITE 0x05
|
||||||
#define IOCTL_KERN_READ32 0x06
|
#define IOCTL_KERN_READ32 0x06
|
||||||
#define IOCTL_KERN_WRITE32 0x07
|
#define IOCTL_KERN_WRITE32 0x07
|
||||||
|
#define IOCTL_READ_OTP 0x08
|
||||||
|
|
||||||
#define IOCTL_FSA_OPEN 0x40
|
#define IOCTL_FSA_OPEN 0x40
|
||||||
#define IOCTL_FSA_CLOSE 0x41
|
#define IOCTL_FSA_CLOSE 0x41
|
||||||
@ -172,6 +173,14 @@ static int ipc_ioctl(ipcmessage *message) {
|
|||||||
svcCustomKernelCommand(KERNEL_WRITE32, message->ioctl.buffer_in[0], message->ioctl.buffer_in[1]);
|
svcCustomKernelCommand(KERNEL_WRITE32, message->ioctl.buffer_in[0], message->ioctl.buffer_in[1]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case IOCTL_READ_OTP: {
|
||||||
|
if ((message->ioctl.length_io < 0x400)) {
|
||||||
|
res = IOS_ERROR_INVALID_SIZE;
|
||||||
|
} else {
|
||||||
|
svcCustomKernelCommand(KERNEL_READ_OTP, message->ioctl.buffer_io);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
//!--------------------------------------------------------------------------------------------------------------
|
//!--------------------------------------------------------------------------------------------------------------
|
||||||
//! FSA handles for better performance
|
//! FSA handles for better performance
|
||||||
|
Loading…
Reference in New Issue
Block a user