Luac | Decompile
As Lua evolves (5.5 is in discussion), bytecode will change again. New features like smaller constants, better jumps, and more aggressive optimization may break existing decompilers.
Trends to watch:
However, for Lua 5.1–5.4, unluac remains the gold standard for the foreseeable future. decompile luac
Many newcomers confuse these terms:
| Disassembly | Decompilation |
|----------------|------------------|
| Converts bytecode to a low-level, human-readable opcode representation (e.g., GETGLOBAL 0 1) | Reconstructs high-level Lua source code (local x = math.abs(-5)) |
| Always possible, even with stripped binaries | Often imperfect due to lost variable names, control flow obfuscation, or compiler optimizations |
| Useful for analyzing exact VM instructions | Useful for editing, understanding logic, or re-using code | As Lua evolves (5
A decompiler internally disassembles first, then applies control flow analysis (loops, if-then-else) and expression reconstruction.
Practical Rule of Thumb: If you did not write the original source or do not have explicit written permission from the copyright holder, decompiling LUAC is likely a violation of copyright and/or contract law. However, for Lua 5
If the file had debug info, you’ll see something like:
function add(a, b)
return a + b
end
print(add(5, 3))
If stripped, you might see:
function fun0(arg0, arg1)
local var0 = arg0 + arg1
return var0
end
local var0 = fun0(5, 3)
The logic is identical, but variable names are lost.