diff --git a/medusa.py b/medusa.py index 01e4d9a4..720f9925 100755 --- a/medusa.py +++ b/medusa.py @@ -1066,6 +1066,7 @@ def do_run(self, line) -> None: Options: run [package name] : Initiate a Frida session and attach to the selected package + -f : Initiate a Frida session and attach to the topmost application -f [package name] : Initiate a Frida session and spawn the selected package -n [package number] : Initiate a Frida session and spawn the 3rd party package using its index returned by the 'list' command -p [pid] : Initiate a Frida session using a process id @@ -1104,6 +1105,9 @@ def do_run(self, line) -> None: pattern = r'\b\d+\b' get_pid = re.findall(pattern, option) self.run_frida(False, False, '', self.device, get_pid[0], host, port) + elif flags[0] == '-f': + pid = self.device.get_frontmost_application().pid + self.run_frida(False, False, "", self.device, pid, host, port) else: self.run_frida(False, False, line, self.device, -1, host, port)