frida 遍历打印指定类下的方法

作者: wxfeng 分类: web前端 发布时间: 2021-09-22 10:27    阅读 2,871 次
import frida, sys

def on_message(message, data):
    if message['type'] == 'send':
        print("[*] {0}".format(message['payload']))
    else:
        print(message)

jscode = """
Java.perform(function () {
    Java.use('类名').class.getDeclaredMethods().forEach(function (method) {
      var methodName = method.toString();
      console.log("method name = " + methodName);
      try {
        // .. hook here
      } catch (e) { 
        console.error(methodName, e);
      }
    });
});
"""

process = frida.get_remote_device().attach('应用包名')
script = process.create_script(jscode)
script.on('message', on_message)
script.load()
sys.stdin.read()

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

发表评论

您的电子邮箱地址不会被公开。