A drag-and-drop desktop tool that cleans up decompiler-style Lua source
(common in unluac/CFX output: L0_1, A0_2, AKL0_1, SHX0_1 variable
names, do return X end wrappers, reversed/Yoda comparisons, sequential
X[1] = ... table assignment, and simple goto/label skip patterns).
It's a heuristic text-level cleaner, not a full Lua parser — it only applies transforms it can prove are safe, and leaves anything ambiguous untouched (reported in the log as a manual-review note).
- LÖVE 11.5 (already installed via winget as
Love2d.Love2d)
- Launch the tool (see below) — a window titled "Lua Deobfuscator" opens.
- Drag one or more
.luafiles from Explorer onto that window (multi-select and drop works too — each file is processed independently). - For each dropped file, the tool:
- Reads the source, runs it through the cleanup passes described below.
- Writes the result next to the original as
<name>clean.<ext>(e.g.script.lua->scriptclean.lua). The original file is left untouched. - Prints a summary to the on-screen log: lines before/after, counts of
each fix applied, and any "NOTE" lines flagging things left for manual
review (e.g. remaining obfuscated names or
goto/label pairs it couldn't safely collapse).
- Open the generated
*clean.luafile in your editor to review the result. - A ready-to-drop example is included at
sample_obfuscated.lua— drag it onto the window to try it out.
Double-click run.bat, or from a terminal:
"C:\Program Files\LOVE\love.exe" "C:\Users\CodyC\Desktop\lua-deobfuscator"
do return X end->return X"literal" == var/nil == var/true == var/false == var-> normal orderX = {}+X[1] = a; X[2] = b->X = { a, b }if cond then goto lbl end/stmt/::lbl::->if not (cond) then stmt end(only when the label has exactly one jump target, to stay safe)- Renames decompiler-scheme identifiers (
L#_#,A#_#,AKL#_#,AKA#_#,SHX#_#) to sequential placeholders (var1,arg1, ...)
- It does not recover original semantic variable names — only generic placeholders, since guessing wrong would be worse than leaving it obfuscated.
- It does not handle control-flow flattening, encoded/packed strings, or
multi-branch
gotostate machines. Those are flagged, not rewritten. - It won't touch files that don't parse as plain text Lua (e.g. actual encrypted/packed bytecode).
deobfuscator.lua— the transform engine (usable standalone viarequire)main.lua— LÖVE2D GUI / drag-and-drop glueconf.lua— LÖVE2D window configsample_obfuscated.lua— example file to drag onto the window and trypatch-notes/— dated notes for every fix/feature added to the app
See the patch-notes folder for a changelog of fixes and new features.