{
  "added_at": "2026-11-02",
  "additional_evidence_urls": [
    "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/.gitmodules",
    "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/luadec/Makefile",
    "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/luadec/luadec.c",
    "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/luadec/luaopswap.c",
    "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/luadec/luareplace.c",
    "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/.travis.yml",
    "https://github.com/viruscamp/luadec/tree/895d92313fabaee260121c758c8320d1b21dd741/test"
  ],
  "category": "native-analysis",
  "description_en": "Lua bytecode decompiler that turns compiled chunks back into Lua source, with a disassembly mode, selection of single nested functions by number and a guesser for local variable declarations that can be overridden by hand. Its -fc option recompiles each decompiled function and compares it instruction by instruction with the original. It targets Lua 5.1, marks Lua 5.2 and 5.3 support as experimental, and continues Hisham Muhammad’s LuaDec for Lua 5.0 and Zsolt Sztupak’s LuaDec51.",
  "description_zh": "Lua 字节码反编译器，可把编译后的代码块还原为 Lua 源码，提供反汇编模式，可按编号只处理某个嵌套函数，并能推测局部变量声明，推测结果也可手动指定。其 -fc 选项会重新编译每个反编译出的函数，并与原函数逐条指令比较。它以 Lua 5.1 为主要目标，Lua 5.2 和 5.3 的支持标为实验性，延续了 Hisham Muhammad 面向 Lua 5.0 的 LuaDec 和 Zsolt Sztupak 的 LuaDec51。",
  "entry_url": "https://awesomerea.org/resources/luadec/",
  "entry_url_zh": "https://awesomerea.org/zh/resources/luadec/",
  "evidence_url": "https://github.com/viruscamp/luadec/blob/895d92313fabaee260121c758c8320d1b21dd741/ReadMe.md",
  "group": "tools",
  "id": "luadec",
  "json_url": "https://awesomerea.org/resources/luadec/record.json",
  "kind": "tool",
  "markdown_url": "https://awesomerea.org/resources/luadec/index.md",
  "markdown_url_zh": "https://awesomerea.org/zh/resources/luadec/index.md",
  "name": "LuaDec",
  "name_zh": "LuaDec：Lua 字节码反编译器",
  "record_type": "resource",
  "relationship": "foundation",
  "requirements": [
    "The reviewed master commit, the latest on the default branch, dates from 2017-01-06, and the repository has no releases or tags. A build initialises one Lua submodule from the author’s lua5 fork (branch 5.1, 5.2 or 5.3), builds that Lua, then runs make LUAVER=5.x in luadec/, which also builds the luareplace and luaopswap helpers; Visual C++ 2008 project files are included, which the README says were tested with VC 2008 and 2013. A Travis CI configuration builds each Lua version with gcc and clang but runs no tests.",
    "Input is a chunk compiled by the matching standard Lua version, or a Lua source file compiled on the fly for testing. For bytecode from a virtual machine with a reordered opcode table, luaopswap compares that VM’s compilation of a bundled script using every opcode with a standard compilation, derives an opcode map and rewrites files to standard opcodes; luareplace swaps a nested function between two files. The -fc check reports per function whether the decompiled code recompiles to the same instructions, and the README’s own example shows failures, so output must be checked function by function.",
    "test/ holds small Lua source cases for control-flow constructs, and test-compiled/lua-5.1 bundles compiled Lua 5.1 chunks as decompiler inputs, including files named for the Xunlei downloader, JX3 add-ons and the Defense Witches game; the repository does not state their origin or rights. ChunkSpy listers for each Lua version and Ruby comparison scripts are also included.",
    "The README says LuaDec is free software under the same license as the original LuaDec but does not name it, the repository has no license file and GitHub detects none, so reuse terms are unclear; the Lua, LuaAssemblyTools, ilua and memwatch submodules and the bundled ChunkSpy scripts keep their own terms."
  ],
  "requirements_zh": [
    "所审阅的 master 提交是默认分支上的最新提交，日期为 2017-01-06，仓库没有发布版本或标签。构建时先初始化作者 lua5 分支仓库中对应的 Lua 子模块（5.1、5.2 或 5.3 分支）并构建该 Lua，再在 luadec/ 中运行 make LUAVER=5.x，同时生成 luareplace 和 luaopswap 辅助工具；仓库附带 Visual C++ 2008 项目文件，README 称已在 VC 2008 和 2013 上测试。Travis CI 配置用 gcc 和 clang 分别构建各 Lua 版本，但不运行测试。",
    "输入为对应标准 Lua 版本编译的代码块，也可以是为测试而即时编译的 Lua 源文件。对于使用重排操作码表的虚拟机所生成的字节码，luaopswap 会把该虚拟机编译随附的全操作码脚本所得结果与标准编译结果比较，推导操作码映射，并把文件改写为标准操作码；luareplace 可在两个文件之间替换嵌套函数。-fc 检查逐个函数报告反编译代码重新编译后是否得到相同指令，README 自己的示例中就有失败项，因此需要逐个函数核对输出。",
    "test/ 中是针对各种控制流结构的小型 Lua 源码用例，test-compiled/lua-5.1 则附带编译后的 Lua 5.1 代码块作为反编译输入，其中包括以迅雷下载器、JX3 插件和 Defense Witches 游戏命名的文件；仓库未说明这些文件的来源或权利。仓库还包含各 Lua 版本的 ChunkSpy 列表工具和 Ruby 比较脚本。",
    "README 称 LuaDec 是自由软件，采用与原版 LuaDec 相同的许可，但未写明具体许可；仓库中没有许可证文件，GitHub 也未识别出许可证，因此再使用条款并不明确。Lua、LuaAssemblyTools、ilua 和 memwatch 子模块以及随附的 ChunkSpy 脚本各有其条款。"
  ],
  "targets": [
    "binary",
    "game"
  ],
  "url": "https://github.com/viruscamp/luadec",
  "verification": "source-reviewed",
  "verified_at": "2026-10-20"
}
