decompile
Decompiles a script's bytecode back into readable Luau source.
function decompile(script: Instance): stringSynopsis
How it works
Retrieves the bytecodeBytecodeThe compiled binary representation of Luau source code. A sequence of 32-bit instructions (opcodes + operands) stored in a Proto's code[] array. Executed by the Luau VM interpreter. of a
LocalScript or ModuleScript and passes it through a Luau decompilerDecompilerA tool that converts compiled bytecode back into readable Luau source code. Not a perfect inverse — variable names, comments, and some control flow structures are lost during compilation. to produce human-readable source code. The decompiler performs control-flow analysis, SSASSAStatic Single Assignment — a compiler intermediate representation where each variable is assigned exactly once. Decompilers use SSA form to reconstruct clean variable assignments from raw register-based bytecode. construction, and pattern matching to reconstruct if/else, for, while loops, and local variable names.Limitations
Decompilation is inherently imperfect. Variable names are lost (replaced with
v1, v2, etc.), comments are stripped, and some patterns (complex continue usage, certain optimized table constructors) may produce incorrect or uncompilable output. Obfuscated scripts may crash the decompilerDecompilerA tool that converts compiled bytecode back into readable Luau source code. Not a perfect inverse — variable names, comments, and some control flow structures are lost during compilation. or produce garbage.Usage
Decompile a module
local src = decompile(game.ReplicatedStorage.SomeModule)
print(src)Save decompiled source to file
local script = game.Players.LocalPlayer.PlayerGui.ScreenGui:FindFirstChildWhichIsA("LocalScript")
local source = decompile(script)
writefile("decompiled.lua", source)
print("Saved", #source, "bytes")Parameters
script Instance A LocalScript or ModuleScript to decompile.
Returns
string The decompiled Luau source code as a string.
Powered by Sponge
Vindicta uses the Sponge Decompiler by malice for all bytecode recovery. It supports Luau 0.6xx+ bytecode and produces clean, idiomatic output.
Obfuscated scripts
Heavily obfuscated scripts (Luraph, Moonsec, IronBrew) may produce degraded output. Sponge attempts best-effort recovery but cannot defeat all obfuscation layers.