Skip to content

Instantly share code, notes, and snippets.

@romainthomas
Last active February 25, 2024 09:37
Show Gist options
  • Save romainthomas/a191f0221801fc6939b12a02fb70a2d6 to your computer and use it in GitHub Desktop.
Save romainthomas/a191f0221801fc6939b12a02fb70a2d6 to your computer and use it in GitHub Desktop.
frida_inject.py
import frida
DEVICE = frida.get_usb_device()
def inject_spawn(package, library):
pid = DEVICE.spawn([package])
print(f"{package}:{pid:d}")
with open(library, "rb") as library_file:
library_blob = library_file.read()
DEVICE.inject_library_blob(pid, library_blob, "__my_init_func", "")
DEVICE.resume(pid)
inject_spawn("com.example", "/tmp/libgadget.so") # or a custom library based on Frida SDK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment