mirror of
https://github.com/ppwang06/frida_js.git
synced 2026-06-05 21:07:18 +08:00
[fixed] add 通用js代码
This commit is contained in:
parent
4f41de4907
commit
a4555f0921
48
apps/common_js/over_frida.js
Normal file
48
apps/common_js/over_frida.js
Normal 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);
|
||||
}
|
||||
})
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user