mwemuorg/mwemu
GitHub: mwemuorg/mwemu
MWEmu 是一个纯 Rust 实现的 x86 Windows 进程模拟器,专为恶意软件分析和 shellcode 执行而设计。
Stars: 312 | Forks: 44
# MWEmu
[](https://github.com/sha0coder/mwemu/actions/workflows/ci.yaml)
[](https://pypi.org/project/pymwemu/)
[](https://crates.io/crates/libmwemu)
[](https://crates.io/crates/mwemu)
[](https://docs.rs/libmwemu)
[](https://codecov.io/gh/sha0coder/mwemu)
## 官方文档
[mwemu.github.io](https://mwemu.github.io)
## 这是什么?
它是一个硬件模拟器 + OS 进程模拟器,使用纯 Rust 实现。
这种方法对于恶意软件分析和其他内容(PE、shellcode 等)非常方便。
该 OS 主要是 Windows,它模拟了一个 Windows 进程,并对 Linux 提供了一些非常基础的支持。
硬件方面支持 x86 32/64 位,速度快且可靠。

## 使用该软件的三种方式
- mwemu 命令行工具 https://github.com/sha0coder/mwemu
- libmwemu crate https://crates.io/crates/libmwemu
- pymwemu https://pypi.org/project/pymwemu/
## 关于 scemu 的说明
该项目已从 scemu 更名为 mwemu。
## 一些视频
[r2con2025](https://www.youtube.com/watch?v=-TFL-_-nIqA) 在模拟时刻,从 mwemu 中使用 radare2 进行静态分析和可视化。
[一些演示](https://www.youtube.com/@JesusOlmos-wm8ch/videos)
## 功能
- 📦 Rust 的安全性,非常适合用于模拟恶意软件。
- 所有依赖项均为 Rust。
- ⚡ 极快的模拟速度
- [基准测试](BENCHMARK.md)
- 25,767,432 条指令/秒
- 680,000 条指令/秒(打印每条指令 -vv)
- 自行测试:time mwemu -f test/exe64win_enigma.bin -6 -v -c 20000000 --cmd q
- 由超棒的 iced-x86 Rust 反汇编库提供支持。
- 支持命令行工具、Rust 库和 Python 库。
- 循环迭代检测器。
- 内存和寄存器跟踪。
- 彩色化输出。
- 可在特定时刻停止,以探索或修改其状态。
- 已实现 339 条 CPU 指令。
- 实现了 15 个 DLL 中的 260 个 32 位 winapi。
- 实现了 10 个 DLL 中的 204 个 64 位 winapi。
- 所有 Linux 系统调用 (syscalls)。
- SEH 链。
- 向量化异常处理 (VEH)。
- PEB、TEB 结构。
- 动态链接。
- IAT 绑定。
- 延迟加载。
- 内存分配器。
- 通过 int3 交互。
- 模拟非调试状态的 cpuid。
- 32 位和 64 位 shellcode 模拟。
- pe32 和 pe64 可执行文件模拟。
- 对已知 payload 的全面模拟:
- metasploit shellcode。
- metasploit 编码器。
- cobalt strike。
- shellgen。
- guloader(目前尚未完全实现,但比调试器走得更远)
- mars stealer pe32。
- bumblebee。
- 对复杂恶意软件函数的部分模拟:
- guloader
- xloader
- danabot
## pymwemu 对抗恶意软件
- raccoon,字符串解密
- vidar,字符串解密
- xloader,完全解密、keygen、构建 URL 加密。
- lokibot,API 去混淆
- mars,脱壳并获取 IOC
- shikata,解码并获取 IOC
- danabot,字符串解密
- zloader,字符串解密
- bumblebee,在模拟了 25,515,274,634 条指令后脱壳。
- enigma loader,API 去混淆和 drop 解密
- bugsleep,脱壳
- gozi,bss 解密和 DGA 预测器。
## 捕获模拟时刻
在模拟过程中,您可以看到已模拟的 CPU 指令数,这是每个模拟时刻的唯一 ID。
使用 -c 标志可以在特定时刻停止模拟,并通过控制台检查内部运行情况。
## 用法
```
MWEMU emulator for malware 0.7.11
@sha0coder
USAGE:
mwemu [FLAGS] [OPTIONS]
FLAGS:
-6, --64bits enable 64bits architecture emulation
--banzai skip unimplemented instructions, and keep up emulating what can be emulated
--flags trace the flags hex value in every instruction.
-F, --fpu trace the fpu states.
-h, --handle handle Ctrl+C to spawn console
--help Prints help information
-l, --loops show loop interations, it is slow.
-m, --memory trace all the memory accesses read and write.
-n, --nocolors print without colors for redirectin to a file >out
-r, --regs print the register values in every step.
-p, --stack_trace trace stack on push/pop
-t, --test test mode
--version Prints version information
-v, --verbose -vv for view the assembly, -v only messages, without verbose only see the api calls and goes
faster
OPTIONS:
-A, --args provide arguments to the EXE like: --args '"aa" "bb"'
--cmd launch a console command
-b, --base set base address for code
-c, --console select in which moment will spawn the console to inspect.
-C, --console_addr spawn console on first eip = address
-d, --dump load from dump.
-a, --entry entry point of the shellcode, by default starts from the beginning.
-e, --exit exit position of the shellcode
-f, --filename set the shellcode binary file.
-i, --inspect monitor memory like: -i 'dword ptr [ebp + 0x24]
--iso extract genuine system32 DLLs from a Windows ISO and use them as the maps folder, e.g. --iso ~/Downloads/win11.iso
-L, --log log output to file
-M, --maps select the memory maps folder
--mxcsr set mxcsr register
--r10 set r10 register
--r11 set r11 register
--r12 set r12 register
--r13 set r13 register
--r14 set r14 register
--r15 set r15 register
--r8 set r8 register
--r9 set r9 register
--rax set rax register
--rbp set rbp register
--rbx set rbx register
--rcx set rcx register
--rdi set rdi register
--rdx set rdx register
-R, --reg trace a specific register in every step, value and content
--rflags set rflags register
--rsi set rsi register
--rsp set rsp register
-x, --script