mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
72899a4315
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.
26 lines
575 B
Python
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()
|