Frida 0xA

微信截图_20250710163210

微信截图_20250710163113

基本上都是些初始化及画面设置的代码
主要就是native层的stringFromJNI

微信截图_20250710163622

仔细分析了一下

发现也没有什么和flag有关的东西

再看看左手边的函数表

发现有一个get_flag

微信截图_20250710163806

所以我们需要主动调用so文件中的get_flag并在日志中查看即可

这里需要注意的是get_flag在so文件中并非真叫get_flag

而是需要切到汇编函数中去看

微信截图_20250710165243

函数名字为_Z8get_flagii

代码如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function hookTestA(){
var funcAddr = Module.findExportByName("libfrida0xa.so","_Z8get_flagii");
//声明函数指针
if (!funcAddr) {
console.error("Function not found!");
return;
}

//NativeFunction的第一个参数是地址,第二个参数是返回值类型,第三个[]里的是传入的参数类型(有几个就填几个)
var aesAddr = new NativeFunction(funcAddr , 'uint64', ['int', 'int']);
console.log("hook");
aesAddr(1,2);

}
function main(){
Java.perform(function(){
hookTestA();
});
}
setImmediate(main);

先用

1
adb logcat

开启实时日志监控

再进行hook

微信截图_20250710165032