Skip to content

Guide · Agent skill

How to use the patch-diff-exploit agent skill (N-day diffing)

Updated · written with AI from the project's own documentation and checked against our catalogue data

patch-diff-exploit is an agent skill that teaches an AI agent how to study a software update. You give it the before and after versions of a binary, such as a Windows or Linux patch, and it guides the agent through a function-level diff to work out which bug the patch fixed and how to write a proof-of-concept for the unpatched version. This guide explains what an agent skill is, how to install this one, how to trigger it with plain requests, and what it needs and risks before you run it.

N-day Patch Diff Exploitzhaoxuya520/reverse-skill · MIT

Quick start

  1. 1Download the skill ZIP. Get the patch-diff-exploit ZIP from this page.
  2. 2Install it. Unzip into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder, or upload the ZIP under Settings, Capabilities, Skills in the Claude apps.
  3. 3Install the diff tools. Install ghidriff with pip and set up IDA Pro or Ghidra and BinDiff or Diaphora, or let the bootstrap section do it after you review its script.
  4. 4Collect before and after binaries. Download the unpatched and patched update packages from Microsoft Update Catalog or your distribution's archive and unpack them.
  5. 5Ask for the diff. Use a trigger keyword such as patch diff or N-day with the component name and your authorization statement.
  6. 6Review the changed functions. Check functions with mid-range match scores for newly added bounds checks, locks, or overflow checks, and confirm the pattern on the code.
  7. 7Verify the PoC. Confirm the PoC crashes the unpatched build and runs cleanly on the patched build before concluding.

What is an agent skill and what does this one do?

An agent skill is a folder of instructions and reference files that an AI agent loads when a task matches the skill's description. This one is defined by a SKILL.md file plus three reference documents: diff-tools-comparison.md, patch-tuesday-workflow.md and root-cause-and-poc.md.

The skill covers the N-day workflow: get the before and after binaries, align symbols, run a binary diff with BinDiff, ghidriff or Diaphora, focus on functions with a middling match score (about 0.5 to 0.95), and infer the bug class from newly added checks such as bounds checks, locks, or overflow checks. It then guides the agent to write a PoC and confirm it crashes the unpatched build but not the patched one.

Install the patch-diff-exploit skill

Download the skill ZIP from this page. To make it available to Claude Code for your user account, unzip it into ~/.claude/skills/. To limit it to one project, unzip it into that project's .claude/skills/ folder instead.

If you use the Claude apps, upload the ZIP under Settings, then Capabilities, then Skills.

The skill's files are expected to sit in a folder named patch-diff-exploit, with SKILL.md at its root and the references folder beside it.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project
  • Claude apps: Settings, then Capabilities, then Skills, then upload the ZIP

Install the tools the skill needs

The skill expects a diff engine and a disassembler. BinDiff needs IDA Pro or Ghidra as its host. ghidriff runs on Ghidra in headless mode and can be installed with pip. Diaphora is an IDA plugin and needs IDA Pro. IDA Pro is commercial; the others are listed as free or open source in the skill's comparison table.

The skill includes a bootstrap section for installing missing tools. Its PowerShell script runs with the command below. Read the script before running it, because it runs code on your machine and can start services.

  • Needed for Windows binaries: expand.exe or dism to unpack MSU/CAB files, and symchk from the Windows SDK for PDB symbols
  • Needed for Linux binaries: dpkg-deb and rpm2cpio to unpack packages
  • Optional: debugging symbols (PDB or dbgsym) where available
pip install ghidriff

Trigger the skill with natural requests

The skill's description lists trigger keywords in both Chinese and English, including N-day, Nday, patch diff, patch tuesday, 1day, binary diff, bindiff, ghidriff, Diaphora, and CVE reproduction. Mention one of these along with the CVE or the patch in your request so the agent loads the skill.

