本文整理汇总了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
示例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
示例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]
"""
示例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()
示例5: frida_device
# 需要导入模块: import frida [as 别名]
# 或者: from frida import get_usb_device [as 别名]
def frida_device(self):
return frida.get_usb_device()
示例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
示例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()
示例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()