Skip to content

uniquadev/LuauVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuauVM CI

LuauVM (lowercase u, /ˈlu.aʊ/) is a fast and small luau interpreter wrote in luau. It aims to provide sandboxing, arbitrary code execution and "obfuscation" templates.

This software can be used as study material for luau - lua 5.x internals.

NOTE:

  • This VM won't be maintained constantly over luau updates.
  • This VM doesn't aim to provide a fast bytecode execution.
  • This VM has been tested with scripts like the ones in MakeTests/src folder.

Usage

local vm = require("./VM/main"); -- require("LuauVM");
local bytecode = [[BYTECODE]]

-- #1 way
local proto = vm.luau_load(bytecode);
local closure = vm.wrap_proto(proto);
closure();

-- #2 way
local closure = vm.loadstring(bytecode);
closure();

Note: only an interpreter is provided and compiled code must be obtained from a supported luau compiler

Tests

  1. python MakeTests\main.py -t to build tests scripts in Tests directory
  • Tests' scripts must return 0 to pass the check.
  1. python MakeTests\run.py - r to run all built tests
  • luau "<path/to/test-script>" to run a specific test script

License

MIT LICENSE