-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.c
59 lines (44 loc) · 1.3 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "libpspexploit.h"
// flash_dumper.c
void initDumperKernelThread();
PSP_MODULE_INFO("Flash Dumper", PSP_MODULE_USER, 1, 0);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER | PSP_THREAD_ATTR_VFPU);
static KernelFunctions _ktbl;
KernelFunctions* k_tbl = &_ktbl;
void kmain(){
int k1 = pspSdkSetK1(0);
pspDebugScreenPrintf("Got Kernel Access!\n");
pspXploitScanKernelFunctions(k_tbl);
pspXploitRepairKernel();
initDumperKernelThread();
pspDebugScreenPrintf("All Done!\n");
pspSdkSetK1(k1);
}
int main(){
int res = 0;
pspDebugScreenInit();
pspDebugScreenPrintf("Universal Flash Dumper Started.\n");
pspDebugScreenPrintf("Initializing kernel exploit...\n");
res = pspXploitInitKernelExploit();
if (res == 0){
pspDebugScreenPrintf("Corrupting kernel...\n");
res = pspXploitDoKernelExploit();
if (res == 0){
pspXploitExecuteKernel(kmain);
}
else {
pspDebugScreenPrintf("ERROR: %p", res);
}
}
else{
pspDebugScreenPrintf("ERROR: %p\n", res);
}
pspDebugScreenPrintf("Press any button to exit\n");
SceCtrlData pad;
while (1){
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons) break;
}
sceKernelExitGame();
return 0;
}