frida_install_hook
Install a persistent Frida hook that collects messages via send(). Specify JS code, optional name and duration. Returns a script ID for retrieving hook events.
Instructions
Install a persistent hook that stays active and collects messages.
Requires an active session (from frida_connect).
js_code: Frida JS to run. Use send(...) to emit messages that
are collected into the hook message buffer.
name: optional label (defaults to 'hook_N').
duration_seconds: auto-unload after N seconds (0 = stay forever).
Returns a script_id; hook events can be retrieved with
frida_script_get_events or the hook-specific frida_get_hook_messages.
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": {
"js_code": "<js_code>"
},
"name": "frida_install_hook"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js_code | Yes | ||
| name | No | ||
| duration_seconds | No |