Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

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
NameRequiredDescriptionDefault
offsetYesOffset into main executable (hex, e.g. '0x3a5f10' or '3a5f10')

Implementation Reference

  • 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}")
  • 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(),
    ),

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbergeron42/gdb-multiarch-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server