Skip to main content
Glama
sbergeron42

gdb-multiarch-mcp

by sbergeron42

switch_replace

Replace instructions at specific offsets in Nintendo Switch executables to modify code behavior during debugging with gdb-multiarch.

Instructions

Replace the instruction at an offset from main with a new instruction. Offset and instruction are both hex values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetYesOffset into main executable (hex)
instructionYesNew instruction as a 32-bit hex value (e.g. '0xD503201F')

Implementation Reference

  • The handler logic for the switch_replace tool, which uses ReplaceArgs to execute the 'replace' command on the session.
    elif name == "switch_replace":
        a = ReplaceArgs(**arguments)
        result = session.execute_command(f"replace {a.offset} {a.instruction}")
  • Registration of the 'switch_replace' tool definition in the server.
    Tool(
        name="switch_replace",
        description=(
            "Replace the instruction at an offset from main with a new instruction. "
            "Offset and instruction are both hex values."
        ),
        inputSchema=ReplaceArgs.model_json_schema(),
    ),
  • Input schema definition for the switch_replace tool.
    class ReplaceArgs(BaseModel):
        offset: str = Field(..., description="Offset into main executable (hex)")
        instruction: str = Field(
            ...,
            description="New instruction as a 32-bit hex value (e.g. '0xD503201F')",
        )

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