[fixed] add 通用js代码

This commit is contained in:
wangpengpeng 2023-08-04 09:40:54 +08:00
parent 4f41de4907
commit a4555f0921
6 changed files with 51 additions and 3 deletions

View File

@ -0,0 +1,48 @@
console.log("frida start into jd ...")
Java.perform(function other() {
console.log('hooking2');
var strstr = Module.findExportByName("libc.so", "strstr");
console.log("find strstr:", strstr);
Interceptor.attach(strstr, {
onEnter: function (args) {
// 判断 LIBFRIDA 字符串
if (ptr(args[1]).readCString().indexOf("LIBFRIDA") >= 0 ){
this.LIBFRIDA = true
}
if (ptr(args[1]).readCString().indexOf("frida") >= 0) {
this.frida = true
}
if (ptr(args[1]).readCString().indexOf(":5DBA") >= 0 ){
this.d8a = true
}
if (ptr(args[1]).readCString().indexOf(":69A2") >= 0 ){
this.a2 = true
}
},
onLeave: function(retval){
if (this.LIBFRIDA){
retval.replace(0x0);
}
if (this.frida){
retval.replace(0x0);
}
if (this.d8a){
retval.replace(0x0);
}
if (this.a2){
retval.replace(0x0);
}
}
})
// 打印调用堆栈
function showStack() {
let Throwable = Java.use("java.lang.Throwable");
let stackTraceString = Java.use("android.util.Log").getStackTraceString(Throwable.$new())
console.log(stackTraceString);
}
})

View File

@ -47,12 +47,12 @@ adb forward tcp:27043 tcp:27043
###### 记录
[aes 自吐算法](aes.js)
[aes 自吐算法](common_js/aes.js)
``frida -U --no-pause -f package -l aes.js``
[aes 自吐算法](自吐算法.js)
[aes 自吐算法](common_js/自吐算法.js)
``frida -U --no-pause -f package -l 自吐算法.js``
###### hook代码模板js
[hook java层代码模板](moban.js)
[hook java层代码模板](common_js/moban.js)