Parse
A hand-written lexer and recursive-descent parser build an AST with declaration identities. Shadowed locals bind to the right declaration, not to a name.
Luau obfuscator · v0.1
TSVOBF compiles Luau into a register IR, encodes it as a binary payload, and emits a seeded interpreter. The original source is not included in the output.
local OP = {
SETINDEX=1, FORPREP=2, UNOP=3,
CLOSURE=4, NIL=5, RETURN=6,
CLOSE=7, CONCAT=8, SETGLOBAL=9,
TEST=10, GETUPVAL=11, GETFIELD=12,
NEWTABLE=13, LEN=14, FORLOOP=15,
MOVE=16, VARARG=17, BINOP=18,
GETGLOBAL=19, JMP=20, SETLIST=21,
SETFIELD=22, CMP=23, SETUPVAL=24,
LOADK=25, CALL=26, GETINDEX=27
}
local function fnv(data)
local hash = 5381
for i = 1, #data do
hash = math.fmod(hash * 33 + string.byte(data, i), 65521)
end
return hash
end
local function add(a, b)
return a + b
end
local function collect(n)
local out = {}
for i = 1, n do
out[i] = add(i, 2)
end
return out
end
local values = collect(4)
print(values[1], values[2], values[3], values[4])
return values[4]
How it works
The input is parsed before anything is emitted. Comments, strings and member access are preserved as syntax, not concatenated as text.
A hand-written lexer and recursive-descent parser build an AST with declaration identities. Shadowed locals bind to the right declaration, not to a name.
The AST becomes a register IR with typed instructions and explicit call and return arity. A reference interpreter executes the same IR during differential tests.
The IR is packed into a versioned binary payload with a checksum. The emitter writes a Lua interpreter with a seeded opcode permutation, then verifies the payload.
loadstringWorkspace
Sign in to compile with your tokens.
Your build will appear here.
Pricing
One token compiles one script. Plans add a monthly token allowance. Checkout on this deployment is a demo — no payment processor is connected.
$0
5 tokens
$12
25 tokens / month
$39
200 tokens / month
$99
1,000 tokens / month
Documentation
The same compiler runs in the CLI and in the web workspace. Directives are compile-time only and are removed before emission.
# compile a script with a fixed seed
node dist/cli.js obfuscate input.lua output.lua tsvhub-build
# run the reference interpreter on a sample
node dist/cli.js demo
# run the differential test suite
npm test
| Name | Purpose |
|---|---|
OBX_ATTR | Set policy for the file |
OBX_STR | Protect a string literal |
OBX_NUM | Protect a numeric literal |
OBX_ASSERT_INTEGRITY | Emit an integrity check |
OBX_BUILD_ID | Read the build identifier |
OBX_IS_PROTECTED | Branch for protected builds |
local function protectedCalculation(input)
OBX_ATTR(VM("STRONG"), PRESET("SECURE"))
OBX_ASSERT_INTEGRITY()
local label = OBX_STR("calculation")
return label, input * OBX_NUM(17), nil
end
Limits
Published limits are part of the product. These are the current ones, tracked in the implementation ledger.
VM("STRONG") and PRESET("SECURE") are parsed and recorded, but do not yet select a different runtime.
Use your account to build and download artifacts.