10
10
#include " Util.h"
11
11
#include " material.h"
12
12
13
+
13
14
// ==========================================================================================================================================
14
15
15
16
typedef struct _LoaderInvocationListener LoaderInvocationListener;
@@ -42,7 +43,7 @@ struct InvocationState {
42
43
std::string* retstr;
43
44
};
44
45
45
-
46
+ GumAddress minecraftpeBaseAddr;
46
47
GumAddress ResourcePackManager_ResourcePackManager;
47
48
GumAddress AppPlatform_readAssetFile;
48
49
@@ -58,14 +59,14 @@ void __attribute__((constructor)) init() {
58
59
59
60
gum_init ();
60
61
61
- ModuleRange minecraftpeDetails = get_module_range ( );
62
- if (minecraftpeDetails. addr == 0 || minecraftpeDetails. len == 0 ) {
63
- // Failed initialization
64
- return ;
65
- }
62
+ minecraftpeBaseAddr = gum_module_find_base_address ( " libminecraftpe.so " );
63
+
64
+ GumModuleMap* moduleMap = gum_module_map_new ();
65
+ const GumModuleDetails* minecraftpeDetails = gum_module_map_find (moduleMap, minecraftpeBaseAddr) ;
66
+
66
67
#if __arm__
67
68
// ResourcePackManager::ResourcePackManager
68
- ResourcePackManager_ResourcePackManager = FindSignatures (& minecraftpeDetails,
69
+ ResourcePackManager_ResourcePackManager = FindSignatures (minecraftpeDetails,
69
70
// 1.20.50-1.20.81
70
71
// "F0 B5 03 AF 2D E9 00 07 90 B0 05 46 AD 48 98 46 92 46 78 44 00 68 00 68 0F 90 08 69",
71
72
// 1.21.0-1.21.31
@@ -81,7 +82,7 @@ void __attribute__((constructor)) init() {
81
82
);
82
83
83
84
// AppPlatform::readAssetFile
84
- AppPlatform_readAssetFile = FindSignatures (& minecraftpeDetails,
85
+ AppPlatform_readAssetFile = FindSignatures (minecraftpeDetails,
85
86
// 1.20.50.21preview
86
87
// "F0 B5 03 AF 4D F8 04 8D 9C B0 04 46 6E 48 78 44 00 68 00 68 1B 90 00 20 CD E9 08 00",
87
88
// 1.20.50-1.20.73
@@ -102,15 +103,15 @@ void __attribute__((constructor)) init() {
102
103
}
103
104
#elif __aarch64__
104
105
// ResourcePackManager::ResourcePackManager
105
- ResourcePackManager_ResourcePackManager = FindSignatures (& minecraftpeDetails,
106
+ ResourcePackManager_ResourcePackManager = FindSignatures (minecraftpeDetails,
106
107
// 1.20.50-1.21.50
107
108
" FF 03 03 D1 FD 7B 07 A9 FD C3 01 91 F9 43 00 F9 F8 5F 09 A9 F6 57 0A A9 F4 4F 0B A9 59 D0 3B D5 F6 03 03 2A 28 17 40 F9 F5 03 02 AA F3 03 00 AA A8 83 1F F8 28 10 40 F9" ,
108
109
// 1.21.60.21preview
109
110
" FF 83 02 D1 FD 7B 06 A9 FD 83 01 91 F8 5F 07 A9 F6 57 08 A9 F4 4F 09 A9 58 D0 3B D5 F6 03 03 2A 08 17 40 F9 F5 03 02 AA F3 03 00 AA A8 83 1F F8 28 10 40 F9 28 01 00 B4"
110
111
);
111
112
112
113
// AppPlatform::readAssetFile
113
- AppPlatform_readAssetFile = FindSignatures (& minecraftpeDetails,
114
+ AppPlatform_readAssetFile = FindSignatures (minecraftpeDetails,
114
115
// 1.20.50-1.20.73
115
116
" FF 03 04 D1 FD 7B 0C A9 FD 03 03 91 FC 5F 0D A9 F6 57 0E A9 F4 4F 0F A9 57 D0 3B D5 F3 03 08 AA E8 16 40 F9 A8 83 1F F8 FF 7F 02 A9" ,
116
117
// 1.20.80-1.21.50
@@ -128,6 +129,8 @@ void __attribute__((constructor)) init() {
128
129
printf (" AppPlatform::readAssetFile not found\n " );
129
130
}
130
131
#endif
132
+
133
+ g_object_unref (moduleMap);
131
134
132
135
interceptor = gum_interceptor_obtain ();
133
136
listener = (GumInvocationListener*) g_object_new (LOADER_TYPE_INVOCATION_LISTENER, NULL );
0 commit comments