1import frida
2
3def on_message(message, data):
4 print("[on_message] message:", message, "data:", data)
5
6session = frida.attach("cat")
7
8script = session.create_script("""
9rpc.exports.enumerateModules = function () {
10 return Process.enumerateModules();
11};
12""")
13script.on("message", on_message)
14script.load()
15
16print([m["name"] for m in script.exports.enumerate_modules()])