Crates.io | lunify |
lib.rs | lunify |
version | 1.1.0 |
source | src |
created_at | 2022-09-22 15:29:58.416538 |
updated_at | 2023-07-10 10:31:01.092388 |
description | A crate for converting Lua byte code to different versions and formats |
homepage | https://github.com/vE5li/lunify |
repository | https://github.com/vE5li/lunify |
max_upload_size | |
id | 671788 |
size | 221,257 |
A crate for converting Lua byte code to different versions and formats.
Currently Lua 5.0 and Lua 5.1 are supported inputs.
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());