当前位置: 首页>>代码示例>>Python>>正文


Python frida.get_usb_device方法代码示例

本文整理汇总了Python中frida.get_usb_device方法的典型用法代码示例。如果您正苦于以下问题:Python frida.get_usb_device方法的具体用法?Python frida.get_usb_device怎么用?Python frida.get_usb_device使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在frida的用法示例。


在下文中一共展示了frida.get_usb_device方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _attach

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def _attach(self, packageName):
        try:
            self.device = frida.get_usb_device()
            self.pid = self.device.spawn([packageName])
            self.session = self.device.attach(self.pid)
        except Exception as e:
            self.logger.error("[ERROR]: %s" % str(e))
            self.logger.info("waiting for process")
            # self.notify()
            return None
        self.attached = True
        self.logger.info("successfully attached to app")
        return 
开发者ID:honeynet,项目名称:droidbot,代码行数:15,代码来源:monitor.py

示例2: _getDevice

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def _getDevice(self):
        try:
            self.device = frida.get_usb_device()
        except Exception as e:
            print("Device not found")
            self.device = None
        return 
开发者ID:honeynet,项目名称:droidbot,代码行数:9,代码来源:monitor.py

示例3: instrument_script

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def instrument_script():
    return """
    all_devices = frida.enumerate_devices()
    if args.serial:
        print('Serial: ', args.serial)
        device = frida.get_usb_device(args.serial)
    else:
        device = frida.get_usb_device()
    sessions = [device.attach(pid) for pid in pids]
    """ 
开发者ID:microsoft,项目名称:SARA,代码行数:12,代码来源:transform.py

示例4: frida_device

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def frida_device(self):
        version = frida.__version__.split('.')
        if len(version) == 3:
            if int(version[0]) >= 12 and int(version[1]) >= 7:
                return frida.get_usb_device(timeout=60)

        return frida.get_usb_device() 
开发者ID:iGio90,项目名称:Dwarf,代码行数:9,代码来源:android_session.py

示例5: frida_device

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def frida_device(self):
        return frida.get_usb_device() 
开发者ID:iGio90,项目名称:Dwarf,代码行数:4,代码来源:ios_session.py

示例6: bind_device

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def bind_device(self, timeout=0):
        try:
            self.frida_device = frida.get_usb_device(timeout)
            log("Found device: %s" % self.frida_device)
            self.frida_device.on('lost', FridaCli.on_device_detached)
            return True
        except:
            return False 
开发者ID:iGio90,项目名称:frick,代码行数:10,代码来源:main.py

示例7: __init__

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def __init__(self, parent=None, device='local'):
        super(DeviceWindow, self).__init__(parent=parent)

        self.spawn_list = None
        self.proc_list = None
        self.desktop_geom = None
        self._dev_bar = None

        self.setSizeGripEnabled(False)
        self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
        self.setWindowFlag(Qt.WindowContextHelpButtonHint, False)
        self.setWindowFlag(Qt.WindowCloseButtonHint, True)
        self.setModal(True)

        self.device_type = device

        try:
            if device == 'local':
                self.device = frida.get_local_device()
                self.title = 'Local Session'
            elif device == 'usb':  # TODO: change
                self.title = 'Android Session'
                self.device = None
            elif device == 'ios':
                self.title = 'iOS Session'
                self.device = frida.get_usb_device()
            elif device == 'remote':
                self.title = 'Remote Session'
                self.device = frida.get_remote_device()
            else:
                self.device = frida.get_local_device()
        except frida.TimedOutError:
            self.device = None
            print('Frida TimedOutError: No Device')

        self.updated_frida_version = ''
        self.updated_frida_assets_url = {}

        self.frida_update_thread = None
        self.devices_thread = None

        self.setup_ui() 
开发者ID:iGio90,项目名称:Dwarf,代码行数:44,代码来源:device_window.py

示例8: attach_spawn_target

# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def attach_spawn_target(args, user_script=None):
    if not args.target and not args.device:
        print('missing session type. use -t local|android|ios|remote to define the session type'
              ' or specify a device id with --device')
        exit(0)

    if args.any is None or args.any == '':
        print('missing file or package name to attach')
        exit(0)

    device = None
    try:
        if args.device:
            device = frida.get_device(id=args.device)
        else:
            session_type = args.target.lower()
            if session_type == 'local':
                device = frida.get_local_device()
            elif session_type == 'android' or session_type == 'ios':
                device = frida.get_usb_device(5)
            elif session_type == 'remote':
                device = frida.get_remote_device()
    except Exception as e:
        print('failed to get frida device')
        print(e)

    if device is not None:
        try:
            # parse target as pid
            args.pid = int(args.any)
        except ValueError:
            args.pid = 0

        if args.pid > 0:
            print('* Trying to attach to {0}'.format(args.pid))
            try:
                attach(args, device)
                print('* Dwarf attached to {0}'.format(args.pid))
            except Exception as e:  # pylint: disable=broad-except
                print('-failed-')
                print('Reason: ' + str(e))
                print('Help: you can use -sp to force spawn')
                exit(0)
        else:
            print('* Trying to spawn {0}'.format(args.any))
            try:
                _pid = spawn(args, device, user_script)
                print('* Dwarf attached to {0}'.format(_pid))
            except Exception as e:  # pylint: disable=broad-except
                print('-failed-')
                print('Reason: ' + str(e))
                exit(0)

        sys.stdin.read() 
开发者ID:iGio90,项目名称:Dwarf,代码行数:56,代码来源:glue.py


注:本文中的frida.get_usb_device方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。