Created
October 20, 2021 13:09
-
-
Save solesensei/546cdd21e6092e140de8bdcff1bca3c3 to your computer and use it in GitHub Desktop.
This file contains 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 os | |
import sys | |
import argparse | |
def parse_hook(filename): | |
print('[*] Parsing hook: ' + filename) | |
hook = open(filename, 'r') | |
script = session.create_script(hook.read()) | |
script.load() | |
if __name__ == '__main__': | |
try: | |
parser = argparse.ArgumentParser() | |
parser.add_argument('package', help='Spawn a new process and attach') | |
parser.add_argument('script', help='Print stack trace for each hook') | |
args = parser.parse_args() | |
print('[*] Spawning ' + args.package) | |
pid = frida.get_usb_device().spawn(args.package) | |
session = frida.get_usb_device().attach(pid) | |
parse_hook(args.script) | |
frida.get_usb_device().resume(pid) | |
print('') | |
sys.stdin.read() | |
except KeyboardInterrupt: | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment