frida-java-bridge 6.3.5 → 6.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/android.js +13 -7
  2. package/lib/jvm.js +222 -173
  3. package/package.json +1 -1
package/lib/android.js CHANGED
@@ -1894,21 +1894,27 @@ function ensureArtKnowsHowToHandleReplacementMethods (vm) {
1894
1894
  const apiLevel = getAndroidApiLevel();
1895
1895
 
1896
1896
  const mayUseCollector = (apiLevel > 28)
1897
- ? new NativeFunction(Module.getExportByName('libart.so', '_ZNK3art2gc4Heap15MayUseCollectorENS0_13CollectorTypeE'), 'bool', ['pointer', 'int'])
1897
+ ? (type) => {
1898
+ const impl = Module.findExportByName('libart.so', '_ZNK3art2gc4Heap15MayUseCollectorENS0_13CollectorTypeE');
1899
+ if (impl === null) {
1900
+ return false;
1901
+ }
1902
+ return new NativeFunction(impl, 'bool', ['pointer', 'int'])(getApi().artHeap, type);
1903
+ }
1898
1904
  : () => false;
1899
1905
  const kCollectorTypeCMC = 3;
1900
1906
 
1901
- if (mayUseCollector(getApi().artHeap, kCollectorTypeCMC)) {
1907
+ if (mayUseCollector(kCollectorTypeCMC)) {
1902
1908
  Interceptor.attach(Module.getExportByName('libart.so', '_ZN3art6Thread15RunFlipFunctionEPS0_b'), artController.hooks.Gc.runFlip);
1903
1909
  } else {
1904
- let exportName = null;
1910
+ let copyingPhase = null;
1905
1911
  if (apiLevel > 28) {
1906
- exportName = '_ZN3art2gc9collector17ConcurrentCopying12CopyingPhaseEv';
1912
+ copyingPhase = Module.findExportByName('libart.so', '_ZN3art2gc9collector17ConcurrentCopying12CopyingPhaseEv');
1907
1913
  } else if (apiLevel > 22) {
1908
- exportName = '_ZN3art2gc9collector17ConcurrentCopying12MarkingPhaseEv';
1914
+ copyingPhase = Module.findExportByName('libart.so', '_ZN3art2gc9collector17ConcurrentCopying12MarkingPhaseEv');
1909
1915
  }
1910
- if (exportName !== null) {
1911
- Interceptor.attach(Module.getExportByName('libart.so', exportName), artController.hooks.Gc.copyingPhase);
1916
+ if (copyingPhase !== null) {
1917
+ Interceptor.attach(copyingPhase, artController.hooks.Gc.copyingPhase);
1912
1918
  }
1913
1919
  }
1914
1920
  }
package/lib/jvm.js CHANGED
@@ -51,184 +51,226 @@ function _getApi () {
51
51
  flavor: 'jvm'
52
52
  };
53
53
 
54
- const pending = [{
55
- module: vmModule.path,
56
- functions: {
57
- JNI_GetCreatedJavaVMs: ['JNI_GetCreatedJavaVMs', 'int', ['pointer', 'int', 'pointer']],
58
-
59
- _ZN6Method4sizeEb: ['Method::size', 'int', ['int']],
60
- _ZN6Method19set_native_functionEPhb: ['Method::set_native_function', 'void', ['pointer', 'pointer', 'int']],
61
- _ZN6Method21clear_native_functionEv: ['Method::clear_native_function', 'void', ['pointer']],
62
- // JDK >= 17
63
- _ZN6Method24restore_unshareable_infoEP10JavaThread: ['Method::restore_unshareable_info', 'void', ['pointer', 'pointer']],
64
- // JDK < 17
65
- _ZN6Method24restore_unshareable_infoEP6Thread: ['Method::restore_unshareable_info', 'void', ['pointer', 'pointer']],
66
- _ZN6Method10jmethod_idEv: ['Method::jmethod_id', 'pointer', ['pointer']],
67
- _ZN6Method10clear_codeEv: function (address) {
68
- const clearCode = new NativeFunction(address, 'void', ['pointer'], nativeFunctionOptions);
69
- this['Method::clear_code'] = function (thisPtr) {
70
- clearCode(thisPtr);
71
- };
72
- },
73
- _ZN6Method10clear_codeEb: function (address) {
74
- const clearCode = new NativeFunction(address, 'void', ['pointer', 'int'], nativeFunctionOptions);
75
- const lock = 0;
76
- this['Method::clear_code'] = function (thisPtr) {
77
- clearCode(thisPtr, lock);
78
- };
79
- },
80
-
81
- // JDK >= 13
82
- _ZN18VM_RedefineClasses19mark_dependent_codeEP13InstanceKlass: ['VM_RedefineClasses::mark_dependent_code', 'void', ['pointer', 'pointer']],
83
- _ZN18VM_RedefineClasses20flush_dependent_codeEv: ['VM_RedefineClasses::flush_dependent_code', 'void', []],
84
- // JDK < 13
85
- _ZN18VM_RedefineClasses20flush_dependent_codeEP13InstanceKlassP6Thread: ['VM_RedefineClasses::flush_dependent_code', 'void', ['pointer', 'pointer', 'pointer']],
86
- // JDK < 10
87
- _ZN18VM_RedefineClasses20flush_dependent_codeE19instanceKlassHandleP6Thread: ['VM_RedefineClasses::flush_dependent_code', 'void', ['pointer', 'pointer', 'pointer']],
88
-
89
- _ZN19ResolvedMethodTable21adjust_method_entriesEPb: ['ResolvedMethodTable::adjust_method_entries', 'void', ['pointer']],
90
- // JDK < 10
91
- _ZN15MemberNameTable21adjust_method_entriesEP13InstanceKlassPb: ['MemberNameTable::adjust_method_entries', 'void', ['pointer', 'pointer', 'pointer']],
92
-
93
- _ZN17ConstantPoolCache21adjust_method_entriesEPb: function (address) {
94
- const adjustMethod = new NativeFunction(address, 'void', ['pointer', 'pointer'], nativeFunctionOptions);
95
- this['ConstantPoolCache::adjust_method_entries'] = function (thisPtr, holderPtr, tracePtr) {
96
- adjustMethod(thisPtr, tracePtr);
97
- };
98
- },
99
- // JDK < 13
100
- _ZN17ConstantPoolCache21adjust_method_entriesEP13InstanceKlassPb: function (address) {
101
- const adjustMethod = new NativeFunction(address, 'void', ['pointer', 'pointer', 'pointer'], nativeFunctionOptions);
102
- this['ConstantPoolCache::adjust_method_entries'] = function (thisPtr, holderPtr, tracePtr) {
103
- adjustMethod(thisPtr, holderPtr, tracePtr);
104
- };
105
- },
106
-
107
- _ZN20ClassLoaderDataGraph10classes_doEP12KlassClosure: ['ClassLoaderDataGraph::classes_do', 'void', ['pointer']],
108
- _ZN20ClassLoaderDataGraph22clean_deallocate_listsEb: ['ClassLoaderDataGraph::clean_deallocate_lists', 'void', ['int']],
109
-
110
- _ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_: ['JavaThread::thread_from_jni_environment', 'pointer', ['pointer']],
111
-
112
- _ZN8VMThread7executeEP12VM_Operation: ['VMThread::execute', 'void', ['pointer']],
113
-
114
- _ZN11OopMapCache22flush_obsolete_entriesEv: ['OopMapCache::flush_obsolete_entries', 'void', ['pointer']],
115
-
116
- _ZN14NMethodSweeper11force_sweepEv: ['NMethodSweeper::force_sweep', 'void', []],
117
- _ZN14NMethodSweeper16sweep_code_cacheEv: ['NMethodSweeper::sweep_code_cache', 'void', []],
118
- _ZN14NMethodSweeper17sweep_in_progressEv: ['NMethodSweeper::sweep_in_progress', 'bool', []],
119
-
120
- JVM_Sleep: ['JVM_Sleep', 'void', ['pointer', 'pointer', 'long']]
121
- },
122
- variables: {
123
- // JDK <= 9
124
- _ZN18VM_RedefineClasses14_the_class_oopE: function (address) {
125
- this.redefineClass = address;
126
- },
127
- // 9 < JDK < 13
128
- _ZN18VM_RedefineClasses10_the_classE: function (address) {
129
- this.redefineClass = address;
130
- },
131
- // JDK < 13
132
- _ZN18VM_RedefineClasses25AdjustCpoolCacheAndVtable8do_klassEP5Klass: function (address) {
133
- this.doKlass = address;
134
- },
135
- // JDK >= 13
136
- _ZN18VM_RedefineClasses22AdjustAndCleanMetadata8do_klassEP5Klass: function (address) {
137
- this.doKlass = address;
138
- },
139
- _ZTV18VM_RedefineClasses: function (address) {
140
- this.vtableRedefineClasses = address;
141
- },
142
- _ZN18VM_RedefineClasses4doitEv: function (address) {
143
- this.redefineClassesDoIt = address;
144
- },
145
- _ZN18VM_RedefineClasses13doit_prologueEv: function (address) {
146
- this.redefineClassesDoItPrologue = address;
147
- },
148
- _ZN18VM_RedefineClasses13doit_epilogueEv: function (address) {
149
- this.redefineClassesDoItEpilogue = address;
150
- },
151
- _ZN18VM_RedefineClassesD0Ev: function (address) {
152
- this.redefineClassesDispose0 = address;
153
- },
154
- _ZN18VM_RedefineClassesD1Ev: function (address) {
155
- this.redefineClassesDispose1 = address;
156
- },
157
- _ZNK18VM_RedefineClasses26allow_nested_vm_operationsEv: function (address) {
158
- this.redefineClassesAllow = address;
159
- },
160
- _ZNK18VM_RedefineClasses14print_on_errorEP12outputStream: function (address) {
161
- this.redefineClassesOnError = address;
162
- },
163
-
164
- // JDK >= 17
165
- _ZN13InstanceKlass33create_new_default_vtable_indicesEiP10JavaThread: function (address) {
166
- this.createNewDefaultVtableIndices = address;
167
- },
168
- // JDK < 17
169
- _ZN13InstanceKlass33create_new_default_vtable_indicesEiP6Thread: function (address) {
170
- this.createNewDefaultVtableIndices = address;
171
- },
172
-
173
- _ZN19Abstract_VM_Version19jre_release_versionEv: function (address) {
174
- const getVersion = new NativeFunction(address, 'pointer', [], nativeFunctionOptions);
175
- const versionS = getVersion().readCString();
176
- this.version = versionS.startsWith('1.8')
177
- ? 8
178
- : versionS.startsWith('9.')
179
- ? 9
180
- : parseInt(versionS.slice(0, 2), 10);
181
- this.versionS = versionS;
182
- },
183
-
184
- _ZN14NMethodSweeper11_traversalsE: function (address) {
185
- this.traversals = address;
186
- },
187
- _ZN14NMethodSweeper21_sweep_fractions_leftE: function (address) {
188
- this.fractions = address;
189
- },
190
- _ZN14NMethodSweeper13_should_sweepE: function (address) {
191
- this.shouldSweep = address;
192
- }
193
- },
194
- optionals: [
195
- '_ZN6Method24restore_unshareable_infoEP10JavaThread',
196
- '_ZN6Method24restore_unshareable_infoEP6Thread',
197
- '_ZN6Method10clear_codeEv',
198
- '_ZN6Method10clear_codeEb',
54
+ const pending = Process.platform === 'windows'
55
+ ? [{
56
+ module: vmModule.path,
57
+ functions: {
58
+ JNI_GetCreatedJavaVMs: ['JNI_GetCreatedJavaVMs', 'int', ['pointer', 'int', 'pointer']],
59
+ JVM_Sleep: ['JVM_Sleep', 'void', ['pointer', 'pointer', 'long']],
60
+ 'VMThread::execute': ['VMThread::execute', 'void', ['pointer']],
61
+ 'Method::size': ['Method::size', 'int', ['int']],
62
+ 'Method::set_native_function': ['Method::set_native_function', 'void', ['pointer', 'pointer', 'int']],
63
+ 'Method::clear_native_function': ['Method::clear_native_function', 'void', ['pointer']],
64
+ 'Method::jmethod_id': ['Method::jmethod_id', 'pointer', ['pointer']],
65
+ 'ClassLoaderDataGraph::classes_do': ['ClassLoaderDataGraph::classes_do', 'void', ['pointer']],
66
+ 'NMethodSweeper::sweep_code_cache': ['NMethodSweeper::sweep_code_cache', 'void', []],
67
+ 'OopMapCache::flush_obsolete_entries': ['OopMapCache::flush_obsolete_entries', 'void', ['pointer']]
68
+ },
69
+ variables: {
70
+ 'VM_RedefineClasses::`vftable\'': function (address) {
71
+ this.vtableRedefineClasses = address;
72
+ },
73
+ 'VM_RedefineClasses::doit': function (address) {
74
+ this.redefineClassesDoIt = address;
75
+ },
76
+ 'VM_RedefineClasses::doit_prologue': function (address) {
77
+ this.redefineClassesDoItPrologue = address;
78
+ },
79
+ 'VM_RedefineClasses::doit_epilogue': function (address) {
80
+ this.redefineClassesDoItEpilogue = address;
81
+ },
82
+ 'VM_RedefineClasses::allow_nested_vm_operations': function (address) {
83
+ this.redefineClassesAllow = address;
84
+ },
85
+ 'NMethodSweeper::_traversals': function (address) {
86
+ this.traversals = address;
87
+ },
88
+ 'NMethodSweeper::_should_sweep': function (address) {
89
+ this.shouldSweep = address;
90
+ }
91
+ },
92
+ optionals: [
93
+ ]
94
+ }]
95
+ // If platform is not Windows
96
+ : [{
97
+ module: vmModule.path,
98
+ functions: {
99
+ JNI_GetCreatedJavaVMs: ['JNI_GetCreatedJavaVMs', 'int', ['pointer', 'int', 'pointer']],
100
+
101
+ _ZN6Method4sizeEb: ['Method::size', 'int', ['int']],
102
+ _ZN6Method19set_native_functionEPhb: ['Method::set_native_function', 'void', ['pointer', 'pointer', 'int']],
103
+ _ZN6Method21clear_native_functionEv: ['Method::clear_native_function', 'void', ['pointer']],
104
+ // JDK >= 17
105
+ _ZN6Method24restore_unshareable_infoEP10JavaThread: ['Method::restore_unshareable_info', 'void', ['pointer', 'pointer']],
106
+ // JDK < 17
107
+ _ZN6Method24restore_unshareable_infoEP6Thread: ['Method::restore_unshareable_info', 'void', ['pointer', 'pointer']],
108
+ _ZN6Method10jmethod_idEv: ['Method::jmethod_id', 'pointer', ['pointer']],
109
+ _ZN6Method10clear_codeEv: function (address) {
110
+ const clearCode = new NativeFunction(address, 'void', ['pointer'], nativeFunctionOptions);
111
+ this['Method::clear_code'] = function (thisPtr) {
112
+ clearCode(thisPtr);
113
+ };
114
+ },
115
+ _ZN6Method10clear_codeEb: function (address) {
116
+ const clearCode = new NativeFunction(address, 'void', ['pointer', 'int'], nativeFunctionOptions);
117
+ const lock = 0;
118
+ this['Method::clear_code'] = function (thisPtr) {
119
+ clearCode(thisPtr, lock);
120
+ };
121
+ },
122
+
123
+ // JDK >= 13
124
+ _ZN18VM_RedefineClasses19mark_dependent_codeEP13InstanceKlass: ['VM_RedefineClasses::mark_dependent_code', 'void', ['pointer', 'pointer']],
125
+ _ZN18VM_RedefineClasses20flush_dependent_codeEv: ['VM_RedefineClasses::flush_dependent_code', 'void', []],
126
+ // JDK < 13
127
+ _ZN18VM_RedefineClasses20flush_dependent_codeEP13InstanceKlassP6Thread: ['VM_RedefineClasses::flush_dependent_code', 'void', ['pointer', 'pointer', 'pointer']],
128
+ // JDK < 10
129
+ _ZN18VM_RedefineClasses20flush_dependent_codeE19instanceKlassHandleP6Thread: ['VM_RedefineClasses::flush_dependent_code', 'void', ['pointer', 'pointer', 'pointer']],
130
+
131
+ _ZN19ResolvedMethodTable21adjust_method_entriesEPb: ['ResolvedMethodTable::adjust_method_entries', 'void', ['pointer']],
132
+ // JDK < 10
133
+ _ZN15MemberNameTable21adjust_method_entriesEP13InstanceKlassPb: ['MemberNameTable::adjust_method_entries', 'void', ['pointer', 'pointer', 'pointer']],
134
+
135
+ _ZN17ConstantPoolCache21adjust_method_entriesEPb: function (address) {
136
+ const adjustMethod = new NativeFunction(address, 'void', ['pointer', 'pointer'], nativeFunctionOptions);
137
+ this['ConstantPoolCache::adjust_method_entries'] = function (thisPtr, holderPtr, tracePtr) {
138
+ adjustMethod(thisPtr, tracePtr);
139
+ };
140
+ },
141
+ // JDK < 13
142
+ _ZN17ConstantPoolCache21adjust_method_entriesEP13InstanceKlassPb: function (address) {
143
+ const adjustMethod = new NativeFunction(address, 'void', ['pointer', 'pointer', 'pointer'], nativeFunctionOptions);
144
+ this['ConstantPoolCache::adjust_method_entries'] = function (thisPtr, holderPtr, tracePtr) {
145
+ adjustMethod(thisPtr, holderPtr, tracePtr);
146
+ };
147
+ },
148
+
149
+ _ZN20ClassLoaderDataGraph10classes_doEP12KlassClosure: ['ClassLoaderDataGraph::classes_do', 'void', ['pointer']],
150
+ _ZN20ClassLoaderDataGraph22clean_deallocate_listsEb: ['ClassLoaderDataGraph::clean_deallocate_lists', 'void', ['int']],
151
+
152
+ _ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_: ['JavaThread::thread_from_jni_environment', 'pointer', ['pointer']],
153
+
154
+ _ZN8VMThread7executeEP12VM_Operation: ['VMThread::execute', 'void', ['pointer']],
155
+
156
+ _ZN11OopMapCache22flush_obsolete_entriesEv: ['OopMapCache::flush_obsolete_entries', 'void', ['pointer']],
157
+
158
+ _ZN14NMethodSweeper11force_sweepEv: ['NMethodSweeper::force_sweep', 'void', []],
159
+ _ZN14NMethodSweeper16sweep_code_cacheEv: ['NMethodSweeper::sweep_code_cache', 'void', []],
160
+ _ZN14NMethodSweeper17sweep_in_progressEv: ['NMethodSweeper::sweep_in_progress', 'bool', []],
161
+
162
+ JVM_Sleep: ['JVM_Sleep', 'void', ['pointer', 'pointer', 'long']]
163
+ },
164
+ variables: {
165
+ // JDK <= 9
166
+ _ZN18VM_RedefineClasses14_the_class_oopE: function (address) {
167
+ this.redefineClass = address;
168
+ },
169
+ // 9 < JDK < 13
170
+ _ZN18VM_RedefineClasses10_the_classE: function (address) {
171
+ this.redefineClass = address;
172
+ },
173
+ // JDK < 13
174
+ _ZN18VM_RedefineClasses25AdjustCpoolCacheAndVtable8do_klassEP5Klass: function (address) {
175
+ this.doKlass = address;
176
+ },
177
+ // JDK >= 13
178
+ _ZN18VM_RedefineClasses22AdjustAndCleanMetadata8do_klassEP5Klass: function (address) {
179
+ this.doKlass = address;
180
+ },
181
+ _ZTV18VM_RedefineClasses: function (address) {
182
+ this.vtableRedefineClasses = address;
183
+ },
184
+ _ZN18VM_RedefineClasses4doitEv: function (address) {
185
+ this.redefineClassesDoIt = address;
186
+ },
187
+ _ZN18VM_RedefineClasses13doit_prologueEv: function (address) {
188
+ this.redefineClassesDoItPrologue = address;
189
+ },
190
+ _ZN18VM_RedefineClasses13doit_epilogueEv: function (address) {
191
+ this.redefineClassesDoItEpilogue = address;
192
+ },
193
+ _ZN18VM_RedefineClassesD0Ev: function (address) {
194
+ this.redefineClassesDispose0 = address;
195
+ },
196
+ _ZN18VM_RedefineClassesD1Ev: function (address) {
197
+ this.redefineClassesDispose1 = address;
198
+ },
199
+ _ZNK18VM_RedefineClasses26allow_nested_vm_operationsEv: function (address) {
200
+ this.redefineClassesAllow = address;
201
+ },
202
+ _ZNK18VM_RedefineClasses14print_on_errorEP12outputStream: function (address) {
203
+ this.redefineClassesOnError = address;
204
+ },
205
+
206
+ // JDK >= 17
207
+ _ZN13InstanceKlass33create_new_default_vtable_indicesEiP10JavaThread: function (address) {
208
+ this.createNewDefaultVtableIndices = address;
209
+ },
210
+ // JDK < 17
211
+ _ZN13InstanceKlass33create_new_default_vtable_indicesEiP6Thread: function (address) {
212
+ this.createNewDefaultVtableIndices = address;
213
+ },
214
+
215
+ _ZN19Abstract_VM_Version19jre_release_versionEv: function (address) {
216
+ const getVersion = new NativeFunction(address, 'pointer', [], nativeFunctionOptions);
217
+ const versionS = getVersion().readCString();
218
+ this.version = versionS.startsWith('1.8')
219
+ ? 8
220
+ : versionS.startsWith('9.')
221
+ ? 9
222
+ : parseInt(versionS.slice(0, 2), 10);
223
+ this.versionS = versionS;
224
+ },
225
+
226
+ _ZN14NMethodSweeper11_traversalsE: function (address) {
227
+ this.traversals = address;
228
+ },
229
+ _ZN14NMethodSweeper21_sweep_fractions_leftE: function (address) {
230
+ this.fractions = address;
231
+ },
232
+ _ZN14NMethodSweeper13_should_sweepE: function (address) {
233
+ this.shouldSweep = address;
234
+ }
235
+ },
236
+ optionals: [
237
+ '_ZN6Method24restore_unshareable_infoEP10JavaThread',
238
+ '_ZN6Method24restore_unshareable_infoEP6Thread',
239
+ '_ZN6Method10clear_codeEv',
240
+ '_ZN6Method10clear_codeEb',
199
241
 
200
- '_ZN18VM_RedefineClasses19mark_dependent_codeEP13InstanceKlass',
201
- '_ZN18VM_RedefineClasses20flush_dependent_codeEv',
202
- '_ZN18VM_RedefineClasses20flush_dependent_codeEP13InstanceKlassP6Thread',
203
- '_ZN18VM_RedefineClasses20flush_dependent_codeE19instanceKlassHandleP6Thread',
242
+ '_ZN18VM_RedefineClasses19mark_dependent_codeEP13InstanceKlass',
243
+ '_ZN18VM_RedefineClasses20flush_dependent_codeEv',
244
+ '_ZN18VM_RedefineClasses20flush_dependent_codeEP13InstanceKlassP6Thread',
245
+ '_ZN18VM_RedefineClasses20flush_dependent_codeE19instanceKlassHandleP6Thread',
204
246
 
205
- '_ZN19ResolvedMethodTable21adjust_method_entriesEPb',
206
- '_ZN15MemberNameTable21adjust_method_entriesEP13InstanceKlassPb',
247
+ '_ZN19ResolvedMethodTable21adjust_method_entriesEPb',
248
+ '_ZN15MemberNameTable21adjust_method_entriesEP13InstanceKlassPb',
207
249
 
208
- '_ZN17ConstantPoolCache21adjust_method_entriesEPb',
209
- '_ZN17ConstantPoolCache21adjust_method_entriesEP13InstanceKlassPb',
250
+ '_ZN17ConstantPoolCache21adjust_method_entriesEPb',
251
+ '_ZN17ConstantPoolCache21adjust_method_entriesEP13InstanceKlassPb',
210
252
 
211
- '_ZN20ClassLoaderDataGraph22clean_deallocate_listsEb',
253
+ '_ZN20ClassLoaderDataGraph22clean_deallocate_listsEb',
212
254
 
213
- '_ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_',
255
+ '_ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_',
214
256
 
215
- '_ZN14NMethodSweeper11force_sweepEv',
216
- '_ZN14NMethodSweeper17sweep_in_progressEv',
257
+ '_ZN14NMethodSweeper11force_sweepEv',
258
+ '_ZN14NMethodSweeper17sweep_in_progressEv',
217
259
 
218
- '_ZN18VM_RedefineClasses14_the_class_oopE',
219
- '_ZN18VM_RedefineClasses10_the_classE',
220
- '_ZN18VM_RedefineClasses25AdjustCpoolCacheAndVtable8do_klassEP5Klass',
221
- '_ZN18VM_RedefineClasses22AdjustAndCleanMetadata8do_klassEP5Klass',
222
- '_ZN18VM_RedefineClassesD0Ev',
223
- '_ZN18VM_RedefineClassesD1Ev',
224
- '_ZNK18VM_RedefineClasses14print_on_errorEP12outputStream',
260
+ '_ZN18VM_RedefineClasses14_the_class_oopE',
261
+ '_ZN18VM_RedefineClasses10_the_classE',
262
+ '_ZN18VM_RedefineClasses25AdjustCpoolCacheAndVtable8do_klassEP5Klass',
263
+ '_ZN18VM_RedefineClasses22AdjustAndCleanMetadata8do_klassEP5Klass',
264
+ '_ZN18VM_RedefineClassesD0Ev',
265
+ '_ZN18VM_RedefineClassesD1Ev',
266
+ '_ZNK18VM_RedefineClasses14print_on_errorEP12outputStream',
225
267
 
226
- '_ZN13InstanceKlass33create_new_default_vtable_indicesEiP10JavaThread',
227
- '_ZN13InstanceKlass33create_new_default_vtable_indicesEiP6Thread',
268
+ '_ZN13InstanceKlass33create_new_default_vtable_indicesEiP10JavaThread',
269
+ '_ZN13InstanceKlass33create_new_default_vtable_indicesEiP6Thread',
228
270
 
229
- '_ZN14NMethodSweeper21_sweep_fractions_leftE'
230
- ]
231
- }];
271
+ '_ZN14NMethodSweeper21_sweep_fractions_leftE'
272
+ ]
273
+ }];
232
274
 
233
275
  const missing = [];
234
276
 
@@ -294,10 +336,17 @@ function _getApi () {
294
336
  }
295
337
  temporaryApi.vm = vms.readPointer();
296
338
 
297
- const allocatorFunctions = {
298
- $new: ['_Znwm', 'pointer', ['ulong']],
299
- $delete: ['_ZdlPv', 'void', ['pointer']]
300
- };
339
+ const allocatorFunctions = Process.platform === 'windows'
340
+ ? {
341
+ $new: ['??2@YAPEAX_K@Z', 'pointer', ['ulong']],
342
+ $delete: ['??3@YAXPEAX@Z', 'void', ['pointer']]
343
+ }
344
+ // If platform is not Windows
345
+ : {
346
+ $new: ['_Znwm', 'pointer', ['ulong']],
347
+ $delete: ['_ZdlPv', 'void', ['pointer']]
348
+ };
349
+
301
350
  for (const [name, [rawName, retType, argTypes]] of Object.entries(allocatorFunctions)) {
302
351
  let address = Module.findExportByName(null, rawName);
303
352
  if (address === null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frida-java-bridge",
3
- "version": "6.3.5",
3
+ "version": "6.3.6",
4
4
  "description": "Java runtime interop from Frida",
5
5
  "main": "index.js",
6
6
  "files": [