Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Lua Deobfuscator

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).

Requirements

  • LÖVE 11.5 (already installed via winget as Love2d.Love2d)

Usage

  1. Launch the tool (see below) — a window titled "Lua Deobfuscator" opens.
  2. Drag one or more .lua files from Explorer onto that window (multi-select and drop works too — each file is processed independently).
  3. 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).
  4. Open the generated *clean.lua file in your editor to review the result.
  5. A ready-to-drop example is included at sample_obfuscated.lua — drag it onto the window to try it out.

Launching

Double-click run.bat, or from a terminal:

"C:\Program Files\LOVE\love.exe" "C:\Users\CodyC\Desktop\lua-deobfuscator"

What it fixes

  • do return X end -> return X
  • "literal" == var / nil == var / true == var / false == var -> normal order
  • X = {} + 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, ...)

What it does NOT do

  • 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 goto state 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).

Files

  • deobfuscator.lua — the transform engine (usable standalone via require)
  • main.lua — LÖVE2D GUI / drag-and-drop glue
  • conf.lua — LÖVE2D window config
  • sample_obfuscated.lua — example file to drag onto the window and try
  • patch-notes/ — dated notes for every fix/feature added to the app

Patch Notes

See the patch-notes folder for a changelog of fixes and new features.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages