frida-java-bridge 7.0.0 → 7.0.2
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.
- package/index.js +2 -2
- package/lib/android.js +10 -5
- package/lib/class-model.js +1 -1
- package/lib/jvm.js +6 -7
- package/lib/mkdex.js +0 -1
- package/package.json +5 -1
package/index.js
CHANGED
|
@@ -334,7 +334,7 @@ class Runtime {
|
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
if (this._pollListener === null) {
|
|
337
|
-
this._pollListener = Interceptor.attach(
|
|
337
|
+
this._pollListener = Interceptor.attach(Process.getModuleByName('libc.so').getExportByName('epoll_wait'), this._makePollHook());
|
|
338
338
|
Interceptor.flush();
|
|
339
339
|
}
|
|
340
340
|
|
|
@@ -539,7 +539,7 @@ class Runtime {
|
|
|
539
539
|
return result;
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
-
const readlink = new NativeFunction(Module.
|
|
542
|
+
const readlink = new NativeFunction(Module.getGlobalExportByName('readlink'), 'pointer', ['pointer', 'pointer', 'pointer'], {
|
|
543
543
|
exceptions: 'propagate'
|
|
544
544
|
});
|
|
545
545
|
|
package/lib/android.js
CHANGED
|
@@ -1271,7 +1271,11 @@ const PROP_VALUE_MAX = 92;
|
|
|
1271
1271
|
|
|
1272
1272
|
function getAndroidSystemProperty (name) {
|
|
1273
1273
|
if (systemPropertyGet === null) {
|
|
1274
|
-
systemPropertyGet = new NativeFunction(
|
|
1274
|
+
systemPropertyGet = new NativeFunction(
|
|
1275
|
+
Process.getModuleByName('libc.so').getExportByName('__system_property_get'),
|
|
1276
|
+
'int',
|
|
1277
|
+
['pointer', 'pointer'],
|
|
1278
|
+
nativeFunctionOptions);
|
|
1275
1279
|
}
|
|
1276
1280
|
const buf = Memory.alloc(PROP_VALUE_MAX);
|
|
1277
1281
|
systemPropertyGet(Memory.allocUtf8String(name), buf);
|
|
@@ -2792,7 +2796,7 @@ std_string_get_data (StdString * str)
|
|
|
2792
2796
|
translate_location: api['art::Monitor::TranslateLocation'],
|
|
2793
2797
|
get_class_location: api['art::mirror::Class::GetLocation'],
|
|
2794
2798
|
cxx_delete: api.$delete,
|
|
2795
|
-
strtoul:
|
|
2799
|
+
strtoul: Process.getModuleByName('libc.so').getExportByName('strtoul')
|
|
2796
2800
|
});
|
|
2797
2801
|
|
|
2798
2802
|
const _create = new NativeFunction(cm._create, 'pointer', ['pointer', 'uint'], nativeFunctionOptions);
|
|
@@ -3748,8 +3752,9 @@ class JdwpSession {
|
|
|
3748
3752
|
* We partially stub out the ADB JDWP transport to ensure we always
|
|
3749
3753
|
* succeed in starting JDWP. Failure will crash the process.
|
|
3750
3754
|
*/
|
|
3751
|
-
const
|
|
3752
|
-
const
|
|
3755
|
+
const libart = Process.getModuleByName('libart.so');
|
|
3756
|
+
const acceptImpl = libart.getExportByName('_ZN3art4JDWP12JdwpAdbState6AcceptEv');
|
|
3757
|
+
const receiveClientFdImpl = libart.getExportByName('_ZN3art4JDWP12JdwpAdbState15ReceiveClientFdEv');
|
|
3753
3758
|
|
|
3754
3759
|
const controlPair = makeSocketPair();
|
|
3755
3760
|
const clientPair = makeSocketPair();
|
|
@@ -3836,7 +3841,7 @@ function makeJdwpOptions () {
|
|
|
3836
3841
|
function makeSocketPair () {
|
|
3837
3842
|
if (socketpair === null) {
|
|
3838
3843
|
socketpair = new NativeFunction(
|
|
3839
|
-
|
|
3844
|
+
Process.getModuleByName('libc.so').getExportByName('socketpair'),
|
|
3840
3845
|
'int',
|
|
3841
3846
|
['int', 'int', 'int', 'pointer']);
|
|
3842
3847
|
}
|
package/lib/class-model.js
CHANGED
|
@@ -1320,7 +1320,7 @@ function compileModule (env) {
|
|
|
1320
1320
|
api['art::ClassLinker::VisitClasses'],
|
|
1321
1321
|
api['art::mirror::Class::GetDescriptor'],
|
|
1322
1322
|
api['art::ArtMethod::PrettyMethod'],
|
|
1323
|
-
|
|
1323
|
+
Process.getModuleByName('libc.so').getExportByName('free')
|
|
1324
1324
|
]
|
|
1325
1325
|
.forEach((value, i) => {
|
|
1326
1326
|
if (value === undefined) {
|
package/lib/jvm.js
CHANGED
|
@@ -53,7 +53,7 @@ function _getApi () {
|
|
|
53
53
|
|
|
54
54
|
const pending = Process.platform === 'windows'
|
|
55
55
|
? [{
|
|
56
|
-
module: vmModule
|
|
56
|
+
module: vmModule,
|
|
57
57
|
functions: {
|
|
58
58
|
JNI_GetCreatedJavaVMs: ['JNI_GetCreatedJavaVMs', 'int', ['pointer', 'int', 'pointer']],
|
|
59
59
|
JVM_Sleep: ['JVM_Sleep', 'void', ['pointer', 'pointer', 'long']],
|
|
@@ -94,7 +94,7 @@ function _getApi () {
|
|
|
94
94
|
}]
|
|
95
95
|
// If platform is not Windows
|
|
96
96
|
: [{
|
|
97
|
-
module: vmModule
|
|
97
|
+
module: vmModule,
|
|
98
98
|
functions: {
|
|
99
99
|
JNI_GetCreatedJavaVMs: ['JNI_GetCreatedJavaVMs', 'int', ['pointer', 'int', 'pointer']],
|
|
100
100
|
|
|
@@ -277,19 +277,18 @@ function _getApi () {
|
|
|
277
277
|
const missing = [];
|
|
278
278
|
|
|
279
279
|
pending.forEach(function (api) {
|
|
280
|
+
const module = api.module;
|
|
280
281
|
const functions = api.functions || {};
|
|
281
282
|
const variables = api.variables || {};
|
|
282
283
|
const optionals = new Set(api.optionals || []);
|
|
283
284
|
|
|
284
|
-
const tmp =
|
|
285
|
-
.enumerateExports(api.module)
|
|
285
|
+
const tmp = module.enumerateExports()
|
|
286
286
|
.reduce(function (result, exp) {
|
|
287
287
|
result[exp.name] = exp;
|
|
288
288
|
return result;
|
|
289
289
|
}, {});
|
|
290
290
|
|
|
291
|
-
const exportByName =
|
|
292
|
-
.enumerateSymbols(api.module)
|
|
291
|
+
const exportByName = module.enumerateSymbols()
|
|
293
292
|
.reduce(function (result, exp) {
|
|
294
293
|
result[exp.name] = exp;
|
|
295
294
|
return result;
|
|
@@ -350,7 +349,7 @@ function _getApi () {
|
|
|
350
349
|
};
|
|
351
350
|
|
|
352
351
|
for (const [name, [rawName, retType, argTypes]] of Object.entries(allocatorFunctions)) {
|
|
353
|
-
let address = Module.
|
|
352
|
+
let address = Module.findGlobalExportByName(rawName);
|
|
354
353
|
if (address === null) {
|
|
355
354
|
address = DebugSymbol.fromName(rawName).address;
|
|
356
355
|
if (address.isNull()) {
|
package/lib/mkdex.js
CHANGED
package/package.json
CHANGED