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 CHANGED
@@ -334,7 +334,7 @@ class Runtime {
334
334
  }
335
335
 
336
336
  if (this._pollListener === null) {
337
- this._pollListener = Interceptor.attach(Module.getExportByName('libc.so', 'epoll_wait'), this._makePollHook());
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.getExportByName(null, 'readlink'), 'pointer', ['pointer', 'pointer', 'pointer'], {
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(Module.getExportByName('libc.so', '__system_property_get'), 'int', ['pointer', 'pointer'], nativeFunctionOptions);
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: Module.getExportByName('libc.so', '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 acceptImpl = Module.getExportByName('libart.so', '_ZN3art4JDWP12JdwpAdbState6AcceptEv');
3752
- const receiveClientFdImpl = Module.getExportByName('libart.so', '_ZN3art4JDWP12JdwpAdbState15ReceiveClientFdEv');
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
- Module.getExportByName('libc.so', 'socketpair'),
3844
+ Process.getModuleByName('libc.so').getExportByName('socketpair'),
3840
3845
  'int',
3841
3846
  ['int', 'int', 'int', 'pointer']);
3842
3847
  }
@@ -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
- Module.getExportByName('libc.so', 'free')
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.path,
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.path,
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 = Module
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 = Module
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.findExportByName(null, rawName);
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
@@ -1,4 +1,3 @@
1
- // import SHA1 from 'jssha/dist/sha1';
2
1
  import { Buffer } from 'buffer';
3
2
 
4
3
  const kAccPublic = 0x0001;
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "frida-java-bridge",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "Java runtime interop from Frida",
5
+ "keywords": [
6
+ "frida-gum",
7
+ "frida-gum-bridge"
8
+ ],
5
9
  "type": "module",
6
10
  "main": "index.js",
7
11
  "files": [