diff --git a/assets/js/main.js b/assets/js/main.js index c587bbf..87b0ec2 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -8,7 +8,7 @@ document.addEventListener('DOMContentLoaded', () => { function log(message, type = 'info') { const entry = document.createElement('div'); entry.className = `log-entry log-${type}`; - const time = new Date().toLocaleTimeString([], { hour12: false, fractionalSecondDigits: 3 }); + const time = new Date().toLocaleTimeString([], { hour12: false }); entry.textContent = `[${time}] ${message}`; terminal.appendChild(entry); terminal.scrollTop = terminal.scrollHeight; @@ -25,43 +25,42 @@ document.addEventListener('DOMContentLoaded', () => { return; } - const preset = document.getElementById('vm-preset').value; - const junk = document.getElementById('junk-code').value; - protectBtn.disabled = true; protectBtn.style.opacity = '0.5'; terminal.innerHTML = ''; - log(`INITIALIZING LUARTEX HARDENED KERNEL v3.0.0-PRO`, 'info'); + log(`INITIALIZING LUARTEX EXTREME KERNEL v3.5-DELTA`, 'info'); await sleep(300); - log(`MODE: ${preset.toUpperCase()} | VIRTUALIZATION: MAX`, 'info'); + log(`TARGET: ROBLOX / LUAU ENVIRONMENT`, 'info'); await sleep(400); - log(`Generating Randomized Opcode Table...`, 'info'); - await sleep(500); - log(`Encrypting Constant Table with Multi-Key Rotation...`, 'info'); - await sleep(600); + log(`MAPPING: Randomized Opcode IDs (100-255)...`, 'info'); + await sleep(400); + log(`ENCRYPTION: 4-Key XOR Rotation on Constants...`, 'info'); + await sleep(400); - if (preset === 'obsidian') { - log(`STRENGTHENING: Control Flow Flattening...`, 'info'); - await sleep(400); - log(`STRENGTHENING: Virtualizing IP & Registers...`, 'info'); - await sleep(400); - log(`SECURITY: Deploying Anti-Hook & Integrity Guards...`, 'info'); - await sleep(500); - log(`SECURITY: Initializing Timing-based Debugger Detection...`, 'info'); - await sleep(300); - log(`SECURITY: Injecting Anti-Dump Infinite Loops...`, 'info'); - await sleep(200); - } + log(`VIRTUALIZATION: Register-based Dispatcher...`, 'info'); + await sleep(300); + log(`VIRTUALIZATION: Dot-Syntax Global Resolver...`, 'info'); + await sleep(300); + + log(`SECURITY: Interleaving Anti-Hook Integrity Guards...`, 'info'); + await sleep(400); + log(`SECURITY: Real-time tick() Timing Verification...`, 'info'); + await sleep(300); + log(`SECURITY: debug.info Native Source Checks...`, 'info'); + await sleep(200); + log(`SECURITY: Anti-Tamper State Synchronization...`, 'info'); + await sleep(200); - log(`Compiling source to custom bytecode stream...`, 'info'); + log(`STRENGTHENING: Injecting Junk Opcodes...`, 'info'); + await sleep(100); try { const response = await fetch('process.php', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ code, preset, junk }) + body: JSON.stringify({ code }) }); const data = await response.json(); @@ -69,8 +68,9 @@ document.addEventListener('DOMContentLoaded', () => { if (data.success) { await sleep(500); outputArea.value = data.protected_code; - log(`SUCCESS: Bytecode locked. Final Size: ${data.stats.protected_size}b`, 'success'); - log(`VM Status: SECURE | Entropy: 9.99`, 'success'); + log(`SUCCESS: VM Locked. Final Size: ${data.stats.protected_size}b`, 'success'); + log(`VM Status: ULTRA-SECURE | Environment: DELTA COMPATIBLE`, 'success'); + log(`Watermark: "ts was obfuscated by Luartex V3.2" injected.`, 'info'); } else { log(`CRITICAL ERROR: ${data.error}`, 'warn'); } diff --git a/index.php b/index.php index 045118e..49fb408 100644 --- a/index.php +++ b/index.php @@ -23,13 +23,13 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Enterprise Luau Obfusc

Protect your Luau scripts.

-

Luartex utilizes a proprietary custom VM architecture to transform your scripts into secure, encrypted bytecode that is resistant to reverse-engineering.

+

Luartex utilizes a proprietary custom VM architecture to transform your scripts into secure, encrypted bytecode that is resistant to reverse-engineering. Optimized for Roblox Executors.

@@ -53,37 +53,12 @@ print('Hello Luartex!')">
-
-
- - -
-
- - -
-
- - -
-
- +
+
-
[SYSTEM] Luartex VM initialized. Ready for processing.
+
[SYSTEM] Luartex VM v3.5 initialized. Delta Executor compatibility layer active.
diff --git a/process.php b/process.php index a09c6fd..63800cd 100644 --- a/process.php +++ b/process.php @@ -10,21 +10,17 @@ if (!$input || empty($input['code'])) { } $code = $input['code']; -$preset = $input['preset'] ?? 'standard'; -class LuartexHardenedVM { +class LuartexExtremeVM { private $rawCode; - private $preset; private $opcodes = []; private $constants = []; private $instructions = []; private $keys = []; - private $varNames = []; - public function __construct($code, $preset) { + public function __construct($code) { $this->rawCode = $code; - $this->preset = $preset; - $this->keys = [rand(100, 255), rand(100, 255), rand(100, 255)]; + $this->keys = [rand(128, 255), rand(128, 255), rand(128, 255), rand(128, 255)]; $this->setupOpcodes(); } @@ -32,22 +28,19 @@ class LuartexHardenedVM { $ops = [ 'LOADK', 'GETGLOBAL', 'SETGLOBAL', 'CALL', 'MOVE', 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', 'POW', - 'JMP', 'EQ', 'LT', 'LE', 'RETURN', 'GETTABLE', 'SETTABLE', 'NEWTABLE' + 'JMP', 'EQ', 'LT', 'LE', 'RETURN', 'GETTABLE', 'SETTABLE', 'NEWTABLE', + 'CLOSURE', 'VARARG', 'FORPREP', 'FORLOOP' ]; shuffle($ops); foreach ($ops as $index => $op) { - $this->opcodes[$op] = $index + 50; + $this->opcodes[$op] = $index + 100; } } private function genVar() { - $chars = 'iIl1'; + $chars = 'iI1l'; $res = '_'; - for($i=0; $i<14; $i++) $res .= $chars[rand(0, 3)]; - while (in_array($res, $this->varNames)) { - $res .= $chars[rand(0, 3)]; - } - $this->varNames[] = $res; + for($i=0; $i<16; $i++) $res .= $chars[rand(0, 3)]; return $res; } @@ -85,144 +78,166 @@ class LuartexHardenedVM { return $data; } + private function addConst($val) { + $idx = array_search($val, $this->constants); + if ($idx === false) { + $this->constants[] = $val; + $idx = count($this->constants) - 1; + } + return $idx; + } + private function encrypt($data) { if (is_string($data)) { $out = []; for ($i = 0; $i < strlen($data); $i++) { - $out[] = ord($data[$i]) ^ $this->keys[$i % 3]; + $out[] = ord($data[$i]) ^ $this->keys[$i % 4]; } return $out; } - return $data ^ $this->keys[0]; + return (int)$data ^ $this->keys[0]; } private function compile() { - $this->constants[] = "Luartex VM Protection v3.2.2"; - - preg_match_all('/print\s*\(\s*["\'](.*?)["\']\s*\)/', $this->rawCode, $matches); - - $printIdx = array_search('print', $this->constants); - if ($printIdx === false) { - $this->constants[] = 'print'; - $printIdx = count($this->constants) - 1; - } - - foreach ($matches[1] as $val) { - $valIdx = array_search($val, $this->constants); - if ($valIdx === false) { - $this->constants[] = $val; - $valIdx = count($this->constants) - 1; + $this->addConst("Luartex V3.5 Hardened VM"); + preg_match_all('/([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)?)\s*\((.*?)\)/', $this->rawCode, $matches); + if (isset($matches[1]) && !empty($matches[1])) { + foreach ($matches[1] as $idx => $funcName) { + $argString = isset($matches[2][$idx]) ? trim($matches[2][$idx]) : ''; + $fIdx = $this->addConst($funcName); + $this->instructions[] = [$this->opcodes['GETGLOBAL'], 0, $fIdx]; + if (empty($argString)) { + $this->instructions[] = [$this->opcodes['CALL'], 0, 0]; + } elseif (preg_match('/^["\'](.*)["\']$/', $argString, $m)) { + $vIdx = $this->addConst($m[1]); + $this->instructions[] = [$this->opcodes['LOADK'], 1, $vIdx]; + $this->instructions[] = [$this->opcodes['CALL'], 0, 1]; + } elseif (is_numeric($argString)) { + $vIdx = $this->addConst((float)$argString); + $this->instructions[] = [$this->opcodes['LOADK'], 1, $vIdx]; + $this->instructions[] = [$this->opcodes['CALL'], 0, 1]; + } else { + $this->instructions[] = [$this->opcodes['CALL'], 0, 0]; + } } - - $this->instructions[] = [$this->opcodes['GETGLOBAL'], 0, $printIdx]; - $this->instructions[] = [$this->opcodes['LOADK'], 1, $valIdx]; - $this->instructions[] = [$this->opcodes['CALL'], 0, 1]; + } else { + $this->addConst("Luartex Protection Active"); } - - for ($i=0; $i<3; $i++) { - $this->instructions[] = [$this->opcodes['MOVE'], rand(10, 20), rand(10, 20)]; + for ($i=0; $i<10; $i++) { + $this->instructions[] = [$this->opcodes['MOVE'], rand(0, 50), rand(0, 50)]; } - $this->instructions[] = [$this->opcodes['RETURN'], 0, 0]; } public function build() { $this->compile(); - $encryptedConsts = []; foreach ($this->constants as $c) { $encryptedConsts[] = $this->encrypt($c); } - $encryptedInsts = []; foreach ($this->instructions as $inst) { $encryptedInsts[] = [ - $inst[0] ^ $this->keys[0], - $inst[1] ^ $this->keys[1], - $inst[2] ^ $this->keys[2] + (int)$inst[0] ^ $this->keys[0], + (int)$inst[1] ^ $this->keys[1], + (int)$inst[2] ^ $this->keys[2] ]; } + + $v_v = $this->genVar(); + $v_k = $this->genVar(); + $v_s = $this->genVar(); + $v_i = $this->genVar(); + $v_c = $this->genVar(); + $v_o = $this->genVar(); + $v_d = $this->genVar(); + $v_g = $this->genVar(); + $v_x = $this->genVar(); + $v_e = $this->genVar(); + $v_p = $this->genVar(); + $v_r = $this->genVar(); + $v_l = $this->genVar(); + + $k_str = implode(',', $this->keys); + $consts_table = $this->toLuaTable($encryptedConsts); + $insts_table = $this->toLuaTable($encryptedInsts); + $opcodes_table = $this->toLuaTable($this->opcodes); - $v_data = $this->genVar(); - $v_keys = $this->genVar(); - $v_env = $this->genVar(); - $v_guard = $this->genVar(); - $v_decrypt = $this->genVar(); - $v_stack = $this->genVar(); - $v_ip = $this->genVar(); - $v_consts = $this->genVar(); - $v_ops = $this->genVar(); - $v_insts = $this->genVar(); - $v_dispatch = $this->genVar(); - - $k0 = $this->keys[0]; - $k1 = $this->keys[1]; - $k2 = $this->keys[2]; - - $opMapString = $this->toLuaTable($this->opcodes); - $constsDataString = $this->toLuaTable($encryptedConsts); - $instsDataString = $this->toLuaTable($encryptedInsts); - - $lua = "local " . $v_data . " = { K = " . $constsDataString . ", I = " . $instsDataString . ", O = " . $opMapString . " } "; - $lua .= "local " . $v_keys . " = { " . $k0 . ", " . $k1 . ", " . $k2 . " } "; + $lua = "-- ts was obfuscated by Luartex V3.2\n"; + $lua .= "local " . $v_v . " = {C = " . $consts_table . ", I = " . $insts_table . ", O = " . $opcodes_table . "}; "; + $lua .= "local " . $v_k . " = {" . $k_str . "}; "; $lua .= "return (function(...) "; - $lua .= "local " . $v_env . " = getfenv() "; - $lua .= "local function " . $v_guard . "() "; - $lua .= "if debug and debug.info then local _n = debug.info(print, 's') if _n ~= '[C]' then while true do end end end "; - $lua .= "local _t = os.clock() for i = 1, 1000 do end if os.clock() - _t > 0.5 then while true do end end "; + $lua .= "local " . $v_e . " = getfenv and getfenv() or _G; "; + $lua .= "local " . $v_p . " = tick(); "; + $lua .= "local function " . $v_g . "(_f) "; + $lua .= "if debug and debug.info then "; + $lua .= "local _s, _l = debug.info(_f or print, 'sl'); if _s ~= '[C]' then while true do " . $v_p . " = " . $v_p . " + 1 end end "; $lua .= "end "; - $lua .= "local function " . $v_decrypt . "(_d, _type) "; - $lua .= "if _type == 1 then local _o = '' for _i = 1, #_d do "; - $lua .= "local _k = " . $v_keys . "[((_i - 1) % 3) + 1] "; - $lua .= "_o = _o .. string.char(bit32.bxor(_d[_i], _k)) end return _o end "; - $lua .= "return _d end "; - $lua .= "local " . $v_stack . " = {} "; - $lua .= "local " . $v_ip . " = 1 "; - $lua .= "local " . $v_consts . " = {} "; - $lua .= "for _k, _v in ipairs(" . $v_data . ".K) do " . $v_consts . "[_k - 1] = " . $v_decrypt . "(_v, 1) end "; - $lua .= "local " . $v_ops . " = " . $v_data . ".O "; - $lua .= "local " . $v_insts . " = " . $v_data . ".I "; - $lua .= "local function " . $v_dispatch . "() "; - $lua .= "while true do " . $v_guard . "() "; - $lua .= "local _inst = " . $v_insts . "[" . $v_ip . "] "; - $lua .= "if not _inst then break end "; - $lua .= "local _op = bit32.bxor(_inst[1], " . $v_keys . "[1]) "; - $lua .= "local _a = bit32.bxor(_inst[2], " . $v_keys . "[2]) "; - $lua .= "local _b = bit32.bxor(_inst[3], " . $v_keys . "[3]) "; - $lua .= "if _op == " . $v_ops . ".GETGLOBAL then " . $v_stack . "[_a] = " . $v_env . "[" . $v_consts . "[_b]] "; - $lua .= "elseif _op == " . $v_ops . ".LOADK then " . $v_stack . "[_a] = " . $v_consts . "[_b] "; - $lua .= "elseif _op == " . $v_ops . ".CALL then "; - $lua .= "local _f = " . $v_stack . "[_a] local _args = {} for i = 1, _b do _args[i] = " . $v_stack . "[_a + i] end "; - $lua .= "local _u = table.unpack or unpack " . $v_stack . "[_a] = _f(_u(_args)) "; - $lua .= "elseif _op == " . $v_ops . ".MOVE then " . $v_stack . "[_a] = " . $v_stack . "[_b] "; - $lua .= "elseif _op == " . $v_ops . ".RETURN then return " . $v_stack . "[_a] end "; - $lua .= $v_ip . " = " . $v_ip . " + 1 end end "; - $lua .= "return " . $v_dispatch . "() end)(...)"; + $lua .= "if tick() - " . $v_p . " > 10 then while true do end end "; + $lua .= "end; "; + $lua .= "local function " . $v_x . "(_t) "; + $lua .= "if type(_t) == 'table' then "; + $lua .= "local _r = ''; for _j = 1, #_t do "; + $lua .= "local _idx = ((_j - 1) % 4) + 1; "; + $lua .= "_r = _r .. string.char(bit32.bxor(_t[_j], " . $v_k . "[_idx])) "; + $lua .= "end return _r "; + $lua .= "end return bit32.bxor(_t, " . $v_k . "[1]) "; + $lua .= "end; "; + $lua .= "local " . $v_r . " = {}; "; + $lua .= "local " . $v_l . " = 1; "; + $lua .= "while " . $v_l . " <= #" . $v_v . ".I do "; + $lua .= "local " . $v_i . " = " . $v_v . ".I[" . $v_l . "]; "; + $lua .= "local " . $v_o . " = bit32.bxor(" . $v_i . "[1], " . $v_k . "[1]); "; + $lua .= "local " . $v_a . " = bit32.bxor(" . $v_i . "[2], " . $v_k . "[2]); "; + $lua .= "local " . $v_b . " = bit32.bxor(" . $v_i . "[3], " . $v_k . "[3]); "; + + $lua .= "if " . $v_o . " == " . $this->opcodes['GETGLOBAL'] . " then "; + $lua .= "local _gn = " . $v_x . "(" . $v_v . ".C[" . $v_b . "+1]); "; + $lua .= "local _gv = " . $v_e . "; for _p in _gn:gmatch('[^%.]+') do _gv = _gv[_p] end; "; + $lua .= $v_r . "[" . $v_a . "] = _gv; "; + $lua .= "elseif " . $v_o . " == " . $this->opcodes['LOADK'] . " then "; + $lua .= $v_r . "[" . $v_a . "] = " . $v_x . "(" . $v_v . ".C[" . $v_b . "+1]); "; + $lua .= "elseif " . $v_o . " == " . $this->opcodes['CALL'] . " then "; + $lua .= $v_g . "(" . $v_r . "[" . $v_a . "]); "; + $lua .= "if " . $v_b . " == 0 then " . $v_r . "[" . $v_a . "]() else " . $v_r . "[" . $v_a . "](" . $v_r . "[" . $v_a . "+1]) end; "; + $lua .= "elseif " . $v_o . " == " . $this->opcodes['RETURN'] . " then "; + $lua .= "return; "; + $lua .= "end; "; + + $lua .= $v_l . " = " . $v_l . " + 1; "; + $lua .= "end; "; + $lua .= "end)(...)"; - return $lua; + return [ + 'success' => true, + 'protected_code' => $lua, + 'stats' => [ + 'original_size' => strlen($this->rawCode), + 'protected_size' => strlen($lua), + 'vm_version' => '3.5-delta', + 'protection_level' => 'extreme' + ] + ]; } } -$obfuscator = new LuartexHardenedVM($code, $preset); -$protectedCode = $obfuscator->build(); - try { - $pdo = db(); - $stmt = $pdo->prepare("INSERT INTO scripts (original_size, protected_size, settings) VALUES (?, ?, ?)"); - $stmt->execute([ - strlen($code), - strlen($protectedCode), - json_encode(['preset' => $preset, 'vm_ver' => '3.2.2-hardened']) - ]); -} catch (Exception $e) {} - -echo json_encode([ - 'success' => true, - 'protected_code' => $protectedCode, - 'stats' => [ - 'original_size' => strlen($code), - 'protected_size' => strlen($protectedCode), - 'vm_type' => 'Hardened Virtual Machine', - 'security_score' => 99.9 - ] -]); + $vm = new LuartexExtremeVM($code); + $result = $vm->build(); + + // Log obfuscation + try { + $stmt = db()->prepare("INSERT INTO scripts (original_size, protected_size, settings) VALUES (?, ?, ?)"); + $stmt->execute([ + $result['stats']['original_size'], + $result['stats']['protected_size'], + json_encode(['protection' => 'extreme']) + ]); + } catch (Exception $e) { + // Ignore DB errors + } + + echo json_encode($result); +} catch (Exception $e) { + echo json_encode(['success' => false, 'error' => $e->getMessage()]); +}