A high-performance C++ tool to dump Lua scripts into bytecode files (.luac
). This project allows developers to efficiently convert Lua scripts into bytecode format, useful for distribution, optimization, and security purposes.
LuaReaper is designed for developers who work with Lua scripts and need a reliable way to manage bytecode for enhanced performance or source code protection. This tool loads Lua scripts, compiles them into bytecode, and saves the bytecode files to a specified output directory.
- Features
- Pros and Cons
- Requirements
- Download and Build
- Usage
- Configuration
- Testing
- Contributing
- Contact
- License
- Fast Lua Compilation: Quickly converts Lua scripts to bytecode format.
- Configurable Output: Specify output directories and logging levels for better control.
- Detailed Logging: Verbose logging options to debug and monitor operations.
- Modular Structure: Organized codebase for easy expansion and maintenance.
- Efficient conversion of Lua scripts to bytecode.
- Flexible configuration options.
- Structured logging with different levels for better control.
- High modularity for maintainable code.
- Requires Lua library as a dependency.
- No GUI; command-line only.
- Limited to Lua 5.x versions (compatibility with Lua 5.x).
- C++17 or later
- CMake 3.15+ for building
- Lua 5.x library (included in the
libs/
folder or installed separately) - nlohmann/json library for configuration management (if not installed, download from https://github.com/nlohmann/json)
- Clone the repository:
git clone https://github.com/ByteShifters/LuaReaper.git
cd LuaReaper
- Set up the build environment:
mkdir build && cd build
- Run CMake to configure the project:
cmake ..
- Build the project:
make -j4
To dump a Lua script as bytecode, use:
./LuaReaper path/to/script.lua
By default, bytecode files will be saved in the output directory specified in config/dumper_config.json
.
Example usage:
./LuaReaper examples/hello.lua
The dumper_config.json
file in the config/
folder allows you to adjust the settings for the project.
{
"log_level": "INFO",
"output_directory": "./bytecode_output"
}
- log_level: Adjusts logging verbosity. Options include
INFO
,DEBUG
,ERROR
, etc. - output_directory: Specifies the folder where bytecode files will be saved.
Unit tests are provided in the tests/
folder using the Catch2 framework.
- Build the tests:
cd build
make RunTests
- Run the tests:
ctest --output-on-failure
We welcome contributions from the community! To contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your branch to your forked repository.
- Create a pull request.
If you have any questions or feedback, feel free to reach out:
This project is licensed under the MIT License. See the LICENSE file for more information.