-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.c
38 lines (32 loc) · 1.26 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <psp2kern/kernel/modulemgr.h>
#include <taihen.h>
#include <stdio.h>
#include <string.h>
static tai_hook_ref_t ksceVfsNodeInitializePartitionRef;
static SceUID uid = -1;
static int ksceVfsNodeInitializePartitionPatched(int *node, int *new_node_p,
void *opt, int flags) {
int res = TAI_CONTINUE(int, ksceVfsNodeInitializePartitionRef, node,
new_node_p, opt, flags);
if (res == 0 && new_node_p) {
int *new_node = (int *)*new_node_p;
int *mount = (int *)new_node[19];
mount[20] &= ~0x10000;
}
return res;
}
void _start() __attribute__ ((weak, alias("module_start")));
int module_start(SceSize args, void *argp) {
uid = taiHookFunctionExportForKernel(KERNEL_PID,
&ksceVfsNodeInitializePartitionRef,
"SceIofilemgr",
TAI_ANY_LIBRARY,
0xA5A6A55C,
ksceVfsNodeInitializePartitionPatched);
return SCE_KERNEL_START_SUCCESS;
}
int module_stop(SceSize args, void *argp) {
if (uid >= 0)
taiHookReleaseForKernel(uid, ksceVfsNodeInitializePartitionRef);
return SCE_KERNEL_STOP_SUCCESS;
}