function factorial(n) if n <= 1 then return 1 else return n * factorial(n - 1) end end print(factorial(5))
| Technique | Effect on Decompiler | |-----------|----------------------| | Stripping debug info ( luac -s ) | Loss of local variable names – annoying but not fatal. | | Control flow flattening | Produces irreducible CFG; many decompilers crash or output garbled logic. | | Custom VM/opcodes | Standard decompilers fail entirely; requires reverse engineering the custom loader. | | String encryption (XOR, AES) | Output shows decryption calls instead of literals. | | Dead code & opaque predicates | Decompiler may output nonsense or infinite loops. | | Using luac from modified Lua versions (e.g., LuaJIT, LuaU) | Bytecode incompatible; decompiler must be updated. |
function factorial(arg0) if arg0 <= 1 then return 1 else return arg0 * factorial(arg0 - 1) end end print(factorial(5))
Different source codes can compile down to identical bytecode.