import frida
import sys
def on_message(message, data):
print("[*] {0}".format(message['payload']))
def main(target_process):
session = frida.attach(target_process)
script = session.create_script("""
var modules = Process.enumerateModules();
var targetFunction = "PlaceArmy"; // 替换为你的方法名
var targetAddress = null;
// 遍历所有模块,查找目标方法
modules.forEach(function(module) {
var exports = Module.enumerateExports(module.name);
exports.forEach(function(exp) {
if (exp.name === targetFunction) {
targetAddress = exp.address;
console.log("Found function at address: " + targetAddress);
console.log("Module name: " + module.name);
}
});
});
if (targetAddress) {
var module = Process.findModuleByAddress(targetAddress);
if (module) {
console.log("Address belongs to module: " + module.name);
} else {
console.log("Address is not valid.");
}
} else {
console.log("Function not found.");
}
send("success");
""")
script.on('message', on_message)
script.load()
sys.stdin.read()
if __name__ == '__main__':
target_process = 'FantasyMapSimulator.exe' # 替换为目标进程的名称
main(target_process)
09-26
439
09-28
688
09-23
758