#类.重载方法.重载方法.overload() @无参重载则不填,有参则需要填写
utils.test.overload()
无参重载
import frida, sys
# """标识多行字符串
# @包名+类名
jscode = """
Java.perform(function () {
var utils = Java.use('com.xiaojianbang.app.Utils');
utils.test.overload().implementation = function (a, b) {
console.log("Hook Start...");
send(arguments[0]);
send(b);
send("Success!");
return this.$init(10000,"英镑");
}
});
"""
def message(message, data):
if message["type"] == "send":
print("[*]{0}".format(message['payload']))
else:
print(message)
# @创建进程 @连接远程设备 @符加进程 @包名
process = frida.get_remote_device().attach("com.ss.android.ugc.aweme")
script = process.create_script(jscode)
# 绑定事件
script.on("message", message)
script.load()
sys.stdin.read()
有参重载
注意:overload("int")必须加上参数类型,并且为字符,需要加上引号
import frida, sys
# """标识多行字符串
# @包名+类名
jscode = """
Java.perform(function () {
var utils = Java.use('com.xiaojianbang.app.Utils');
utils.test.overload("int").implementation = function (a) {
console.log("Hook Start...");
send(arguments[0]);
send("Success!");
return this.$init(10000,"英镑");
}
});
"""
def message(message, data):
if message["type"] == "send":
print("[*]{0}".format(message['payload']))
else:
print(message)
# @创建进程 @连接远程设备 @符加进程 @包名
process = frida.get_remote_device().attach("com.ss.android.ugc.aweme")
script = process.create_script(jscode)
# 绑定事件
script.on("message", message)
script.load()
sys.stdin.read()
注意
-
如果第二个参数是
int
则:utils.test.overload("int","int").implementation = function (a) { console.log("Hook Start..."); send(arguments[0]); send("Success!"); return this.test(100008776); }
-
如果第二个参数是
String
,则:"java.lang.String"
而不是"String"
utils.test.overload("int","java.lang.String").implementation = function (a) { console.log("Hook Start..."); send(arguments[0]); send("Success!"); return this.test(100008776); }