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).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes | ||
| address | Yes | ||
| on_enter_js | No | ||
| on_leave_js | No | ||
| duration_seconds | No |