patch-code

patch-code is a command for Claude Code from SetsunaYukiOvO/x64dbg-mcp. It costs 9 tokens per session (642 once invoked), scanned A, original, MIT.

A guided tool for changing machine code inside Windows executable files through x64dbg or x32dbg, with backups and checks.

In plain words
What is it for?
Use it to bypass conditions, disable calls, or force a function to return true or false. It can assemble instructions into machine code and write them to the target program.
Why use it?
It helps avoid guessing raw bytes and reduces the risk of making an executable unusable. It first examines the surrounding code and its connections before applying a patch.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Part of the x64dbg-re plugin — 1 skill, 11 commands shipped together

Good fit Use it to bypass conditions, disable calls, or force a function to return true or false. It can assemble instructions into machine code and write them to the target program.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/setsunayukiovo/x64dbg-mcp/patch-code
Install

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.

Clone the repo
git clone --depth 1 https://github.com/SetsunaYukiOvO/x64dbg-mcp

Made for: Claude Code.

Or install x64dbg-re, the plugin that ships this one along with the rest of its 1 skill, 11 commands.

Wrote 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.

agentmods badge for patch-code

README.md
[![agentmods](https://agentmods.dev/badge/commands/setsunayukiovo/x64dbg-mcp/patch-code/github.svg)](https://agentmods.dev/commands/setsunayukiovo/x64dbg-mcp/patch-code)
Your own site
<a href="https://agentmods.dev/commands/setsunayukiovo/x64dbg-mcp/patch-code"><img src="https://agentmods.dev/badge/commands/setsunayukiovo/x64dbg-mcp/patch-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for patch-code

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 642 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00009 $0.00642
Opus 5.5 $0.00004 $0.00257
Sonnet 5.5 $0.00002 $0.00128
Haiku 4.5 $0.00001 $0.00064

Measured 2mo ago against content hash 3254e465d133, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

skills/commands/patch-code.md · 69 lines

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

  1. Parse "$1" for an address and goal description.
  2. Call disassembly_at at the target address with count: 30 for surrounding context.
  3. Call symbol_from_address to identify the function and module.
  4. Call function_get at the address to see function boundaries.
  5. Call disassembly_function for the complete containing function.
  6. Call xref_get at 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_assemble with "jmp <target>" at the JZ address
  • NOP a call: assembler_assemble with "nop" (repeat for 5 bytes, or use write_to_memory: true)
  • Force return true: assembler_assemble with "mov eax, 1" then "ret"
  • Force return false: assembler_assemble with "xor eax, eax" then "ret"
  1. For each patch instruction, call assembler_assemble with address set to the target and write_to_memory: false to preview the bytes.
  2. Show before/after comparison:
Before:
  0x...: [original disassembly]

After (assembled):
  0x...: [instruction] -> [hex bytes] ([size] bytes)

Phase 3: Apply (with user confirmation)

  1. Call memory_read at target to backup original bytes.
  2. Confirm with the user before proceeding.
  3. Call assembler_assemble with write_to_memory: true to apply the patch, OR call memory_write with the assembled bytes.
  4. Call disassembly_at to verify the patch.

Phase 4: Verify & Track

  1. Confirm: disassembly correct, instruction alignment preserved, no side effects.
  2. Call patch_list to see the patch recorded by the active debugger.
  3. Call bookmark_set at the patch address for reference.
  4. Suggest testing: set breakpoint before patch, run, step through.

Read the full file on GitHub · 69 lines

Changes

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.

  1. 2mo ago First seen · 69 lines · 9 tokens per session scan A 3254e465d133

Subscribe to this mod's changes

patch-code is a command published in the GitHub repository SetsunaYukiOvO/x64dbg-mcp (554 stars, last pushed 9d ago), licensed MIT. It adds 9 tokens to every session and 642 once invoked, about $0.0000 per session on Opus 5.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.

Related

patch-code compared with commands from other repositories

patch-code next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
patch-codeSetsunaYukiOvO/x64dbg-mcpCommand5549d agoMITA9Claude Code
qa-changesOpenHands/extensionsCommand176yesterdayMITA63Claude Code
react-nativegetsentry/toolkitCommand957yesterdaynoneA0Claude Code
auditar-cascadingluanpdd/kit-mcpCommand54d agoMITA54Claude Code
http-serviceMadAppGang/magusCommand14yesterdayMITA27Claude Code
doctordoncheli/don-cheli-sddCommand592mo agoApache-2.0A76Claude Code
doctorfatihkan/badiCommand71mo agoMITA0Claude Code