I want to inspect X.0bB class when is loaded and get the arguments and methods name when…
- User
I want to inspect X.0bB class when is loaded and get the arguments and methods name when called using frida
Assistant
Here is some Python code using Frida to inspect the X.0bB class when it is loaded and get the arguments and methods names when called:
import frida def on_message(message, data): if message['type'] == 'send': print("[*] {}({})".format(message['payload']['method'], ", ".join(message['payload']['args']))) jscode = """ Java.perform(function () { var className = "X.0bB"; Java.use(className).$init.overload().implementation = function (...args) { send({ type: "send", method: "<init>", args: args }); return this.$init(...args); }; Java.use(className).$new.overload().implementation = function (...args) { send({ type: "send", method: "$new", args: args }); return this.$new(...args); }; for (var method in Java.use(className).prototype) { Java.use(className).prototype[method].implementation = function (...args) { send({ type: "send", method: method, args: args }); return this[method](...args); }; } }); """ process = frida.get_usb_device().attach('com.example.app') script = process.create_script(jscode) script.on('message', on_message) script.load() input()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.