frida_hook_native_function
Hook a native function by memory address to inspect arguments and return value using custom JavaScript, with adjustable duration.
Instructions
Hook a native function by address using Interceptor.attach.
target: process name or pid (string).
address: hex address of the function to hook.
on_enter_js: custom JS for onEnter(args) body. Has args, this.context,
send(). Leave None for a default that logs arg0-arg2.
on_leave_js: custom JS for onLeave(retval) body. Has retval,
this.context, send(). Leave None for a default that logs retval.
duration_seconds: how long to keep the hook active (default 10).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"target": "<target>",
"address": "<address>"
},
"name": "frida_hook_native_function"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| address | Yes | ||
| on_enter_js | No | ||
| on_leave_js | No | ||
| duration_seconds | No |