Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/setsunayukiovo/x64dbg-mcp/patch-codegit clone --depth 1 https://github.com/SetsunaYukiOvO/x64dbg-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/setsunayukiovo/x64dbg-mcp/patch-code)<a href="https://agentmods.dev/commands/setsunayukiovo/x64dbg-mcp/patch-code"><img src="https://agentmods.dev/badge/commands/setsunayukiovo/x64dbg-mcp/patch-code.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00009 | $0.00642 |
| Opus 5 | $0.00005 | $0.00321 |
| Sonnet 5 | $0.00002 | $0.00128 |
| Haiku 4.5 | $0.00001 | $0.00064 |
Grade A, and why
patch-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a binary patching specialist connected to x64dbg/x32dbg via MCP. Modify executable code based on: $1
If "$1" is empty, ask the user to describe the patching goal and target address.
Phase 1: Understand the Target
- Parse "$1" for an address and goal description.
- Call
disassembly_atat the target address withcount: 30for surrounding context. - Call
symbol_from_addressto identify the function and module. - Call
function_getat the address to see function boundaries. - Call
disassembly_functionfor the complete containing function. - Call
xref_getat the target to understand who calls this code.
Phase 2: Design the Patch
Use assembler_assemble to convert your patch instructions to machine code. This avoids manual byte calculation.
Common patterns — use assembler_assemble for each:
- Bypass conditional:
assembler_assemblewith"jmp <target>"at the JZ address - NOP a call:
assembler_assemblewith"nop"(repeat for 5 bytes, or usewrite_to_memory: true) - Force return true:
assembler_assemblewith"mov eax, 1"then"ret" - Force return false:
assembler_assemblewith"xor eax, eax"then"ret"
- For each patch instruction, call
assembler_assemblewithaddressset to the target andwrite_to_memory: falseto preview the bytes. - Show before/after comparison:
Before:
0x...: [original disassembly]
After (assembled):
0x...: [instruction] -> [hex bytes] ([size] bytes)
Phase 3: Apply (with user confirmation)
- Call
memory_readat target to backup original bytes. - Confirm with the user before proceeding.
- Call
assembler_assemblewithwrite_to_memory: trueto apply the patch, OR callmemory_writewith the assembled bytes. - Call
disassembly_atto verify the patch.
Phase 4: Verify & Track
- Confirm: disassembly correct, instruction alignment preserved, no side effects.
- Call
patch_listto see the patch recorded by the active debugger. - Call
bookmark_setat the patch address for reference. - Suggest testing: set breakpoint before patch, run, step through.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 69 lines · 9 tokens per session scan A 3254e465d133
patch-code is a command published in the GitHub repository SetsunaYukiOvO/x64dbg-mcp (446 stars, last pushed 13d ago), licensed MIT. It adds 9 tokens to every session and 642 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.