Skip to content
Debugging
Skill

/ida-reverse

IDA Pro 逆向分析辅助技能。当用户提到逆向、反编译、分析二进制/PE/ELF/APK/DLL/SO、破解、找密码、漏洞分析、病毒分析、firmware 固件分析,或需要分析 exe/dll/so/elf/macho/sys 等文件时,务必使用此技能。 Ensure to use this skill when the user wants to analyze any binary file, regardless of whether they explicitly mention "IDA" or "reverse engineering".

BOOST
From plugin
claude-reverse-skills
1245 skills
Install
$ npx -y skills add haikow/claude-reverse-skills --skill ida-reverse --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/ida-reverse

Context preview

The summary Claude sees to decide when to auto-load this skill.

IDA Pro 逆向分析辅助技能。当用户提到逆向、反编译、分析二进制/PE/ELF/APK/DLL/SO、破解、找密码、漏洞分析、病毒分析、firmware 固件分析,或需要分析 exe/dll/so/elf/macho/sys 等文件时,务必使用此技能。 Ensure to use this skill when the user wants to analyze any binary file, regardless of whether they explicitly mention "IDA" or "reverse engineering".

SKILL.md

ida-reverse.SKILL.md
name: ida-reverse
description: |
  IDA Pro 逆向分析辅助技能。当用户提到逆向、反编译、分析二进制/PE/ELF/APK/DLL/SO、破解、找密码、漏洞分析、病毒分析、firmware 固件分析,或需要分析 exe/dll/so/elf/macho/sys 等文件时,务必使用此技能。

  Ensure to use this skill when the user wants to analyze any binary file, regardless of whether they explicitly mention "IDA" or "reverse engineering". This includes requests like "看看这个exe", "分析这个dll", "帮我破解", "找一下密码", "这个软件怎么注册", etc.

  Use the bundled scripts (scripts/start.ps1, scripts/open.ps1) for deterministic server management and file opening — do NOT write ad-hoc PowerShell commands for these operations.

IDA Pro 逆向分析技能

已知问题与反思(必读)

踩过的坑

1. **`idalib_open` 不能通过 OpenCode MCP 直接调用**

  • OpenCode 的 MCP 客户端对 `idalib_open` 的 output schema 校验有 BUG
  • 报错:`Structured content does not match the tool's output schema`
  • **解决办法**:使用 `scripts/open.ps1` 脚本通过 HTTP API 直调,绕过 MCP 校验层
  • 文件打开后,数据库绑定到共享上下文,其他所有 `idapro_*` 工具可直接使用

