#decompiling #reverse-engineering #lua #lua-51 #bytecode

luadec-rust

Safe Rust bindings for LuaDec - A Lua 5.1 bytecode decompiler

11 releases

0.2.5 Sep 4, 2025
0.2.2 Sep 4, 2025
0.1.7 Aug 5, 2025

#2313 in Parser implementations

Download history

581 downloads per month

MIT license

1MB
29K SLoC

C 28K SLoC // 0.1% comments Lua 414 SLoC // 0.0% comments Rust 266 SLoC // 0.1% comments Batch 127 SLoC

luadec-rust

Crates.io Documentation

Safe Rust bindings for LuaDec, a Lua 5.1 bytecode decompiler.

This crate provides a safe, high-level API for decompiling Lua 5.1 bytecode. It wraps the unsafe FFI bindings to LuaDec in a memory-safe interface.

Requirements

  • C compiler (gcc/clang)
  • make
  • Lua 5.1 source code (included as git submodule)

Platform Support

  • Linux (tested)
  • macOS (tested)
  • Other Unix-like systems (should work)

Features

  • lua-5.1-32: Build with 32-bit Lua 5.1 support (useful for compatibility with older or 32-bit Lua bytecode)

Safety

This crate provides a safe interface to LuaDec by wrapping the unsafe FFI calls in memory-safe abstractions. All public APIs are designed to prevent undefined behavior and memory safety issues.

License

This project follows the same license as the original LuaDec project. Lua itself is licensed under the MIT license.

Dependencies

~140–800KB
~17K SLoC