Give the agent the target and the material. A request that names the component, the before and after builds, and your authorization will get a more useful run than a bare keyword.

  • Reproduce CVE-XXXX-XXXXX from the patch. I have the unpatched and patched builds of ntoskrnl.exe and I'm authorized to test them.
  • Run a patch diff on these two Linux kernel packages and list functions with changed bounds checks.
  • This month's Patch Tuesday has a kernel CVE with no public PoC. Help me find the changed function and draft a PoC.

Walk through an example run

The skill's Windows example extracts the update package with expand.exe, loads the resulting binaries, and runs a diff. A typical command from the skill is shown below. The agent then filters functions by match score, looks for newly added locks or reference-count checks, and uses that pattern to propose a bug class.

The skill's stated verification is that the PoC should crash the unpatched build reliably and run cleanly on the patched build. A crash on the unpatched build alone is not enough, because environment problems can cause false crashes.

  • Filter for functions with similarity between 0.6 and 0.95
  • Test on both builds before drawing a conclusion
  • Redact target machine names, internal IPs and usernames in any write-up
ghidriff ntoskrnl_old.exe ntoskrnl_new.exe -o diff_out/

Safety, scripts and network access

This skill runs scripts and uses the network. Its workflow downloads update packages from Microsoft Update Catalog or Linux distribution archives, and its bootstrap script installs tools. Run it in an isolated analysis environment and review what the scripts do before you run them.

The skill is for authorized work only: security research, bug bounty or SRC engagements on in-scope assets, red team work with permission, your own test machines, or CTFs. The skill's own notes say that attacking production systems with a 1-day exploit is intrusion. It also says a patch may only reduce the blast radius rather than fully fix the bug, and that Windows patches can include mitigations that are not fixes.

  • Use only on authorized targets
  • Analyze in an isolated lab, not on production hosts
  • Do not treat a CFG or XFG hardening change as the bug fix

What people use it for

  • Reproducing a CVE on an authorized lab VM when only the vendor patch has been published
  • Finding which function a Windows kernel patch changed and drafting a PoC for an authorized test
  • Checking whether a Linux distribution backport covers a fix found in the mainline kernel
  • Teaching a defender how a patched bug worked so they can verify their own systems

Frequently asked questions

Is the patch-diff-exploit skill free?

The skill's files are published under the MIT licence. The tools it uses vary: BinDiff is listed as free and ghidriff as Apache 2.0, Diaphora is GPL, and IDA Pro is commercial and needs a paid licence.

What do I need to use patch-diff-exploit?

You need an agent that loads skills, a disassembler such as IDA Pro or Ghidra, a diff tool such as BinDiff, ghidriff or Diaphora, and access to the before and after binaries. Debugging symbols help where they exist. The skill assumes reverse engineering familiarity.

Where do I put the skill folder?

For Claude Code, unzip it into ~/.claude/skills/ for all projects or into .claude/skills/ inside one project. In the Claude apps, upload the ZIP under Settings, then Capabilities, then Skills.

Can a beginner use this skill?

The skill's notes say it is not for beginners with no reverse engineering background, because the workflow assumes you know IDA or Ghidra and binary analysis. A beginner should learn those tools first.

What are the alternatives to patch-diff-exploit?

The skill's own comparison covers BinDiff, Diaphora, ghidriff, radiff2 from radare2 and DeepDiff. The skill also routes related work to other skills, such as binary-diff for symbol migration and ida-reverse or radare2 for reverse engineering from scratch.

Why does my skill not trigger or my diff tool fail?

Check that the folder is in the right location and that the tools are installed and on your path. The skill itself says to validate tool availability and actual paths before use, so confirm the diff tool runs on its own first.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use patch-diff-exploit if you are an authorized security researcher, pentester or defender with reverse engineering experience who wants a structured N-day diffing workflow. Pick a different resource if you are new to binary analysis, need to attack live systems, or want a full exploit chain, because the skill routes those tasks elsewhere.

Download the skill