switch_prepare_rehook
Generate commands to restore original instructions after hooking by dumping 16 bytes at a specified offset in Nintendo Switch executables.
Instructions
Dump the original instructions at an offset (4 instructions / 16 bytes) as 'replace' commands, so you can restore them after hooking.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | Yes | Offset into main executable (hex, e.g. '0x3a5f10' or '3a5f10') |
Implementation Reference
- src/gdb_multiarch_mcp/server.py:564-566 (handler)The handler for the switch_prepare_rehook tool, which executes the command via the GDB session.
elif name == "switch_prepare_rehook": a = OffsetArgs(**arguments) result = session.execute_command(f"prepare_rehook {a.offset}") - src/gdb_multiarch_mcp/server.py:421-428 (registration)Registration of the switch_prepare_rehook tool within the MCP tool list.
Tool( name="switch_prepare_rehook", description=( "Dump the original instructions at an offset (4 instructions / 16 bytes) " "as 'replace' commands, so you can restore them after hooking." ), inputSchema=OffsetArgs.model_json_schema(), ),