Skip to content

Instantly share code, notes, and snippets.

@romainthomas
Last active July 22, 2021 06:57
Show Gist options
  • Save romainthomas/f25b0377d8f0f37601c9a223e2105f32 to your computer and use it in GitHub Desktop.
Save romainthomas/f25b0377d8f0f37601c9a223e2105f32 to your computer and use it in GitHub Desktop.
Disable Frida checks
# Patch libg.so to remove Frida server checks
import lief
MOV_R0_ERROR = [0x4f, 0xf0, 0xff, 0x30] # MOV.W R0, #-1
PATCHES = [
# bind() syscall
(0x0BE000 - 2, MOV_R0_ERROR), # MOV R0, #-1
(0x0bb2e2 - 2, MOV_R0_ERROR), # MOV R0, #-1
(0x2518f6 - 2, MOV_R0_ERROR), # MOV R0, #-1
]
libg = lief.parse("./libg.so")
for patch in PATCHES:
libg.patch_address(*patch)
libg.write("./libg.patched.so")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment