frida hook 安卓app 报错请求帮忙
本帖最后由 两只小蜜蜂 于 2023-9-12 21:36 编辑小白一枚,需要逆向一个app接口的加密参数,在使用frida时报了这个错,因为我这个方法名就叫a,即便用jadx反混淆之后,依旧是一串字母和数字的组合,所以我想是不是因为app混淆了方法名,所以才报这个错的,那么如果是这个原因要怎么解决呢,求大佬指路
报错如下:{'type': 'error', 'description': "TypeError: cannot set property 'implementation' of undefined", 'stack': "TypeError: cannot set property 'implementation' of undefined\n at <anonymous> (/script1.js:5)\n at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:12)\n at _performPendingVmOps (frida/node_modules/frida-java-bridge/index.js:250)\n at <anonymous> (frida/node_modules/frida-java-bridge/index.js:225)\n at <anonymous> (frida/node_modules/frida-java-bridge/lib/vm.js:12)\n at _performPendingVmOpsWhenReady (frida/node_modules/frida-java-bridge/index.js:244)\n at perform (frida/node_modules/frida-java-bridge/index.js:204)\n at <eval> (/script1.js:6)", 'fileName': '/script1.js', 'lineNumber': 5, 'columnNumber': 1}
python代码如下:
import frida
import pprint
import sys
mw_shl_code=python,true]def on_message(message,data):
print(message)
session = frida.get_remote_device().attach('网易BUFF')
with open("./frida.js") as f:
script = session.create_script(f.read())
script.on('message',on_message)
script.load()
sys.stdin.read()
js代码如下:
Java.perform(function (){
Java.use('com.netease.buff.core.network.ApiCrypt').a.getSmscode.implementation = function(s){
console.log(s)
return this.a(s);
}
});
你a的屁股后面还跟着getSmscode? laos 发表于 2023-9-12 21:41
你a的屁股后面还跟着getSmscode?
看b站视频上是这么写的,请大佬赐教,要怎么写才对 laos 发表于 2023-9-12 21:41
你a的屁股后面还跟着getSmscode?
真是这个方法的问题,我删了这个方法,就hook到了 ,谢谢大佬 import frida
import sys
def on_message(message, data):
print(message)
# 要附加到的应用程序的名称
app_name = '网易BUFF'
# 读取Frida脚本文件
with open('./frida.js') as f:
script_code = f.read()
# 附加到目标应用程序
session = frida.get_remote_device().attach(app_name)
# 创建并加载Frida脚本
script = session.create_script(script_code)
script.on('message', on_message)
script.load()
# 保持脚本运行
sys.stdin.read()
页:
[1]