2. **`C:\Windows\System32\` 文件无权限打开**

  • idalib 无法直接读取 System32 目录下的文件
  • **解决办法**:`open.ps1` 自动检测并复制到 `Temp\opencode\` 目录后再打开

3. **启动服务器命令阻塞对话**

  • `idalib-mcp` 启动后会持续输出 INFO 日志到控制台
  • **解决办法**:使用 `scripts/start.ps1`(`-WindowStyle Hidden` 后台静默启动)
  • 脚本会等待服务就绪后自动退出,不阻塞对话

4. **MCP 服务器名不能用横线**

  • 之前用 `ida-pro-mcp` 作为服务器名,可能引起工具注册问题
  • **当前配置**:服务器名 `idapro`,工具前缀 `idapro_*`

5. **Remote HTTP vs Local Stdio**

  • `type:"local"`(stdio)模式:`idalib_open` 同样有 schema 校验问题
  • `type:"remote"`(HTTP)模式:可以先用脚本直开文件,再用 MCP 工具
  • **当前方案**:Remote HTTP 模式

6. **PR #389 修复了部分 schema 问题**

  • 作者 mrexodia 在 issue #388 后通过 PR #389 合并了修复
  • 修复了 HTTP 模式下的 structuredContent schema,但 OpenCode 侧校验仍有问题
  • 已安装最新 `main` 分支版本

7. **idalib 超时留下孤儿 worker 进程锁文件**

  • 第一次 `open.ps1` 超时后,idalib 的 python worker 子进程变成孤儿进程,咬着 `.id0`/`.id1`/`.nam` 不放
  • 后续任何工具或手动拖入 IDA GUI 都会报"权限不足"
  • **解决办法**:`start.ps1` 改用 `taskkill /F /T` 杀进程树,不再留孤儿
  • **兜底**:`open.ps1` 加了自动降级,检测到旧库被锁自动复制到 Temp 并加 GUID 前缀

8. **带自动分析打开看起来像卡死**

  • `idalib_open(run_auto_analysis=true)` 可能长时间不回包,但后端实际上仍在继续打开和分析
  • 之前用户侧看到的是“PowerShell 一直无输出”,容易误判成脚本卡死
  • **当前解决办法**:`open.ps1` 新增 `-TimeoutSeconds`,并改为后台请求 + 前台轮询 + 定时进度输出
  • 轮询到会话已就绪时会提前返回 `OK:文件名:session_id`,超时则返回 `ERR:open_timeout_xxs`

工作流程原则

| 步骤 | 做什么 | 用什么 | |------|--------|--------| | 1 | 确保 HTTP 服务器在运行 | `scripts/start.ps1`(无参数) | | 2 | 打开目标二进制文件 | `scripts/open.ps1 -Path "xxx.exe"` | | 3 | 使用所有 72 个 MCP 工具 | 直接调用 `idapro_*` 工具 | | 4 | 分析完毕 | 工具自动可用 |

脚本资源

start.ps1 — 启动 MCP HTTP 服务器

路径:`scripts/start.ps1`

  • 用 `taskkill /F /T` 杀旧进程树(连 worker 子进程一起清理)→ 后台启动 `idalib-mcp` → 等待就绪(最多 15 秒)
  • 成功输出 `OK:72`,失败输出 `ERR:timeout`
  • 服务器在后台运行,不阻塞对话

**调用方式**:

powershell -File "C:\Users\YOURNAME\.config\opencode\skills\ida-reverse\scripts\start.ps1"

open.ps1 — 打开二进制文件

路径:`scripts/open.ps1`

  • 通过 HTTP API 直调 `idalib_open`,绕过 MCP schema 校验
  • 自动检测 System32 路径并复制到临时目录
  • 自动清理同名旧数据库文件(`.id0`/`.id1`/`.nam`/`.til`/`.i64`)
  • 旧库被锁时自动降级:复制到 Temp 加 GUID 前缀后打开,不报错
  • 将打开请求放到后台执行,避免长时间同步等待导致脚本无响应
  • 支持 `-TimeoutSeconds`,超时后返回 `ERR:open_timeout_xxs`,不会无限卡住
  • 每隔 10 秒输出一次 `INFO:opening:已用时/超时秒数`,便于判断仍在分析中
  • 成功输出 `OK:文件名:session_id`,降级时加 `(temp copy)` 标记
  • 失败时自动重试走 Temp 副本

**调用方式**:

powershell -File "C:\Users\YOURNAME\.config\opencode\skills\ida-reverse\scripts\open.ps1" -Path "C:\path\to\file.exe"

**可选参数**:

# 指定 SessionId
powershell -File "scripts\open.ps1" -Path "file.exe" -SessionId "my_session"

# 跳过自动分析(大文件推荐)
powershell -File "scripts\open.ps1" -Path "large.exe" -NoAutoAnalysis

# 设置超时,避免带自动分析时长时间无返回
powershell -File "scripts\open.ps1" -Path "file.exe" -TimeoutSeconds 600

**输出约定**:

# 分析进行中(每 10 秒输出一次)
INFO:opening:11/600s

# 成功打开
OK:sample.exe:abcd1234

# 成功打开,但因锁文件降级到 Temp 副本
OK:1234abcd-sample.exe:abcd1234 (temp copy)

# 达到超时上限
ERR:open_timeout_600s

**实测说明**:

  • `Snipaste.exe` 带自动分析实测约 `324s` 才返回成功,属于“分析很久”而不是“脚本死锁”
  • 因此遇到 GUI 程序或较复杂样本时,建议优先显式设置 `-TimeoutSeconds 600`

核心工具列表

概况分析(第一步)

  • `idapro_survey_binary(detail_level="minimal")` — 快速概况:函数数、字符串、段、入口点、导入分类(加密/网络/文件IO)
  • `idapro_list_funcs(queries)` — 列出函数(分页、按名称过滤)
  • `idapro_list_globals(queries)` — 列出全局变量
  • `idapro_entity_query(kind, filter)` — 统一查询:functions/globals/imports/strings/names

反编译与反汇编

  • `idapro_decompile(addr)` — 反编译为伪代码
  • `idapro_disasm(addr, max_instructions=N)` — 反汇编
  • `idapro_analyze_function(addr, include_asm=false)` — 综合分析(伪代码+字符串+常量+调用者+被调用者+块)
  • `idapro_func_profile(queries)` — 函数概要指标

交叉引用与数据流

  • `idapro_xrefs_to(addrs)` — 查谁引用目标地址
  • `idapro_xref_query(addr, direction)` — 高级 xref 查询(方向/类型过滤)
  • `idapro_callees(addrs)` — 子函数列表
  • `idapro_callgraph(roots, max_depth)` — 调用图
  • `idapro_trace_data_flow(addr, direction, max_depth)` — 数据流追踪(forward/backward)

搜索

  • `idapro_find_regex(pattern, limit)` — 正则搜字符串
  • `idapro_search_text(pattern)` — 在反汇编列表中搜文本
  • `idapro_find_bytes(patterns, limit)` — 字节模式搜索(支持 ?? 通配符)
  • `idapro_find(type, targets)` — 高级搜索(立即数/字符串/引用)

内存与数据

  • `idapro_get_bytes(addrs)` — 读原始字节
  • `idapro_get_string(addrs)` — 读字符串
  • `idapro_get_int(queries)` — 读整数值
  • `idapro_get_global_value(queries)` — 读全局变量值
  • `idapro_read_struct(queries)` — 读结构体字段值
  • `idapro_search_structs(filter)` — 搜索结构体

修改操作

  • `idapro_set_comments(items)` — 添加注释(反汇编+反编译双向同步)
  • `idapro_append_comments(items)` — 追加注释
  • `idapro_rename(batch)` — 批量重命名(函数/全局/局部/栈变量)
  • `idapro_patch_asm(items)` — Patch 汇编指令
  • `idapro_patch(patches)` — Patch 字节
  • `idapro_define_func(items)` — 定义函数
  • `idapro_undefine(items)` — 取消定义
  • `idapro_define_code(items)` — 将字节转为代码

类型系统

  • `idapro_declare_type(decls)` — 声明 C 结构体/枚举/联合体
  • `idapro_set_type(edits)` — 应用类型到函数/全局/局部
  • `idapro_infer_types(addrs)` — 推断类型
  • `idapro_type_query(queries)` — 查询已声明类型
  • `idapro_type_inspect(queries)` — 查看类型详情

栈帧

  • `idapro_stack_frame(addrs)` — 查看栈帧变量
  • `idapro_declare_stack(items)` — 声明栈变量
  • `idapro_delete_stack(items)` — 删除栈变量

签名

  • `idapro_make_signature(addrs)` — 为地址生成唯一字节签名
  • `idapro_make_signature_for_function(addrs)` — 为函数生成签名
  • `idapro_find_xref_signatures(addrs)` — 为引用地址的代码生成签名

调试

Read more
Ships withclaude-reverse-skills

一套面向 Claude Code(及兼容的文件系统型 Agent)的逆向工程 Skill 集合,外加 IDA Pro MCP 的接入说明。跨平台(Linux / macOS / Windows),一条命令装进 ~/.claude/skills/。 🙏 来源:核心 Skill 来自 linux.do 论坛 @hisence 大佬的分享 —— 原帖 👉 。本仓库仅做整理与跨平台适配,致谢原作者(详见文末「许可与致谢」)。

Get the whole plugin

Other skills on claude-reverse-skills.

apk-reverse
Skill

apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的…

mcp-js-reverse-playbook
Skill

mcp-js-reverse-playboo…

在使用 js-reverse-mcp 做前端 JavaScript 逆向时使用,适用于签名链路定位、页面观察取证、运行时采样、本地补环境复现与证据化输出。优先适配当前环境里的 js-reverse_* 工具。