Skip to main content

decompile

Function decompile 

Source
pub fn decompile(bytecode: &[u8]) -> Result<String, String>
Expand description

Decompile Lua 5.1 bytecode into Lua source code.

Takes raw bytecode bytes (e.g. from a .luac file) and returns the decompiled Lua source as a String.

§Errors

Returns an error string if the bytecode cannot be parsed.

§Example

let bytecode = std::fs::read("compiled.luac").unwrap();
let source = luadec::decompile(&bytecode).unwrap();
println!("{}", source);