linux怎么执⾏frida脚本,Frida使⽤和Hook代码整理[Python] 纯⽂本查看 复制代码#coding=utf-8
import frida
import sys
session = _remote_device().attach("ample.hooktest")
#umerate_modules()
jscode = """
Java.perform(function(){
send("Running Script");
var getString = undefined;
exports = umerateExportsSync("libtest.so");
for(i=0; i
if(exports.name == "Java_com_example_hooktest_MainActivity_getString"){
getString = exports.address;
send("getInt is at " + getString);
break;
}
}
var getInt = undefined;
exports = umerateExportsSync("libtest.so");
session怎么记忆for(i=0; i
if(exports.name == "getInt"){
getInt = exports.address;
send("getInt is at " + getInt);
break;
}
}
var fungetInt = new NativeFunction(getInt, 'int', ['int']);
Interceptor.attach(getString,{
onEnter: function (args) {
send("onEnter");
var res = fungetInt(99999);
send(res);
},
onLeave: function (retval) {
send("onLeave");
}
});
});
"""
def on_message(message, data):
print message
script = ate_script(jscode) ('message', on_message) script.load()
ad()
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论