Files
frida-frida-python/examples/inject_library/inject_file.py
T
Ole André Vadla Ravnås 72899a4315 Drop convenience APIs and split out tools (#142)
Most use-cases will need to use some JS API that we're not bridging, so
it's better to keep our bindings simple.

It has also become clear that our CLI tools should be split out so Frida-based
tools don't have to depend on colorama, prompt_toolkit, and pygments.
2018-07-10 20:08:56 +02:00

26 lines
575 B
Python

#
# Compile example.dylib like this:
# $ clang -shared example.c -o ~/.Trash/example.dylib
#
# Then run:
# $ python inject_file.py Twitter ~/.Trash/example.dylib
#
from __future__ import unicode_literals, print_function
import sys
import frida
def on_uninjected(id):
print("on_uninjected id=%u" % id)
(target, library_path) = sys.argv[1:]
device = frida.get_local_device()
device.on("uninjected", on_uninjected)
id = device.inject_library_file(target, library_path, "example_main", "w00t")
print("*** Injected, id=%u -- hit Ctrl+D to exit!" % id)
sys.stdin.read()