Smart Patch (IDA Pro)

Smart Patch (IDA Pro) is a skill for Claude Code, Codex from buzzer-re/Rikugan. It costs 24 tokens per session (1,104 once invoked), scanned A, original, MIT.

A guide for changing compiled program instructions in IDA Pro, a tool used to inspect and edit binary files. It covers finding the target code, assembling replacement instructions, saving a backup, and verifying the patch.

In plain words
What is it for?
Use it to apply targeted natural-language patches to binary code in IDA Pro.
Why use it?
It provides a controlled process for making a small behavior change without losing the original bytes or writing an unverified patch.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/buzzer-re/rikugan/smart-patch-ida
Any agent
npx skills add buzzer-re/Rikugan --skill smart-patch-ida
Clone the repo
git clone --depth 1 https://github.com/buzzer-re/Rikugan

Made for: Claude Code, Codex.

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 Smart Patch (IDA Pro)

README.md
[![agentmods](https://agentmods.dev/badge/skills/buzzer-re/rikugan/smart-patch-ida.svg)](https://agentmods.dev/skills/buzzer-re/rikugan/smart-patch-ida)
Your own site
<a href="https://agentmods.dev/skills/buzzer-re/rikugan/smart-patch-ida"><img src="https://agentmods.dev/badge/skills/buzzer-re/rikugan/smart-patch-ida.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.01104
Opus 5 $0.00012 $0.00552
Sonnet 5 $0.00005 $0.00221
Haiku 4.5 $0.00002 $0.00110

Measured 5d ago against content hash 0988963f0ea2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

Smart Patch (IDA Pro) 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 5d 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.

rikugan/skills/builtins/smart-patch-ida/SKILL.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Task: Apply targeted binary patches in IDA Pro based on the user's natural language description. Analyze the function, identify the minimal set of instructions to change, assemble new instructions, write them, and verify the result.

Workflow

  1. Read the target function's disassembly (read_function_disassembly) and decompiled pseudocode (decompile_function) to understand its current behavior.

  2. Identify which specific instructions implement the behavior the user wants to change. Use get_instruction_info to get exact byte sizes and encodings for the target instructions.

  3. Back up the original bytes before patching. Use read_bytes at the target address for the instruction length, and print them so the user has a record:

    Original bytes at 0x{addr:x}: {hex_bytes}
    
  4. Plan the minimal patch:

    • Determine what new instruction(s) achieve the desired behavior.
    • Ensure the new instructions fit within the original byte boundaries.
    • If new instructions are shorter, the remaining bytes MUST be filled with NOPs.
    • Verify branch targets and relative offsets are correct for the patch address.
  5. Patch using execute_python with IDA's byte-patching API:

    import ida_bytes, idc
    
    # Option A: manual opcode (for simple patches like branch inversion)
    ida_bytes.patch_bytes(0xADDR, bytes([0x75]))  # JNZ instead of JZ
    
    # Option B: use keystone assembler (if installed)
    import keystone
    ks = keystone.Ks(keystone.KS_ARCH_X86, keystone.KS_MODE_64)
    encoding, _ = ks.asm("jg 0x401300", 0x401248)
    ida_bytes.patch_bytes(0x401248, bytes(encoding))
    
    # NOP padding
    remaining = original_size - len(encoding)
    if remaining > 0:
        ida_bytes.patch_bytes(0x401248 + len(encoding), bytes([0x90] * remaining))
    print(f"Patched at 0x401248")
    
  6. Verify with redecompile_function — confirm the decompiled output reflects the desired behavior change. If it doesn't match, revert by writing back the original bytes and try a different approach.

  7. Report — If called from /modify, you MUST call:

    exploration_report(category="patch_result", address=..., summary="Patched X: old → new", original_hex="...", new_hex="...", evidence="redecompile confirms...")
    
  8. Annotate each patched address with set_comment explaining what was changed and why.

Read the full file on GitHub · 99 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. 5d ago First seen · 99 lines · 24 tokens per session scan A 0988963f0ea2

Subscribe to this mod's changes

Smart Patch (IDA Pro) is a skill published in the GitHub repository buzzer-re/Rikugan (672 stars, last pushed 2mo ago), licensed MIT. It adds 24 tokens to every session and 1,104 once invoked, about $0.0001 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.

Related

Other skills, from other repositories

Reverse Engineering & Binary Analysis

Binary analysis, assembly interpretation, disassembly, decompilation, firmware RE, and protocol reverse engineering.

Masriyan/Claude-Code-CyberSecurity-Skill · 26 tokens

forgetful-files

File binary content into the knowledge base — screenshots, PDFs, diagrams, fonts, assets. Use when a binary artifact is worth keeping alongside knowledge, or when a stored procedure needs a bundled asset. The description is the entire search surface: say what the file shows and when to reach for it.

ScottRBK/forgetful · 63 tokens

ai-mobile-reverse-skills

面向授权移动安全分析的 6 阶段总控 Skill,负责 Android 静态侦察、流量与代码对齐、JNI/SO 分析、风险筛查、最小验证设计和报告交付。用户提供反编译目录、Jadx/Burp/Yakit/IDA/Ghidra 材料,或前序阶段产物时使用。.

Fausto-404/ai-mobile-reverse-skills · 89 tokens

arkana-analyze

Binary analysis skill for Arkana. Handles malware triage, reverse engineering, PE/ELF/Mach-O analysis, shellcode emulation, firmware inspection, vulnerability auditing, C2 config extraction, unpacking, deobfuscation, and threat intelligence. Triggers on: binary, malware, PE, ELF, Mach-O, shellcode, firmware, analyze…

JameZUK/Arkana · 158 tokens

arkana-learn

Interactive reverse engineering tutor using Arkana. Teaches binary analysis concepts from beginner to expert, adapting to the learner's level. Guides users through hands-on analysis or structured lessons using Arkana's 308 tools as the teaching platform. Triggers on: teach, learn, tutorial, lesson, explain, guide, how…

JameZUK/Arkana · 118 tokens

codex

Run the Codex CLI as an independent, read-only reviewer for kbupdate commits, staged changes, uncommitted changes, or selected files. Use when the user asks for a Codex review, an external second opinion, review iteration, or a final code-quality verdict.

potatoqualitee/kbupdate · 58 tokens