mojtabafalleh/emudbg

GitHub: mojtabafalleh/emudbg

一款轻量级的 Windows 可执行文件模拟器与调试器,通过跳过系统调用模拟来加速逆向工程和恶意软件分析流程。

Stars: 202 | Forks: 26

# EmuDbg. **EmuDbg** 是一个轻量级、高速的 **模拟器 + 调试器**,专为逆向工程 Windows 可执行文件而设计。 ## ✨ 工作原理 ![Splash](https://github.com/mojtabafalleh/emudbg/blob/master/doc/Screenshot%202025-07-25%20184628.png) - 以调试模式运行任何 **.exe** 文件 - 使用 **Zydis** 进行指令反汇编 - 直接模拟汇编指令 - 通过调试器单步执行跳过 Windows API 调用,而无需模拟 syscall - 比模拟整个操作系统环境的传统模拟器快得多 - 非常适合 **逆向工程**、**恶意软件分析**和 **底层研究** ## ⚡ 为什么选择 EmuDbg? 与笨重的全系统模拟器不同,EmuDbg 专注于 **快速指令模拟**。 Windows API 函数通过调试器单步执行被跳过,从而实现无缝的执行流程,无需进行 syscall 模拟或复杂的内核挂钩。 ## 🚀 快速开始 1. **克隆仓库** git clone --recurse-submodules https://github.com/mojtabafalleh/emudbg cd emudbg cmake -B build 2. **或者从 [Releases](https://github.com/mojtabafalleh/emudbg/releases) 页面下载最新的预编译版 `emudbg.exe`** 3. **配置运行时模式(可选):** 你可以通过编辑 `cpu.hpp` 文件来自定义 EmuDbg 的行为。 有三个主要标志用于控制日志记录和 CPU 模式: //------------------------------------------ // LOG analyze #define analyze_ENABLED 1 // LOG everything #define LOG_ENABLED 0 // Test with real CPU #define DB_ENABLED 0 //stealth #define Stealth_Mode_ENABLED 1 //emulate everything in dll user mode #define FUll_user_MODE 1 //Multithread_the_MultiThread #define Multithread_the_MultiThread 0 // Enable automatic patching of hardware checks (not working yet ) #define AUTO_PATCH_HW 0 //------------------------------------------ 将所有标志设置为 `0` 将以纯模拟模式运行模拟器,没有额外的日志记录或真实 CPU 测试。 ## 🛠 用法 ``` emudbg.exe [-m target.dll] [-b software|hardware|noexec] ``` ## 📌 参数 | 参数 | 必填 | 描述 | |------------------|----------|--------------------------------------------------------------------| | `` | ✅ | 要调试的目标可执行文件的路径 | | `-m `| ❌ | 等待特定 DLL 加载后再设置断点 | | `-b ` | ❌ | 断点类型:`software`(默认)、`hardware` 或 `noexec` | | `-r ` | ❌ | 在目标模块内的相对虚拟地址 (RVA) 处设置断点。注意:不能与 -b noexec 同时使用 | | `-watch_section ` | ❌ | 监控特定 section 中的执行情况。可以列出 section 名称,或使用 `all` 来监控所有 section。 | ## 什么是 noexec 断点? noexec 会移除即将运行代码的内存区域的执行权限,从而触发访问违例并起到断点的作用。它非常有用,因为不需要完整的 user mode 即可使用。它在所有类型的断点中提供了几乎最好的性能。但不适用于 RVA。 ## 📌 关于 -watch_section 的说明: 使用 -watch_section 选项时,emudbg 将记录正在执行或访问的 section。例如,它会记录代码从一个 section 跳转到另一个 section 的转换过程。 示例: ``` emudbg program.exe -m game.dll -watch_section .text .vm emudbg program.exe -watch_section all ``` ### 💡 示例 #### 🔸 在进程入口点和 TLS 回调处使用软件断点运行 ``` emudbg.exe C:\Samples\MyApp.exe -b software ``` #### 🔸 等待特定 DLL 加载,然后设置硬件断点 ``` emudbg.exe C:\Samples\MyApp.exe -m target.dll -b hardware ``` #### 🔸 不带任何标志的默认用法(使用软件断点) ``` emudbg.exe C:\Samples\MyApp.exe ``` #### 🔹 在主可执行文件的特定 RVA 处设置断点 ``` emudbg.exe C:\Samples\MyApp.exe -r 0xFAB43 ``` #### 🔹 在特定模块内的特定 RVA 处设置硬件断点 ``` emudbg.exe C:\Games\MyGame.exe -m target.dll -r 0x12A400 -b hardware ``` #### 🔹🔹 noexec 不适用于 RVA ``` emudbg.exe C:\Games\MyGame.exe -m target.dll -b noexec ```
标签:Bash脚本, C++, DAST, DNS 反向解析, Wayback Machine, 云资产清单, 反汇编, 恶意软件分析, 指令模拟, 数据擦除, 逆向工程