#lua #bytecode #endianness #byte #format #version #different

lunify

A crate for converting Lua byte code to different versions and formats

6 releases (3 stable)

1.1.0 Jul 10, 2023
1.0.1 Jan 10, 2023
1.0.0 Dec 5, 2022
0.1.2 Sep 22, 2022

#2201 in Encoding

Download history 59/week @ 2024-10-16 219/week @ 2024-10-23 246/week @ 2024-10-30 66/week @ 2024-11-06 126/week @ 2024-11-13 65/week @ 2024-11-20 224/week @ 2024-11-27 190/week @ 2024-12-04 178/week @ 2024-12-11 117/week @ 2024-12-18 181/week @ 2024-12-25 99/week @ 2025-01-01 110/week @ 2025-01-08 69/week @ 2025-01-15 31/week @ 2025-01-22 13/week @ 2025-01-29

251 downloads per month

MIT license

160KB
3.5K SLoC

Lunify

Tests Code Quality Test Coverage License: MIT crates.io

A crate for converting Lua byte code to different versions and formats.

Currently Lua 5.0 and Lua 5.1 are supported inputs.

Example

use lunify::{Format, LunifyError, Endianness, BitWidth, unify};

// Lua byte code in any suppored format
let input_bytes = include_bytes!("../test_files/lua50.luab");

// Desired output format. May specify pointer width, endianness, sizes of datatypes, ...
let output_format = Format {
    endianness: Endianness::Little,
    // Convert from byte code that runs on a 32 bit machine to byte code that runs on a 64 bit machine
    size_t_width: BitWidth::Bit64,
    ..Format::default()
};

// Convert input bytes to the desired format
let output_bytes = unify(input_bytes, &output_format, &Default::default());

Dependencies

~0–1.3MB
~19K SLoC