# 再也不手撕逆向 **Repository Path**: fiagainster/NoMoreHandReverse ## Basic Information - **Project Name**: 再也不手撕逆向 - **Description**: 基于 x64dbg + Claude Code 的智能逆向工作台——说人话,AI 帮你逆向。你只需描述目标(“帮我绕过登录验证”),AI 自动定位字符串、找判定门、改汇编、验证结果。再也不用记命令、手撕汇编,动嘴就行。 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-08-02 - **Last Updated**: 2026-10-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 智能逆向取证工作台 基于 x64dbg + Claude Code,用自然语言做逆向分析。 ## 部署 ### 1. 克隆项目 ```bash git clone cd 逆向自动化 ``` ### 2. 安装 Python 依赖 ```bash pip install -r scripts/requirements.txt ``` ### 3. 验证 x64dbg 调试器 x64dbg 已编译好放在 `x64dbg_release/release/x64/` 下: ```bash cd x64dbg_release/release/x64 && echo "exit" | ./headless.exe ``` 看到 `[headless] entering command loop...` 即正常。 ### 4. 安装 Automate 插件(动态分析必需) > 如果是 git clone 获取的项目,插件文件已在仓库中,跳过此步。 Automate 插件让 Python 通过 ZMQ RPC 直接操控调试器(读写寄存器/内存/断点),替代低效的 stdin 文本管道。 1. 打开 [x64dbg-automate Releases](https://github.com/dariushoule/x64dbg-automate/releases) 2. 下载最新 `release64-*.zip` 3. 解压,将 `Release\x64dbg-automate.dp64` → `x64dbg_release\release\x64\plugins\` 4. 将 `Release\libzmq-mt-*.dll` → `x64dbg_release\release\x64\` 最终目录结构: ``` x64dbg_release\release\x64\ ├── headless.exe ├── x64dbg.exe ├── libzmq-mt-4_3_5.dll ← 插件依赖 ├── plugins\ │ └── x64dbg-automate.dp64 ← RPC 插件 └── ... ``` ### 5. 验证完整环境 ```bash python -c "from x64_automate import quick_test; quick_test()" ``` 输出 `1 + 1 = (2, True)` 即配置完成。 ### 环境要求 - Windows 10/11 x64 + Python 3.10+ + Claude Code - 动态分析需在虚拟机中执行 --- ## 使用方式 ### 主要方式:跟 Claude Code 对话 在这个目录打开 Claude Code,用自然语言描述需求: ``` 分析这个 exe 有没有加壳 帮我找登录验证逻辑,我要绕过密码 这个程序用了什么加密算法 提取里面的 URL 和 IP 监控这个程序运行时的 API 调用 ``` AI 会自动选工具、跑命令、读结果、给你结论。**你不需要记住任何命令。** ### 典型对话示例 ``` 👤 帮我分析这个 cp+.exe,不知道它是干嘛的 🤖 [pe_analyzer → 64 位控制台程序,MinGW GCC 编译] [strings_extractor --interesting → 立刻看到 3 条关键交互字符串] [xref_finder --filter "flag" → 定位到 RVA 0x1568] [disasm_analyzer --dump-func 0x1550 → 反汇编完整验证函数,自动标注字符串引用] → CTF crackme,输入 flag 后逐字符 (x ^ 10) - 10 变换再比对 → 变换函数自逆,直接套用:Flag: SYC{Anma1nG_y0u_maKe_it_1alaIa~~} 👤 再试试这个 Challenge.exe 🤖 [pe_analyzer → 64 位 MSVC 控制台,image_base 0x140000000] [strings_extractor --interesting → "Dive deep..." / "Nice work, choomba"] [xref_finder --filter "geesec" → 发现前缀比对代码 0x1177] [disasm_analyzer --dump-func 0x11C0 → 确认格式 geesec{32字符}] [disasm_analyzer --detect-crypto → 发现 Blowfish P-array 常量 0x243F6A88] → 追踪到密文 @ 0x1F400,密钥 @ 0x1D9E0 → 写出 projects/Challenge.exe/crack.py Blowfish 解密脚本 👤 帮我分析这个 Bitlocker.exe,找到登录验证并绕过 🤖 [strings_extractor → 找到 "Login Successful!"] [xref_finder → 定位引用代码 0x208D] [branch_analyzer → 找到 TEST+JNE 判定门 0x2055, 0x2087] [crypto_analyzer → SHA-256 → AES-256 加密链] → 用户名 david1337 / 密码 1337david → 改 0x2055 的 JNE 为 NOP 即可绕过 → Key: 299255-418649-198198-616891-099682-482306-642609-483527 ``` --- ## 手动命令参考 如果你想自己跑脚本,下面是完整参考。 ### 静态分析(安全,不执行程序) ```bash # 第一步:看文件结构 python scripts/pe_analyzer.py target.exe --entropy --suspicious --json # 第二步:提取字符串线索(推荐加 --interesting 过滤编译器噪声) python scripts/strings_extractor.py target.exe --interesting --min-length 4 --json # 第三步:按需深入 python scripts/xref_finder.py target.exe --filter "Success" --json # 字符串交叉引用 python scripts/branch_analyzer.py target.exe --find-gates --start 0x1AE0 # 判定门定位 python scripts/crypto_analyzer.py target.exe --json # CryptoAPI 追踪 python scripts/disasm_analyzer.py target.exe --detect-crypto --detect-anti # 加密/反调试扫描 python scripts/disasm_analyzer.py target.exe --dump-func 0x1550 # 🆕 反汇编完整函数(自动标注字符串引用) python scripts/disasm_analyzer.py target.exe --dump-addr 0x1568 --dump-len 0x200 # 🆕 反汇编指定地址 python scripts/cfg_analyzer.py target.exe --start 0x1AE0 --mermaid graph.mmd # CFG 可视化 python scripts/deobfuscator.py target.exe --patch # 混淆检测+修复 python scripts/trace_diff.py --trace-a a.trace64 --trace-b b.trace64 # trace 差异对比 # 生成 x64dbg 标注 python scripts/xref_finder.py target.exe --json > x.json python scripts/branch_analyzer.py target.exe --find-gates --json > b.json python scripts/annotator.py --xrefs x.json --branches b.json --output labels.txt ``` ### 动态分析(需虚拟机,会执行程序) **Python API 模式(推荐):** ```python from x64_automate import X64Automate with X64Automate() as xa: xa.init('target.exe') xa.bp_set('MessageBoxA') xa.go() xa.wait_until_stopped() print(xa.read_string(xa.get_reg('rcx'))) ``` **一键工具:** ```bash python scripts/key_extractor.py --target target.exe --patch-rva 0x808C --patch-val 1 python scripts/api_capture.py --target target.exe --recipe crypto --output captures/ python scripts/memory_differ.py --target target.exe --range 0x140001000:0x1000 --at-entry MessageBoxA ``` **命令行配方(17 种):** ```bash python scripts/headless_cmd_gen.py --recipe api-monitor --target target.exe --output cmds.txt python scripts/headless_runner.py --headless x64dbg_release/release/x64/headless.exe --script cmds.txt --timeout 120 python scripts/headless_cmd_gen.py --list-recipes ``` **Stdin 管道调试 (pipe_debug.py):** 程序从 stdin 读输入、headless 无法交互时使用。 支持管道注入输入、捕获 stdout。不支持断点/读内存。 ```bash # 测试输入并看输出 python scripts/pipe_debug.py target.exe --input "flag content" # 从文件读取输入 python scripts/pipe_debug.py target.exe --input-file payload.bin ``` > **局限:** pipe_debug 负责「跑程序 + 看输出」,不负责「设断点 + 读内存」。 > 需要断点调试 stdin 程序时,用 **x64dbg GUI 模式**:拖入 EXE → 设断点 → F9 → > 在程序自己的控制台输入 → 断点命中后查看内存。 --- ## 实战教程:2024美亚杯个人赛逆向 以 2024 美亚杯个人赛逆向题目`Bitlocker.exe` 为例,完整演示从零到拿到 Key。 ### 1. 看文件结构 ```bash python scripts/pe_analyzer.py Bitlocker.exe --json ``` → 64 位 GUI 程序,导入 USER32.dll + ADVAPI32.dll ### 2. 提取字符串 ```bash # 推荐:--interesting 过滤掉编译器内部符号,只显示用户可见的关键字符串 python scripts/strings_extractor.py Bitlocker.exe --interesting --min-length 4 --json ``` → 1446 条字符串 → 过滤后仅 131 条,`Username:` `Password:` `Login Successful!` 一眼可见 ### 3. 字符串交叉引用 ```bash python scripts/xref_finder.py Bitlocker.exe --filter "Login" --json ``` → `"Login Successful!"` ← `0x208D`,`"Invalid username or password."` ← `0x211E` ### 4. 定位判定门 ```bash python scripts/branch_analyzer.py Bitlocker.exe --find-gates --start 0x1AE0 --range 0x1000 ``` → 关键发现: ``` Gate #3: 0x2055 TEST eax,eax → JNE 0x211E [failure] → "Invalid username" Gate #6: 0x2087 TEST eax,eax → JNE 0x211E [failure] → "Invalid username" 落空路径 → [success] → "Login Successful!" ``` ### 5. 提取凭据 + 加密分析 ```bash python scripts/xref_finder.py Bitlocker.exe --json ``` → 用户名:`david1337`(RVA `0x6488`),密码:`1337david`(RVA `0x6498`) ```bash python scripts/crypto_analyzer.py Bitlocker.exe ``` → `SHA-256 → DeriveKey → AES-256` 加密链,标志字节 `0x808C` 控制解密 ### 6. 拿到结果 - **用户名:** `david1337`   **密码:** `1337david` - **绕过登录:** 把 `0x2055` 的 `JNE`(6 字节)改为 `NOP` - **提取 Key:** 改 `0x808C` 为 `01` → 运行 → 登录 → 弹窗显示 Key --- ## 目录结构 ``` ├── README.md ← 你在这里 ├── CLAUDE.md ← AI 操作手册 ├── scripts/ ← Python 通用分析脚本(19 个) ├── projects/ ← 任务专用破解脚本(每个题目一个子文件夹) │ ├── README.md │ └── Challenge.exe/ ← 示例:Blowfish 解密脚本 ├── x64dbg_scripts/ ← x64dbg 原生脚本 ├── .claude/skills/ ← AI 技能定义(含 crackme-workflow) ├── profiles/ ← 特征库(API、壳签名、加密常量、YARA) ├── x64dbg_release/ ← 预编译 x64dbg └── x64dbg/ ← 源码(不动它) ``` ### projects/ — 任务专用脚本 有些逆向题目需要编写专用破解工具(如自定义解密、算法逆向)。这些脚本放在 `projects/<题目名>/` 下,**不要和 `scripts/` 通用工具混在一起。** ``` projects/<题目名>/ ├── README.md # 逆向过程记录 └── crack.py # 破解脚本 ``` AI 会在分析过程中自动建议在此创建专用脚本。 ## 安全 - ⚠️ 动态分析会真的执行程序 → 在虚拟机里跑,跑之前保存快照 - ⚠️ 不要直接访问分析出的可疑 URL/IP - ⚠️ **运行任何 EXE 前 AI 必须请求确认**(包括管道输入、调试启动,auto 模式也不例外) - ✅ 所有静态分析脚本是安全的,不会执行代码 - ✅ 纯静态工具(pe_analyzer, strings_extractor, disasm_analyzer, xref_finder 等)无需确认即运行 ## 常见问题 **中文路径报错?** → 复制到 `C:\temp\` 再分析。 **AI 在反复尝试同一个方法?** → 说"需要我怎么配合"。 **程序有 GUI 登录界面?** → AI 已从代码里找到凭据,你直接输入即可。 **数据被加密了?** → AI 会用 `key_extractor.py` 自动提取,或用 `api_capture.py` 监控。 **反汇编输出太多看不懂?** → 告诉 AI 你想看哪个地址/函数,它会用 `--dump-func` 自动标注关键引用。 **字符串太多找不到重点?** → 加 `--interesting` 过滤编译器噪声,1400 条变 100 条。 **解密算法不在工具覆盖范围内?** → AI 会在 `projects/` 下创建专用破解脚本。 ## 致谢 - **[x64dbg](https://github.com/x64dbg/x64dbg)** — Windows 开源二进制调试器 - **[Capstone](https://www.capstone-engine.org/)** — 多架构反汇编框架 - **[x64dbg Automate](https://github.com/dariushoule/x64dbg-automate)** — ZMQ RPC 自动化插件 - **[pefile](https://github.com/erocarrera/pefile)** — Python PE 解析库 - **[mpmath](http://mpmath.org/)** — 高精度 π 计算(Blowfish S-box 初始化) ## 致谢 - **[x64dbg](https://github.com/x64dbg/x64dbg)** — Windows 开源二进制调试器 - **[Capstone](https://www.capstone-engine.org/)** — 多架构反汇编框架 - **[x64dbg Automate](https://github.com/dariushoule/x64dbg-automate)** — ZMQ RPC 自动化插件 - **[pefile](https://github.com/erocarrera/pefile)** — Python PE 解析库