Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added -F to attach to topmost application for convenience #90

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions medusa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down