Created
September 8, 2022 05:30
-
-
Save TUGOhost/9daaff96b137ea085eb54ddc874444f4 to your computer and use it in GitHub Desktop.
anti anti-frida
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
function antiAntiFrida() { | |
var strstr = Module.findExportByName(null, "strstr"); | |
if (null !== strstr) { | |
Interceptor.attach(strstr, { | |
onEnter: function (args) { | |
this.frida = Boolean(0); | |
this.haystack = args[0]; | |
this.needle = args[1]; | |
if (this.haystack.readCString() !== null && this.needle.readCString() !== null) { | |
if (this.haystack.readCString().indexOf("frida") !== -1 || | |
this.needle.readCString().indexOf("frida") !== -1 || | |
this.haystack.readCString().indexOf("gum-js-loop") !== -1 || | |
this.needle.readCString().indexOf("gum-js-loop") !== -1 || | |
this.haystack.readCString().indexOf("gmain") !== -1 || | |
this.needle.readCString().indexOf("gmain") !== -1 || | |
this.haystack.readCString().indexOf("linjector") !== -1 || | |
this.needle.readCString().indexOf("linjector") !== -1) { | |
this.frida = Boolean(1); | |
} | |
} | |
}, | |
onLeave: function (retval) { | |
if (this.frida) { | |
retval.replace(ptr("0x0")); | |
} | |
} | |
}) | |
console.log("anti anti-frida"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment