From b17a838da9f4c06eff70fbf23e82d5314177d467 Mon Sep 17 00:00:00 2001 From: Jeroen Beckers Date: Fri, 27 May 2016 17:20:45 +0200 Subject: [PATCH] Add ability to not pause at startup (#82) --- src/frida/application.py | 4 ++++ src/frida/repl.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/frida/application.py b/src/frida/application.py index 2e34252..9033e53 100644 --- a/src/frida/application.py +++ b/src/frida/application.py @@ -88,6 +88,9 @@ class ConsoleApplication(object): action='store_true', dest="enable_debugger", default=False) parser.add_option("--disable-jit", help="disable JIT", action='store_true', dest="disable_jit", default=False) + parser.add_option("--no-pause", help="automatically start main thread after startup", + action='store_true', dest="no_pause", default=False) + self._add_options(parser) (options, args) = parser.parse_args() @@ -100,6 +103,7 @@ class ConsoleApplication(object): self._device_type = options.device_type self._host = options.host self._device = None + self._no_pause = options.no_pause self._schedule_on_output = lambda pid, fd, data: self._reactor.schedule(lambda: self._on_output(pid, fd, data)) self._schedule_on_device_lost = lambda: self._reactor.schedule(self._on_device_lost) self._spawned_pid = None diff --git a/src/frida/repl.py b/src/frida/repl.py index 1e93db5..77e4eeb 100644 --- a/src/frida/repl.py +++ b/src/frida/repl.py @@ -56,7 +56,11 @@ def main(): return if self._spawned_argv is not None: - self._update_status("Spawned `{command}`. Use %resume to let the main thread start executing!".format(command=" ".join(self._spawned_argv))) + if self._no_pause: + self._update_status("Spawned `{command}`. Resuming main thread!".format(command=" ".join(self._spawned_argv))) + self._do_magic("resume") + else: + self._update_status("Spawned `{command}`. Use %resume to let the main thread start executing!".format(command=" ".join(self._spawned_argv))) else: self._clear_status() self._ready.set()