# wasmdec：WebAssembly 到 C 的反编译器

> 命令行反编译器，借助 Binaryen 解析 WebAssembly 二进制或文本格式模块，输出伪 C 代码：包括全局变量、导入与已定义的函数及其局部变量和控制流，并附带实现 WebAssembly 运算的 C 辅助函数前导部分。可将多个模块反编译到同一文件并以模块名作前缀；memdump 模式则改为把模块的内存和表写入文件。wasmdec 自身的 Emscripten 构建支撑着一个在线演示。开发停留在 2018 年的 1.2.1 版。

- 类型：工具
- 目标：二进制 · 网站
- 类别：WebAssembly 工具
- 关联：基础工具
- 来源复核于：2026-10-20
- 收录于：2026-11-09
- 原始资源：<https://github.com/wwwg/wasmdec>
- 一手来源：<https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/README.md>
- 目录页面：<https://awesomerea.org/zh/resources/wasmdec/>
- 记录 JSON：<https://awesomerea.org/resources/wasmdec/record.json>
- 英文版：[English](https://awesomerea.org/resources/wasmdec/index.md)

## 使用条件与局限

- 源码构建需要支持 C++14 的 g++、Make、CMake，以及 Binaryen、cxxopts 和 WebAssembly testsuite 子模块；建议 GCC 7 或更新版本。1.2.1 下载包适用于 Linux x86-64。
- 输入是 .wasm 二进制或 .wast 文本模块。asm.js 模式需要 Makefile 未设置的编译标志；解析依赖固定的 2018 年 Binaryen，可能无法载入较新的 WebAssembly 特性。
- 输出为伪 C。测试会反编译七个随附样本和规范测试套件样本，并检查退出状态。
- 示例包含商业游戏 diep.io 的机器翻译代码；该输出的权利仍归原权利人所有。
- 项目采用 MIT；Binaryen、cxxopts 和 testsuite 子模块保留各自许可。

## 一手来源

1. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/README.md>
2. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/Makefile>
3. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/.gitmodules>
4. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/src/wasmdec.cc>
5. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/src/decompiler/Decompiler.cc>
6. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/test/tests.sh>
7. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/test/test-spec.sh>
8. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/release/install.sh>
9. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/mkrelease.sh>
10. <https://github.com/wwwg/wasmdec/blob/3d9e5ca66ece79efe8f6550fd03623bd1dea3ec5/LICENSE>
11. <https://github.com/wwwg/wasmdec/releases/tag/1.2.1>
12. <https://github.com/WebAssembly/binaryen/tree/9f49e3d9c92703c3f5cf3589a78a3318bfe2bca4>

## 同分区更多条目：网站

- [JS Deobfuscator（kuizuo）Babel AST 反混淆工具](https://awesomerea.org/zh/resources/kuizuo-js-deobfuscator/index.md) · 工具
- [go-mitmproxy HTTP 流量分析代理](https://awesomerea.org/zh/resources/go-mitmproxy/index.md) · 工具
- [恐龙跑酷：恢复一条加速规则](https://awesomerea.org/zh/resources/rea-dinosaur-speed-case/index.md) · 案例
- [rauchg.com：根据捕获的 Flight 输出重建 RSC 博客](https://awesomerea.org/zh/resources/rauchg-rsc-reconstruction-case/index.md) · 案例
- [BaoCut Slides：交互式网页编辑器改编](https://awesomerea.org/zh/resources/baocut-slides-editor-case/index.md) · 案例
- [Claude Code 中的 REA：隔离配置下的静态分析 A/B 试验](https://awesomerea.org/zh/resources/rea-claude-code-isolated-ab-case/index.md) · 案例

## 关于此条目

说明已依据一手来源复核。
原创说明采用 MIT 许可；外部项目、论文与素材保留各自的权利和许可。
