Created
August 22, 2020 22:42
-
-
Save buzzer-re/0a09fc86651ce47b8367f4dda4f76ae8 to your computer and use it in GitHub Desktop.
Quick and dirty frida tracer, just pass your injected script path and the process name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import frida | |
| import subprocess | |
| import sys | |
| import argparse | |
| if __name__ == '__main__': | |
| args = argparse.ArgumentParser(description="A simple scriptable frida tracer") | |
| args.add_argument("process", help="Process name to spawn!") | |
| args.add_argument("--inject-script", help="script path to inject", required=True) | |
| args = args.parse_args() | |
| process = subprocess.Popen(args.process) | |
| script_src = "" | |
| with open(args.inject_script, "r") as script_fd: | |
| script_src = script_fd.read() | |
| frida_session = frida.attach(process.pid) | |
| frida_script = frida_session.create_script(script_src) | |
| message_callback = lambda m, data: print("[on_message] message: {}, data: {}".format(m, data)) | |
| frida_script.on("message", message_callback) | |
| frida_script.load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment