forked from waninkoko/es-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
72 lines (56 loc) · 1.57 KB
/
main.c
File metadata and controls
72 lines (56 loc) · 1.57 KB
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
/*
* ES plugin for Custom IOS.
*
* Copyright (C) 2010 Waninkoko.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include "config.h"
#include "ipc.h"
#include "main.h"
#include "patches.h"
#include "plugin.h"
#include "swi_mload.h"
#include "syscalls.h"
#include "tools.h"
#include "types.h"
/* IOS information */
iosInfo ios = { 0 };
s32 __ES_System(u32 arg1, u32 arg2)
{
u32 perms;
/* Invalidate cache */
ICInvalidate();
/* Apply permissions */
perms = Perms_Read();
Perms_Write(0xFFFFFFFF);
/* Patch modules */
Patch_EsModule(ios.esVersion);
/* Restore permissions */
Perms_Write(perms);
return 0;
}
int main(void)
{
/* Print info */
write("$IOSVersion: ESP: " __DATE__ " " __TIME__ " 64M$\n");
/* Load config */
Config_Load(&config, sizeof(config));
/* Get IOS info */
Swi_GetIosInfo(&ios);
/* Initialize plugin */
Swi_CallFunc((void *)__ES_System, NULL, NULL);
return 0;
}