This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
DolcePolce.c
131 lines (106 loc) · 5.58 KB
/
DolcePolce.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#include <psp2/kernel/modulemgr.h>
#include <taihen.h>
#include <string.h>
#include <vitasdk.h>
static SceUID check_psm_allowed_hook = -1;
static tai_hook_ref_t check_psm_allowed_hook_ref;
static SceUID check_vita_allowed_hook = -1;
static tai_hook_ref_t check_vita_allowed_hook_ref;
static SceUID check_pspemu_allowed_hook = -1;
static tai_hook_ref_t check_pspemu_allowed_hook_ref;
static int check_psm_allowed(char **game, int *is_allowed, int *unk) {
int ret = TAI_CONTINUE(int, check_psm_allowed_hook_ref,game, is_allowed, unk);
if(*is_allowed != 0x1)
{
sceClibPrintf("[DolcePolce] check_psm_allowed: %s is blacklisted... launching anyway!\n",*game);
*is_allowed = 0x1;
}
return ret;
}
static int check_vita_allowed(char **game, int *is_allowed, int *unk) {
int ret = TAI_CONTINUE(int, check_vita_allowed_hook_ref, game, is_allowed, unk);
if(*is_allowed != 0x1)
{
sceClibPrintf("[DolcePolce] check_vita_allowed: %s is blacklisted... launching anyway!\n",*game);
*is_allowed = 0x1;
}
return ret;
}
static int check_pspemu_allowed(char **game, int *is_allowed, int *unk) {
int ret = TAI_CONTINUE(int, check_pspemu_allowed_hook_ref, game, is_allowed, unk);
if(*is_allowed != 0x1000001)
{
sceClibPrintf("[DolcePolce] check_pspemu_allowed %s is blacklisted... launching anyway!\n",*game);
*is_allowed = 0x1000001;
}
return ret;
}
void _start() __attribute__ ((weak, alias ("module_start")));
int module_start(SceSize argc, const void *args) {
sceClibPrintf("[DolcePolce] La Dolce Vita!\n");
tai_module_info_t tai_info;
tai_info.size = sizeof(tai_module_info_t);
taiGetModuleInfo("SceShell", &tai_info);
/*
* This HookFunctionOffset thing is really getting old but whatever .-.
*/
switch (tai_info.module_nid) {
case 0x6CB01295: // devkit 3.60 SceShell
case 0x232D733B: // devkit 3.61 SceShell
case 0xE541DB9B: // devkit 3.63 SceShell
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2E782,1, check_psm_allowed);
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E2DA,1, check_vita_allowed);
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2E5E6,1, check_pspemu_allowed);
break;
case 0xE6A02F2B: //devkit 3.65 SceShell
case 0xAB5C2A00: //devkit 3.67 SceShell
case 0x4FE7C671: //devkit 3.68 SceShell
case 0xC5B7C871: //devkit 3.71 SceShell
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2E7DA,1, check_psm_allowed);
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E332,1, check_vita_allowed);
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2E63E,1, check_pspemu_allowed);
break;
case 0xEAB89D5C: // testkit 3.60 SceShell
case 0x7A5F8457: // testkit 3.61 SceShell
case 0xE7C5011A: // testkit 3.63 SceShell
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2EBD8,1, check_psm_allowed);
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E730,1, check_vita_allowed);
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2EA3C,1, check_pspemu_allowed);
break;
case 0x587F9CED: // testkit 3.65 SceShell
case 0x3C652B1A: // testkit 3.67 SceShell
case 0x4DF04256: // testkit 3.68 SceShell
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2EC30,1, check_psm_allowed);
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E788,1, check_vita_allowed);
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2EA94,1, check_pspemu_allowed);
break;
case 0x0552F692: // retail 3.60 SceShell
case 0x532155E5: // retail 3.61 SceShell
case 0xBB4B0A3E: // retail 3.63 SceShell
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2E8D0,1, check_psm_allowed);
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E428,1, check_vita_allowed);
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2E734,1, check_pspemu_allowed);
break;
case 0x5549BF1F: // retail 3.65 SceShell
case 0x34B4D82E: // retail 3.67 SceShell
case 0x12DAC0F3: // retail 3.68 SceShell
case 0x0703C828: // retail 3.69 SceShell
case 0x2053B5A5: // retail 3.70 SceShell
case 0xF476E785: // retail 3.71 SceShell
case 0x939FFBE9: // retail 3.72 SceShell
case 0x734D476A: // retail 3.73 SceShell
default:
check_psm_allowed_hook = taiHookFunctionOffset(&check_psm_allowed_hook_ref, tai_info.modid,0,0x2E928,1, check_psm_allowed);
check_vita_allowed_hook = taiHookFunctionOffset(&check_vita_allowed_hook_ref, tai_info.modid,0,0x2E480,1, check_vita_allowed);
check_pspemu_allowed_hook = taiHookFunctionOffset(&check_pspemu_allowed_hook_ref, tai_info.modid,0,0x2E78C,1, check_pspemu_allowed);
break;
}
return SCE_KERNEL_START_SUCCESS;
}
int module_stop(SceSize argc, const void *args) {
// release hooks
if (check_psm_allowed_hook >= 0) taiHookRelease(check_psm_allowed_hook, check_psm_allowed_hook_ref);
if (check_vita_allowed_hook >= 0) taiHookRelease(check_vita_allowed_hook, check_vita_allowed_hook_ref);
if (check_pspemu_allowed_hook >= 0) taiHookRelease(check_pspemu_allowed_hook, check_pspemu_allowed_hook_ref);
return SCE_KERNEL_STOP_SUCCESS;
}