Last active
July 22, 2021 06:57
-
-
Save romainthomas/f25b0377d8f0f37601c9a223e2105f32 to your computer and use it in GitHub Desktop.
Disable Frida checks
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
# 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