Last active
February 25, 2024 09:37
-
-
Save romainthomas/a191f0221801fc6939b12a02fb70a2d6 to your computer and use it in GitHub Desktop.
frida_inject.py
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 | |
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