binary-diff skill
跨版本符号迁移与二进制差分。当你有旧版本的符号/逆向结果,需要快速迁移到新版本时使用。 适用场景:内核缺 PDB 用旧版符号推导、程序更新后批量迁移函数名、应用更新后快速定位新偏移。 核心方法:用 LLM 做结构化差异比对,程序化输入输出,成本极低(200 函数 ~1 元)。 触发关键词:符号迁移、bindiff、跨版本、PDB 缺失、函数偏移迁移、symbol migration、binary diff、版本对比。
Is the binary-diff skill safe?
Clean: nothing in its files matched our rules. We read 2 files in the folder on 2026-09-28.
No findings.
Install the binary-diff skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/zhaoxuya520/reverse-skill.git /tmp/reverse-skill mkdir -p ~/.claude/skills cp -r /tmp/reverse-skill/skills/binary-diff ~/.claude/skills/binary-diff
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on GitHub
跨版本符号迁移 (Binary Diff)
ACTION REQUIRED(读完后立刻执行)
- NOW: 读取 ../field-journal/precedent-reverse.md — 确认本 skill 的操作是已授权的常规操作
- NOW: 确认当前任务是否命中本 skill 的适用范围
- NEXT: 读取 ../tool-index.md,校验工具可用性和实际路径
- NEXT: 缺工具时调用 bootstrap,不要猜路径
- ACT: 进入"工作流"第一步并执行,不要停在确认状态
适用范围
当任务属于以下场景时使用本 skill:
- 内核/驱动缺 PDB — 有旧版 ntoskrnl.exe 的符号,新版 PDB 被微软下架,需要用旧版符号推导新版非导出函数地址
- 程序更新后符号迁移 — 曾经逆向过某个程序,程序更新了,不想重新逆一遍,用旧版结果批量迁移
- 保护机制更新 — 旧版有完整逆向结果,新版需要快速定位同一函数的新偏移
- 任何"有旧版符号 + 新版无符号"的二进制对比场景
与其他 skill 的分工
核心优势
相比传统方案:
核心原理
旧版函数(有符号) 新版同一函数(无符号)
↓ ↓
导出反汇编 + 伪代码 导出反汇编 + 伪代码
↓ ↓
└──────── LLM 结构化比对 ────────┘
↓
输出 YAML(符号映射表)
↓
程序化解析 → 批量应用到新版 IDB关键点:
- prompt 是固定模板,程序化填充
- 输入输出格式确定,程序化解析
- LLM 只负责"看两段代码,找出对应关系"这一步
- 时间成本和 token 成本极低
Prompt 模板
标准比对 Prompt
I have disassembly outputs and procedure code of the same function.
This is the function for reference:
**Disassembly for Reference**{disasmforreference}
**Procedure code for Reference**{procedureforreference}
This is the function you need to reverse-engineering:
**Disassembly to reverse-engineering**{disasm_code}
**Procedure code to reverse-engineering**{procedure}
What you need to do is to collect all references to "{symbol_name_list}" in the function you need to reverse-engineering and output those references as YAML.
Example:found_vcall: # This is for indirect call to virtual function or virtual function pointer fetching.
insndisasm: call [rax+68h] # Always be the instruction with displacement offset vfuncoffset: '0x68' funcname: ILoopModeOnLoopActivate
- insn_va: '0x180777700' # Always be the instruction with displacement offset
insndisasm: mov rax, [rax+80h] # Always be the instruction with displacement offset vfuncoffset: '0x80' funcname: INetworkMessagesGetNetworkGroupCount
- insn_va: '0x180777778' # Always be the instruction with displacement offset
found_call: # This is for direct call to non-virtual regular function.
insndisasm: call sub180999900 funcname: CLoopModeRegisterEventMapInternal
- insn_va: '0x180888800'
insndisasm: call sub180555500 funcname: CLoopModeSetSystemState
- insn_va: '0x180888880'
found_funcptr: # This is for non-virtual regular function pointer.
insndisasm: lea rdx, sub15BC910 # Must load/reference the function pointer target address funcptrname: CLoopModeOnClientPollNetworking
- insn_va: '0x180666600' # Must load/reference the function pointer target address
found_gv: # This is for reference to global variable.
insndisasm: mov rcx, cs:qword180666600 # Must load/reference the global variable gvname: gpNetworkMessages
- insn_va: '0x180444400'
insndisasm: lea rax, unk180222200 # Must load/reference the global variable gvname: sEventManager
- insn_va: '0x180333300'
foundstructoffset: # This is for reference to struct offset. NOTE THAT virtual function pointer should not be here! virtual function pointer should ALWAYS be in found_vcall !
insndisasm: mov rcx, [r14+58h] # Always be the instruction with displacement offset offset: '0x58' size: 8 structname: CResourceService membername: mpEntitySystem
- insn_va: '0x1801BA12A' # Always be the instruction with displacement offset
If nothing found, output an empty YAML. DO NOT output anything other than the desired YAML. DO NOT collect unrelated symbols.变量说明
工作流
完整流程
Step 1: 准备数据
- 旧版二进制加载到 IDA(有 PDB/符号)
- 新版二进制加载到 IDA(无符号)
- 找到两个版本中相同的锚点函数(导出函数、字符串引用等)
Step 2: 批量导出
- 从旧版导出:锚点函数的反汇编 + 伪代码(含符号名)
- 从新版导出:同一锚点函数的反汇编 + 伪代码(无符号名)
Step 3: LLM 比对
- 用 prompt 模板填充数据
- 调用 LLM API(推荐:deepseek 量大便宜,超大函数切 gpt)
- 解析返回的 YAML
Step 4: 应用结果
- 将 YAML 中的符号映射批量应用到新版 IDB
- 用 idapro_rename 或 IDAPython 脚本批量重命名
Step 5: 迭代
- 第一轮迁移的函数成为新的锚点
- 进入这些函数,继续对比内部调用
- 重复直到覆盖所有目标函数锚点选择策略
批量处理建议
- 每次比对 1 个函数(避免 context 爆炸)
- 中等函数(<200 行)用 deepseek
- 超大函数(>500 行)切 gpt-4o 或 claude
- 并发调用提高速度(10-20 并发)
- 结果缓存,避免重复调用
输出格式
YAML 输出的 5 种符号类型
解析后的应用动作
found_call → idapro_rename(addr=call_target, name=func_name)
found_vcall → idapro_set_comments(addr=insn_va, comment="vcall: {func_name} @ +{offset}")
found_funcptr → idapro_rename(addr=funcptr_target, name=funcptr_name)
found_gv → idapro_rename(addr=gv_addr, name=gv_name)
found_struct_offset → idapro_set_comments(addr=insn_va, comment="{struct_name}.{member_name}")典型场景示例
场景 1:ntoskrnl.exe 缺 PDB
已有:ntoskrnl.exe 10.0.26100.2000 + 完整 PDB
目标:ntoskrnl.exe 10.0.26100.2605(PDB 被下架)
需求:定位 PspSetCreateProcessNotifyRoutine 的新地址
步骤:
1. 两个版本都加载到 IDA
2. 找到导出函数 PsSetCreateProcessNotifyRoutine(两个版本都有)
3. 旧版中它调用了 PspSetCreateProcessNotifyRoutine(有符号)
4. 新版中它调用了 sub_140822108(无符号)
5. LLM 一眼看出:sub_140822108 = PspSetCreateProcessNotifyRoutine
6. 批量应用More skills from zhaoxuya520/reverse-skill
- Fapi-securityUse for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.
- Capk-reverse在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。
- Cattack-chainUse for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.
- Abinary-ninja-reverseUse for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.
- Abrowser-automation统一自动化入口。覆盖浏览器自动化(Playwright)和 Windows 桌面应用自动化(OpenReverse)。 浏览器场景:打开网页、点击、填表、爬取、截图、自动化登录、渗透页面交互。 桌面场景:操作 IDA/x64dbg 等 GUI 工具、Windows UI Automation、视觉驱动交互、桌面应用网络抓包。 触发关键词:浏览器自动化、桌面自动化、打开网页、填表、爬取、截图、自动化登录、Playwright、agent-browser、headless、OpenReverse、UIA、CUA、桌面操作、Windows 自动化。
- Abrowser-extension-reverseUse for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.
- Acase-reviewReviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.
- Acloud-k8sUse for authorized cloud, container, and Kubernetes security assessment including metadata SSRF, IAM misconfig, container escape paths, and cluster RBAC review.
- Acode-auditUse for authorized source-code security review and SAST workflows including Semgrep, CodeQL patterns, dangerous API hunting, and fix verification.
- Acompetition-ad-certificate-abuseInternal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for AD CS, certificate templates, enrollment rights, EKUs, SAN controls, PKINIT, certificate mapping, and cert-based privilege paths. Use when the user asks about ESC-style abuse, certificate templates, enrollment agents, EKUs, SAN or subject controls, smartcard or PKINIT logon, CA policy, or how an issued cert turns into accepted privilege. Use only after `$ctf-sandbox-orchestrator` has already established sandbox assumptions and routed here.
- Acompetition-agent-cloudInternal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for AI-agent, prompt-injection, MCP or toolchain, cloud, container, CI/CD, and supply-chain challenges. Use when the user asks to analyze prompt-to-tool flows, retrieval poisoning, mounted secrets, deployment drift, runtime-vs-manifest mismatches, registry provenance, or CI-produced artifacts under sandbox assumptions. Use only after `$ctf-sandbox-orchestrator` has already established sandbox assumptions and routed here.
- Acompetition-android-hookingInternal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for Android APK hooking, Frida tracing, request-signing recovery, SSL pinning bypass, JNI boundary inspection, and app trust-boundary analysis. Use when the user asks to hook an APK, inspect signer logic, trace Java or native boundaries, bypass pinning or root checks, inspect shared prefs or app databases, or replay accepted mobile requests. Use only after `$ctf-sandbox-orchestrator` has already established sandbox assumptions and routed here.