Skip to main content
Glama

pwndbg_patch

Writes assembly instructions or hex bytes to a specified memory address, enabling live-patching of binaries during analysis.

Instructions

Patch an instruction at the given address with new code or bytes.

pwndbg command: patch Source: pwndbg/commands/patch.py Category: Misc

Assembles the given instruction and writes the bytes at the target address. Useful for live-patching binaries during analysis.

Args: session_id: The UUID of the session. address: Address to patch. instruction: Assembly instruction or hex bytes to write.

See: https://pwndbg.re/2025.05.30/reference/pwndbg/commands/patch/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
addressYes
instructionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions assembling and writing bytes but lacks details on side effects, permissions, error handling, or reversibility.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is relatively concise, starting with a clear one-liner and structured Args. However, it includes redundant source and link info that may not be essential for the agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers the core action and parameters but lacks explanation of return values or side effects. The output schema exists but is not described, leaving some gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite zero schema coverage, the description includes an Args section with one-liner explanations for each parameter, notably that instruction can be assembly or hex bytes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool patches an instruction at a given address with new code or bytes. It distinguishes from siblings like pwndbg_patch_list and pwndbg_patch_revert by focusing on the actual patching action.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says it's useful for live-patching binaries during analysis, implying context but no explicit when-not-to-use or alternative tools like pwndbg_asm or pwndbg_patch_revert.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Micro-Evaluation-Group/pwndbg-lldb-mcp'

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