def get_usb_device(self): subprocess.check_call("adb root", shell=True) self._kill_all() for server in glob.glob(f"{self.__bin_dir}/*"): server = self._push_tmp_file(server) self._chmod_file(server, 777) self._run_as_daemon(server) if self.can_comunicate_with_server(): device = frida.get_usb_device() logger.done( f"we are able to communicate with server at {server}, device: {device}" ) return device self._kill_all() logger.error(f"unable to find suitable server for this target") return None
def debugger_detach(package): if dbg.detach(): logger.done(f"detached debugger from package={package}") return jsonify({"detached": True}) return jsonify({"detached": False})
def debugger_attach(package): if dbg.attach(package): logger.done(f"attached debugger to package={package}") return jsonify({"attached": True}) return jsonify({"attached": False})
def debugger_spawn(package): if dbg.spawn(package): logger.done(f"spawned package={package}") return jsonify({"spawned": True}) logger.info(f"unable to spawn package={package}") return jsonify({"spawned": False})