t0thkr1s / frida

Frida scripts for mobile application dynamic-analysis.
https://medium.com/infosec-adventures
GNU General Public License v3.0
104 stars 31 forks source link

ServerNotRunningError exception, when the Frida server is not running #4

Closed t0thkr1s closed 4 years ago

t0thkr1s commented 4 years ago

The scripts crash, when the Frida server is not running on the target device. The script should quit gracefully and handle the exception.

Here's the traceback:

Traceback (most recent call last): File "log_keys.py", line 32, in process = frida.get_usb_device().attach(package_name) File "/home/t0thkr1s/.local/lib/python3.8/site-packages/frida/core.py", line 26, in wrapper return f(*args, *kwargs) File "/home/t0thkr1s/.local/lib/python3.8/site-packages/frida/core.py", line 156, in attach return Session(self._impl.attach(self._pid_of(target))) File "/home/t0thkr1s/.local/lib/python3.8/site-packages/frida/core.py", line 180, in _pid_of return self.get_process(target).pid File "/home/t0thkr1s/.local/lib/python3.8/site-packages/frida/core.py", line 26, in wrapper return f(args, **kwargs) File "/home/t0thkr1s/.local/lib/python3.8/site-packages/frida/core.py", line 106, in get_process matching = [process for process in self._impl.enumerate_processes() if fnmatch.fnmatchcase(process.name.lower(), process_name_lc)] frida.ServerNotRunningError: unable to connect to remote frida-server: closed

t0thkr1s commented 4 years ago

Now, all the scripts handle exceptions and more verbose output has been added.