forked from Jadis0x/il2cpp-reverse-engineering-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathil2cpp-init.cpp
More file actions
55 lines (45 loc) · 1.42 KB
/
il2cpp-init.cpp
File metadata and controls
55 lines (45 loc) · 1.42 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
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
// IL2CPP application initializer
#include "pch-il2cpp.h"
#include "il2cpp-appdata.h"
#include "il2cpp-init.h"
#include "helpers.h"
// IL2CPP APIs
#define DO_API(r, n, p) r (*n) p
#include "il2cpp-api-functions.h"
#undef DO_API
// Application-specific functions
#define DO_APP_FUNC(a, r, n, p) r (*n) p
#define DO_APP_FUNC_METHODINFO(a, n) struct MethodInfo ** n
namespace app {
#include "il2cpp-functions.h"
}
#undef DO_APP_FUNC
#undef DO_APP_FUNC_METHODINFO
// TypeInfo pointers
#define DO_TYPEDEF(a, n) n ## __Class** n ## __TypeInfo
namespace app {
#include "il2cpp-types-ptr.h"
}
#undef DO_TYPEDEF
// IL2CPP application initializer
void init_il2cpp()
{
// Get base address of IL2CPP module
uintptr_t baseAddress = il2cppi_get_base_address();
using namespace app;
// Define IL2CPP API function addresses
#define DO_API(r, n, p) n = (r (*) p)(baseAddress + n ## _ptr)
#include "il2cpp-api-functions.h"
#undef DO_API
// Define function addresses
#define DO_APP_FUNC(a, r, n, p) n = (r (*) p)(baseAddress + a)
#define DO_APP_FUNC_METHODINFO(a, n) n = (struct MethodInfo **)(baseAddress + a)
#include "il2cpp-functions.h"
#undef DO_APP_FUNC
#undef DO_APP_FUNC_METHODINFO
// Define TypeInfo variables
#define DO_TYPEDEF(a, n) n ## __TypeInfo = (n ## __Class**) (baseAddress + a);
#include "il2cpp-types-ptr.h"
#undef DO_TYPEDEF
}