打算在启动的时候附加某进程 so 中的某个函数,但是老是报错:
Error: expected a pointer
at frida/runtime/core.js:502
at /script1.js:65
65 行已经执行到脚本结束了,很纳闷,然后一番查找,终于找到问题。
https://github.com/frida/frida/issues/404
由于在刚启动的时候该 so 还没有加载,于是找不到这个 so,attach 失败了,就报这个错误。
附加失败的两行代码:
var pOpenFile = Module.findExportByName("libxxx.so", "_ZN10CData8OpenFileERKSsb");
Interceptor.attach(pOpenFile, hook_OpenFile);