How to use the frida.getUsbDevice function in frida

To help you get started, we’ve selected a few frida examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nowsecure / r2frida / src / host.js View on Github external
function resolveDevice(device) {
  console.error('[+] Using', device, 'target');
  switch (device) {
    case 'usb':
      return frida.getUsbDevice();
    case 'local':
      return frida.getLocalDevice();
    case 'tcp':
      return frida.getRemoteDevice();
      break;
  }
  return function() {
    this.then = function() {
      throw(new Error('invalid device'));
    }
  }
}
github frida / frida-presentations / ZeroNights2015 / 02-ios-crypto / app.js View on Github external
co(function *() {
  const device = yield frida.getUsbDevice();
  const pid = yield device.spawn(['com.apple.AppStore']);
  session = yield device.attach(pid);
  const source = yield load(
      require.resolve('./agent.js'));
  script = yield session.createScript(source);
  script.events.listen('message', message => {
    if (message.type === 'send' && message.payload.event === 'ready')
      device.resume(pid);
    else
      console.log(message);
  });
  yield script.load();
})
.catch(console.error);
github frida / frida-presentations / ZeroNights2015 / gating.js View on Github external
co(function *() {
  device = yield frida.getUsbDevice();

  device.events.listen('spawned', onSpawned);
  device.enableSpawnGating();

  const pending = yield device.enumeratePendingSpawns();
  pending.forEach(function (spawn, i) {
    console.log('pending[' + i + ']=', spawn, ' Resuming!');
    device.resume(spawn.pid);
  });

  console.log('ready');
})
.catch(function (error) {
github frida / frida-presentations / NLUUG2015 / 3-ios-ui / app.js View on Github external
co(function *() {
  const device = yield frida.getUsbDevice();
  const app = yield device.getFrontmostApplication();
  if (app === null)
    throw new Error("No app in foreground");
  session = yield device.attach(app.pid);
  const source = yield load(
      require.resolve('./agent.js'));
  script = yield session.createScript(source);
  script.events.listen('message', message => {
    console.log(message.payload.ui);
    session.detach();
  });
  yield script.load();
});
github frida / frida-presentations / NcN2015 / 06-android / app.js View on Github external
co(function *() {
  const device = yield frida.getUsbDevice();
  session = yield device.attach('re.frida.helloworld');
  const source = yield load(
      require.resolve('./agent.js'));
  script = yield session.createScript(source);
  script.events.listen('message', message => {
    console.log(message);
  });
  yield script.load();
});
github ChiChou / bagbak / lib / device.js View on Github external
static async usb() {
    return new Device(await frida.getUsbDevice())
  }
github chaitin / passionfruit / lib / device.js View on Github external
static async usb(...args) {
    return new ExtendedDevice(await getUsbDevice(...args))
  }
github dweinstein / node-frida-contrib / common / resolve-device.js View on Github external
module.exports = co.wrap(function* (opts) {
  opts = opts || require('../config');
  const device = opts && opts.remote ?
    yield frida.getRemoteDevice() :
    yield frida.getUsbDevice();
  debug(device);
  return device;
});

frida

Inject JavaScript to explore native apps on Windows, Mac, Linux, iOS and Android

LGPL-2.0 WITH WxWindows-excep…
Latest version published 4 days ago

Package Health Score

75 / 100
Full package analysis