renef_hook_native
Install native ARM64 hooks on library functions by offset or export symbol, with Lua on-enter/on-leave callbacks, PLT/GOT targeting, async observation, and deferred loading.
Instructions
Install a native ARM64 hook on a library function by hex offset or export symbol name.
Supports all Renef v0.4.0 native hook features:
Inline trampoline hooks (default) or PLT/GOT targeted hooks (
caller="libfoo.so"or"*")Custom Lua
on_enter(args[0..7]= x0-x7) andon_leave(retval= x0; return value overrides x0)Default argument/return logging when both
on_enterandon_leaveare omittedFire-and-forget async hooks (
asynchronous=True) for high-frequency observation-only hooksDeferred hooks: if
lib_nameis not loaded yet (e.g., underrenef_spawn(..., pause=True)), the hook is automatically installed the instant the library loads!
Args:
lib_name: Library name (e.g., "libc.so", "libnative.so")
target: Hex offset (e.g., "0x1234") or export symbol name (e.g., "open", "SSL_read")
on_enter: Optional Lua body for onEnter (args table in scope; e.g., 'print(Memory.readStr(args[0]))')
on_leave: Optional Lua body for onLeave (retval in scope; e.g., 'return 0')
caller: Optional caller library for PLT/GOT hooking (e.g., "libapp.so" or "*")
asynchronous: If True, runs onEnter off the hot path (observation-only, no onLeave)
Returns: JSON status with hook ID (or deferred flag) and details
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": {
"lib_name": "<lib_name>",
"target": "<target>"
},
"name": "renef_hook_native"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caller | No | ||
| target | Yes | ||
| lib_name | Yes | ||
| on_enter | No | ||
| on_leave | No | ||
| asynchronous | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |