From 02765b34dcdb67bfd8cd68744dad902eaa13a9d9 Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 05:41:14 +0600 Subject: [PATCH 01/10] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4040509..c25c01f 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# :fire: Prometheus +# :fire: Prometheus 3 [![Test](https://github.com/prometheus-lua/Prometheus/actions/workflows/Test.yml/badge.svg)](https://github.com/prometheus-lua/Prometheus/actions/workflows/Test.yml) ## Description Prometheus is a Lua obfuscator written in pure Lua. From 56c5dd68a63ee7234b53d1bae70bfb6c6f89e605 Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 05:47:36 +0600 Subject: [PATCH 02/10] Create server.js --- server.js | 472 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 server.js diff --git a/server.js b/server.js new file mode 100644 index 0000000..8ceb902 --- /dev/null +++ b/server.js @@ -0,0 +1,472 @@ +const express = require('express'); +const bodyParser = require('body-parser'); +const cors = require('cors'); + +const app = express(); +const PORT = process.env.PORT || 3000; + +app.use(cors()); +app.use(bodyParser.json({ limit: '50mb' })); +app.use(bodyParser.urlencoded({ extended: true, limit: '50mb' })); + +// Homepage dengan UI +app.get('/', (req, res) => { + res.send(` + + + + + + Prometheus Obfuscator + + + +
+

🔒 Prometheus Obfuscator

+

Advanced Lua Script Obfuscator • Self-Hosted Edition

+ +
+

⚙️ Obfuscation Settings

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
0
+
Input Size (bytes)
+
+
+
0
+
Output Size (bytes)
+
+
+
0%
+
Size Increase
+
+
+ +
+
+

📝 Input Script

+ +
+
+

🔐 Obfuscated Output

+ +
+
+ +
+ + + + +
+ +
+ +
+

Prometheus Obfuscator • Self-Hosted • Made with ❤️

+
+
+ + + + + `); +}); + +// API Obfuscate +app.post('/api/obfuscate', (req, res) => { + try { + const { script, settings } = req.body; + + if (!script || typeof script !== 'string') { + return res.json({ success: false, error: 'No script provided' }); + } + + const result = obfuscateScript(script, settings || {}); + res.json({ success: true, result: result }); + + } catch (error) { + res.json({ success: false, error: error.message }); + } +}); + +// Obfuscator Engine +function obfuscateScript(script, settings) { + let result = script; + + function randomVar(len = 8) { + const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'; + let r = chars[Math.floor(Math.random() * 53)]; + for (let i = 1; i < len; i++) r += chars[Math.floor(Math.random() * 53)]; + return r; + } + + function randomNum() { return Math.floor(Math.random() * 9000) + 1000; } + + const reserved = ['and','break','do','else','elseif','end','false','for','function','goto','if','in','local','nil','not','or','repeat','return','then','true','until','while','game','workspace','script','Instance','Vector3','CFrame','Color3','UDim2','Enum','math','string','table','coroutine','print','warn','error','pcall','xpcall','loadstring','require','spawn','wait','task','tick','typeof','type','tostring','tonumber','pairs','ipairs','next','select','unpack','setmetatable','getmetatable','rawget','rawset','getfenv','setfenv','getgenv','getrenv']; + + // String encoding + if (settings.strEncode !== false) { + result = result.replace(/"([^"\\]*(\\.[^"\\]*)*)"/g, (m, s) => { + if (!s || s.length > 80 || s.length === 0) return m; + return 'string.char(' + [...s].map(c => c.charCodeAt(0)).join(',') + ')'; + }); + result = result.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, (m, s) => { + if (!s || s.length > 80 || s.length === 0) return m; + return 'string.char(' + [...s].map(c => c.charCodeAt(0)).join(',') + ')'; + }); + } + + // Variable renaming + if (settings.varRename !== false) { + const varMap = new Map(); + const localPattern = /local\s+([a-zA-Z_][a-zA-Z0-9_]*)/g; + let match; + while ((match = localPattern.exec(script)) !== null) { + const v = match[1]; + if (!varMap.has(v) && !reserved.includes(v)) { + varMap.set(v, randomVar(6 + Math.floor(Math.random() * 6))); + } + } + varMap.forEach((newN, oldN) => { + result = result.replace(new RegExp('\\b' + oldN + '\\b', 'g'), newN); + }); + } + + // Number obfuscation + if (settings.numObfuscate) { + result = result.replace(/\b(\d+)\b/g, (m, n) => { + const num = parseInt(n); + if (isNaN(num) || num > 10000) return m; + const a = Math.floor(Math.random() * num); + const b = num - a; + return '(' + a + '+' + b + ')'; + }); + } + + // Add junk code + if (settings.addJunk !== false) { + const junk = []; + for (let i = 0; i < 5; i++) { + junk.push('local ' + randomVar(10) + '=' + randomNum() + ';'); + } + junk.push('local ' + randomVar(8) + '=function()return ' + randomNum() + ' end;'); + result = junk.join('') + result; + } + + // Control flow + if (settings.controlFlow !== false) { + const marker = randomVar(6); + result = 'local ' + marker + '=true;if ' + marker + ' then ' + result + ' end;'; + } + + // Wrap in function + if (settings.wrapCode !== false) { + const fn = randomVar(12); + result = 'local ' + fn + '=(function()' + result + ' end);return ' + fn + '();'; + } + + // Header + result = '-- Obfuscated with Prometheus Web | ' + new Date().toISOString().split('T')[0] + '\\n' + result; + + return result; +} + +// Health check +app.get('/health', (req, res) => res.json({ status: 'ok' })); + +app.listen(PORT, () => console.log('🚀 Server running on port ' + PORT)); From bdd45af047a241d418fdc479a3adf69791fa1bc8 Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 05:48:28 +0600 Subject: [PATCH 03/10] Create package.json --- package.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..d3fc876 --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "prometheus-web", + "version": "1.0.0", + "description": "Prometheus Lua Obfuscator Web Interface", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.18.2", + "body-parser": "^1.20.2", + "cors": "^2.8.5", + "multer": "^1.4.5-lts.1" + }, + "engines": { + "node": ">=18.0.0" + } +} From 006c30b53e6aa9f431b509a0cc60542a86a32b9e Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 11:50:24 +0600 Subject: [PATCH 04/10] Create Dockerfile --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8380370 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18-alpine + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install --production + +COPY . . + +EXPOSE 3000 + +CMD ["node", "server.js"] From df83785ef626fc094ba814e57eda7a60917b3b4d Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 12:03:21 +0600 Subject: [PATCH 05/10] Update server.js --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 8ceb902..f9fd23d 100644 --- a/server.js +++ b/server.js @@ -461,7 +461,7 @@ function obfuscateScript(script, settings) { } // Header - result = '-- Obfuscated with Prometheus Web | ' + new Date().toISOString().split('T')[0] + '\\n' + result; + result = '-- Obfuscated with Prometheus Web | ' + new Date().toISOString().split('T')[0] + '\n' + result; return result; } From 4f875eba2489cffc10cc755b9b5f5993d6268097 Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 12:11:39 +0600 Subject: [PATCH 06/10] Update server.js --- server.js | 895 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 590 insertions(+), 305 deletions(-) diff --git a/server.js b/server.js index f9fd23d..16587b2 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,7 @@ const express = require('express'); const bodyParser = require('body-parser'); const cors = require('cors'); +const crypto = require('crypto'); const app = express(); const PORT = process.env.PORT || 3000; @@ -9,7 +10,7 @@ app.use(cors()); app.use(bodyParser.json({ limit: '50mb' })); app.use(bodyParser.urlencoded({ extended: true, limit: '50mb' })); -// Homepage dengan UI +// Homepage dengan UI Advanced app.get('/', (req, res) => { res.send(` @@ -17,213 +18,163 @@ app.get('/', (req, res) => { - Prometheus Obfuscator + Prometheus Advanced Obfuscator
-

🔒 Prometheus Obfuscator

-

Advanced Lua Script Obfuscator • Self-Hosted Edition

+

🔐 Prometheus Advanced

+

Enterprise-Grade Lua Obfuscator • Luraph-Style Protection

+ +
+ 🔄 Control Flow + 🔐 String Encryption + 🎭 VM Wrapper + 🛡️ Anti-Debug + 💀 Dead Code + 🔢 Constant Folding +
-

⚙️ Obfuscation Settings

+

⚙️ Protection Settings

-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - +
+
+
+
+
+
+
+
+
+
+
+
+

🎚️ Obfuscation Level

+
+ + + + +
-
-
0
-
Input Size (bytes)
-
-
-
0
-
Output Size (bytes)
-
-
-
0%
-
Size Increase
-
+
0
Input (bytes)
+
0
Output (bytes)
+
0x
Size Ratio
+
0
Strings Encrypted
@@ -231,21 +182,24 @@ app.get('/', (req, res) => {

📝 Input Script

-

🔐 Obfuscated Output

- +

🔐 Protected Output

+
- + @@ -253,31 +207,50 @@ example()">
-
-

Prometheus Obfuscator • Self-Hosted • Made with ❤️

-
+
Prometheus Advanced Obfuscator • Luraph-Style Protection • Self-Hosted
@@ -367,106 +326,432 @@ example()"> `); }); -// API Obfuscate -app.post('/api/obfuscate', (req, res) => { - try { - const { script, settings } = req.body; - - if (!script || typeof script !== 'string') { - return res.json({ success: false, error: 'No script provided' }); +// ==================== ADVANCED OBFUSCATOR ENGINE ==================== + +class LuaObfuscator { + constructor(settings = {}) { + this.settings = settings; + this.level = settings.level || 3; + this.stats = { stringsEncrypted: 0, varsRenamed: 0 }; + this.encryptionKey = this.generateKey(16); + this.varCounter = 0; + this.stringTable = []; + this.reserved = new Set([ + 'and','break','do','else','elseif','end','false','for','function','goto', + 'if','in','local','nil','not','or','repeat','return','then','true','until','while', + 'game','workspace','script','Instance','Vector3','CFrame','Vector2','Color3', + 'BrickColor','UDim2','UDim','Enum','Ray','Region3','Rect','math','string','table', + 'coroutine','os','debug','bit32','utf8','print','warn','error','assert','pcall', + 'xpcall','loadstring','require','spawn','delay','wait','task','tick','time','typeof', + 'type','tostring','tonumber','pairs','ipairs','next','select','unpack','pack', + 'setmetatable','getmetatable','rawget','rawset','rawequal','rawlen', + 'getfenv','setfenv','getgenv','getrenv','setreadonly','getrawmetatable', + 'hookfunction','hookmetamethod','newcclosure','islclosure','iscclosure', + 'checkcaller','getcallingscript','getnamecallmethod','setnamecallmethod', + 'firetouchinterest','fireproximityprompt','fireclickdetector', + 'getsenv','getmenv','getscriptclosure','getscripts','getrunningscripts', + 'getcustomasset','getsynasset','isrbxactive','setclipboard','setfflag', + 'Drawing','cleardrawcache','getrenderproperty','setrenderproperty','isrenderobj', + '_G','shared','_VERSION','self' + ]); + } + + generateKey(length) { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let result = ''; + for (let i = 0; i < length; i++) { + result += chars.charAt(Math.floor(Math.random() * chars.length)); } - - const result = obfuscateScript(script, settings || {}); - res.json({ success: true, result: result }); - - } catch (error) { - res.json({ success: false, error: error.message }); + return result; } -}); -// Obfuscator Engine -function obfuscateScript(script, settings) { - let result = script; - - function randomVar(len = 8) { + randomVar(prefix = '') { const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'; - let r = chars[Math.floor(Math.random() * 53)]; - for (let i = 1; i < len; i++) r += chars[Math.floor(Math.random() * 53)]; - return r; + const allChars = chars + '0123456789'; + let length = 8 + Math.floor(Math.random() * 8); + let result = prefix + chars[Math.floor(Math.random() * chars.length)]; + for (let i = 1; i < length; i++) { + result += allChars[Math.floor(Math.random() * allChars.length)]; + } + this.varCounter++; + return result; } - - function randomNum() { return Math.floor(Math.random() * 9000) + 1000; } - - const reserved = ['and','break','do','else','elseif','end','false','for','function','goto','if','in','local','nil','not','or','repeat','return','then','true','until','while','game','workspace','script','Instance','Vector3','CFrame','Color3','UDim2','Enum','math','string','table','coroutine','print','warn','error','pcall','xpcall','loadstring','require','spawn','wait','task','tick','typeof','type','tostring','tonumber','pairs','ipairs','next','select','unpack','setmetatable','getmetatable','rawget','rawset','getfenv','setfenv','getgenv','getrenv']; - - // String encoding - if (settings.strEncode !== false) { - result = result.replace(/"([^"\\]*(\\.[^"\\]*)*)"/g, (m, s) => { - if (!s || s.length > 80 || s.length === 0) return m; - return 'string.char(' + [...s].map(c => c.charCodeAt(0)).join(',') + ')'; - }); - result = result.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, (m, s) => { - if (!s || s.length > 80 || s.length === 0) return m; - return 'string.char(' + [...s].map(c => c.charCodeAt(0)).join(',') + ')'; - }); + + randomILVar() { + // Generate IL-style variable like Luraph uses: IlIlIlIl + const chars = ['I', 'l', '1']; + let result = chars[Math.floor(Math.random() * 2)]; // Start with I or l + let length = 10 + Math.floor(Math.random() * 10); + for (let i = 1; i < length; i++) { + result += chars[Math.floor(Math.random() * chars.length)]; + } + return result; } - - // Variable renaming - if (settings.varRename !== false) { - const varMap = new Map(); - const localPattern = /local\s+([a-zA-Z_][a-zA-Z0-9_]*)/g; - let match; - while ((match = localPattern.exec(script)) !== null) { - const v = match[1]; - if (!varMap.has(v) && !reserved.includes(v)) { - varMap.set(v, randomVar(6 + Math.floor(Math.random() * 6))); - } + + randomInt(min = 1000, max = 99999) { + return Math.floor(Math.random() * (max - min + 1)) + min; + } + + randomHex(length = 8) { + return '0x' + crypto.randomBytes(length / 2).toString('hex').toUpperCase(); + } + + // XOR encryption for strings + xorEncrypt(str, key) { + let result = []; + for (let i = 0; i < str.length; i++) { + result.push(str.charCodeAt(i) ^ key.charCodeAt(i % key.length)); } - varMap.forEach((newN, oldN) => { - result = result.replace(new RegExp('\\b' + oldN + '\\b', 'g'), newN); - }); + return result; } - - // Number obfuscation - if (settings.numObfuscate) { - result = result.replace(/\b(\d+)\b/g, (m, n) => { - const num = parseInt(n); - if (isNaN(num) || num > 10000) return m; - const a = Math.floor(Math.random() * num); - const b = num - a; - return '(' + a + '+' + b + ')'; - }); + + // Generate string decryption function + generateStringDecryptor() { + const funcName = this.randomILVar(); + const keyVar = this.randomILVar(); + const dataVar = this.randomILVar(); + const resultVar = this.randomILVar(); + const indexVar = this.randomILVar(); + + return { + name: funcName, + code: `local ${funcName}=(function(${dataVar},${keyVar})local ${resultVar}="";for ${indexVar}=1,#${dataVar} do ${resultVar}=${resultVar}..string.char(bit32.bxor(${dataVar}[${indexVar}],string.byte(${keyVar},(${indexVar}-1)%#${keyVar}+1)));end;return ${resultVar};end);` + }; + } + + // Convert number to complex expression + obfuscateNumber(num) { + if (this.level < 2) return num.toString(); + + const methods = [ + // Method 1: Addition + () => { + const a = Math.floor(Math.random() * num); + const b = num - a; + return `(${a}+${b})`; + }, + // Method 2: Subtraction + () => { + const a = num + Math.floor(Math.random() * 1000); + const b = a - num; + return `(${a}-${b})`; + }, + // Method 3: XOR + () => { + const a = Math.floor(Math.random() * 65535); + const b = num ^ a; + return `bit32.bxor(${a},${b})`; + }, + // Method 4: Multiplication/Division + () => { + const divisors = [2, 4, 5, 8, 10, 16, 20, 25]; + for (const d of divisors) { + if (num % d === 0) { + return `(${num/d}*${d})`; + } + } + return num.toString(); + }, + // Method 5: Nested + () => { + const a = Math.floor(num / 2); + const b = num - a; + const c = Math.floor(Math.random() * 100); + return `((${a}+${b})+${c}-${c})`; + } + ]; + + const method = methods[Math.floor(Math.random() * methods.length)]; + return method(); + } + + // Encrypt string and add to table + encryptString(str) { + if (str.length === 0) return '""'; + if (str.length > 200) return null; // Skip very long strings + + this.stats.stringsEncrypted++; + const encrypted = this.xorEncrypt(str, this.encryptionKey); + + return { + data: `{${encrypted.join(',')}}`, + key: `"${this.encryptionKey}"` + }; } - - // Add junk code - if (settings.addJunk !== false) { + + // Generate junk code that looks real + generateJunkCode(count = 5) { const junk = []; - for (let i = 0; i < 5; i++) { - junk.push('local ' + randomVar(10) + '=' + randomNum() + ';'); + + for (let i = 0; i < count; i++) { + const type = Math.floor(Math.random() * 8); + const v1 = this.randomILVar(); + const v2 = this.randomILVar(); + const v3 = this.randomILVar(); + const n1 = this.randomInt(); + const n2 = this.randomInt(); + + switch (type) { + case 0: + junk.push(`local ${v1}=${n1};`); + break; + case 1: + junk.push(`local ${v1}=${n1};local ${v2}=${v1}+${n2};`); + break; + case 2: + junk.push(`local ${v1}=function()return ${n1} end;`); + break; + case 3: + junk.push(`local ${v1}={${n1},${n2}};`); + break; + case 4: + junk.push(`local ${v1}=bit32.bxor(${n1},${n2});`); + break; + case 5: + junk.push(`local ${v1}=(function()local ${v2}=${n1};return ${v2}+${n2} end)();`); + break; + case 6: + junk.push(`local ${v1}=string.rep("",0);`); + break; + case 7: + junk.push(`local ${v1},${v2}=${n1},${n2};local ${v3}=${v1}*${v2};`); + break; + } } - junk.push('local ' + randomVar(8) + '=function()return ' + randomNum() + ' end;'); - result = junk.join('') + result; + + return junk.join(''); } - - // Control flow - if (settings.controlFlow !== false) { - const marker = randomVar(6); - result = 'local ' + marker + '=true;if ' + marker + ' then ' + result + ' end;'; + + // Generate opaque predicates (always true/false but looks complex) + generateOpaquePredicate(isTrue = true) { + const v = this.randomILVar(); + const n1 = this.randomInt(1, 1000); + const n2 = this.randomInt(1, 1000); + + const truePredicates = [ + `(${n1}*${n1}>=${n1})`, + `(type("")=="string")`, + `(${n1}==${n1})`, + `(bit32.band(${n1},0)==0 or bit32.band(${n1},0)~=0)`, + `((${n1}+${n2})-(${n2})==${n1})`, + `(not not true)`, + `(#""==0)`, + `(math.abs(-${n1})==${n1})` + ]; + + const falsePredicates = [ + `(${n1}>${n1})`, + `(type("")=="number")`, + `(${n1}==${n1+1})`, + `(#""~=0)`, + `(nil)`, + `(false)`, + `(not true)` + ]; + + const predicates = isTrue ? truePredicates : falsePredicates; + return predicates[Math.floor(Math.random() * predicates.length)]; } - - // Wrap in function - if (settings.wrapCode !== false) { - const fn = randomVar(12); - result = 'local ' + fn + '=(function()' + result + ' end);return ' + fn + '();'; + + // Generate anti-debug checks + generateAntiDebug() { + const checks = []; + const errorVar = this.randomILVar(); + const checkVar = this.randomILVar(); + + // Check for common debug tools + checks.push(` +local ${checkVar}=(function() +local ${errorVar}=false; +pcall(function() +if getgenv then +local _g=getgenv(); +if _g.SimpleSpy or _g.RemoteSpy or _g.HttpSpy or _g.Hydroxide or _g.Dex or _g.DarkDex then +${errorVar}=true; +end; +end; +end); +if ${errorVar} then return nil end; +return true; +end)(); +if not ${checkVar} then return end; +`); + + return checks.join(''); + } + + // Generate environment wrapper + generateEnvWrapper() { + const envVar = this.randomILVar(); + const wrapperVar = this.randomILVar(); + + return `local ${envVar}=setmetatable({},{__index=function(self,key)return rawget(self,key)or getfenv()[key]or _G[key]end,__newindex=function(self,key,value)rawset(self,key,value)end});setfenv(1,${envVar});`; + } + + // Main obfuscation function + obfuscate(script) { + let result = script; + const stringDecryptor = this.generateStringDecryptor(); + let needsDecryptor = false; + + // Step 1: String Encryption + if (this.settings.strEncrypt !== false) { + // Handle double-quoted strings + result = result.replace(/"([^"\\]*(\\.[^"\\]*)*)"/g, (match, content) => { + if (content.length === 0 || content.length > 150) return match; + const encrypted = this.encryptString(content); + if (encrypted) { + needsDecryptor = true; + return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; + } + return match; + }); + + // Handle single-quoted strings + result = result.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, (match, content) => { + if (content.length === 0 || content.length > 150) return match; + const encrypted = this.encryptString(content); + if (encrypted) { + needsDecryptor = true; + return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; + } + return match; + }); + } + + // Step 2: Variable Mangling + if (this.settings.varMangle !== false) { + const varMap = new Map(); + const localPattern = /local\s+([a-zA-Z_][a-zA-Z0-9_]*)/g; + let match; + + const tempScript = script; + while ((match = localPattern.exec(tempScript)) !== null) { + const varName = match[1]; + if (!varMap.has(varName) && !this.reserved.has(varName)) { + varMap.set(varName, this.randomILVar()); + this.stats.varsRenamed++; + } + } + + varMap.forEach((newName, oldName) => { + const regex = new RegExp(`\\b${oldName}\\b`, 'g'); + result = result.replace(regex, newName); + }); + } + + // Step 3: Constant Folding (Number Obfuscation) + if (this.settings.constFold !== false && this.level >= 2) { + result = result.replace(/\b(\d+)\b/g, (match, num) => { + const n = parseInt(num); + if (isNaN(n) || n > 100000 || n < 0) return match; + if (Math.random() > 0.7) return match; // Skip some for variation + return this.obfuscateNumber(n); + }); + } + + // Step 4: Build final output + let output = []; + + // Add header + output.push(`-- Protected with Prometheus Advanced | ${new Date().toISOString().split('T')[0]}`); + output.push(`-- Level: ${this.level} | Strings: ${this.stats.stringsEncrypted} | Vars: ${this.stats.varsRenamed}`); + + // Add VM wrapper start + if (this.settings.vmWrapper !== false) { + const vmFunc = this.randomILVar(); + const vmEnv = this.randomILVar(); + output.push(`local ${vmFunc}=(function()`); + + // Add environment wrapper + if (this.settings.envWrapper !== false) { + output.push(this.generateEnvWrapper()); + } + + // Add anti-debug + if (this.settings.antiDebug !== false) { + output.push(this.generateAntiDebug()); + } + + // Add junk code + if (this.settings.deadCode !== false) { + output.push(this.generateJunkCode(5 + this.level * 2)); + } + + // Add string decryptor if needed + if (needsDecryptor) { + output.push(stringDecryptor.code); + } + + // Add control flow + if (this.settings.controlFlow !== false) { + const condVar = this.randomILVar(); + const predicate = this.generateOpaquePredicate(true); + output.push(`local ${condVar}=${predicate};`); + output.push(`if ${condVar} then`); + + // More junk + if (this.settings.deadCode !== false) { + output.push(this.generateJunkCode(3)); + } + + output.push(result); + output.push('end;'); + } else { + output.push(result); + } + + output.push(`end);return ${vmFunc}();`); + } else { + // Simple wrapper without VM + if (needsDecryptor) { + output.push(stringDecryptor.code); + } + if (this.settings.deadCode !== false) { + output.push(this.generateJunkCode(3)); + } + output.push(result); + } + + // Add watermark if enabled + if (this.settings.watermark) { + const wmVar = this.randomILVar(); + output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + } + + return output.join('\n'); } - - // Header - result = '-- Obfuscated with Prometheus Web | ' + new Date().toISOString().split('T')[0] + '\n' + result; - - return result; } +// API Endpoint +app.post('/api/obfuscate', (req, res) => { + try { + const { script, settings } = req.body; + + if (!script || typeof script !== 'string') { + return res.json({ success: false, error: 'No script provided' }); + } + + if (script.length > 500000) { + return res.json({ success: false, error: 'Script too large (max 500KB)' }); + } + + const obfuscator = new LuaObfuscator(settings || {}); + const result = obfuscator.obfuscate(script); + + res.json({ + success: true, + result: result, + stats: obfuscator.stats + }); + + } catch (error) { + console.error('Obfuscation error:', error); + res.json({ success: false, error: error.message }); + } +}); + // Health check -app.get('/health', (req, res) => res.json({ status: 'ok' })); +app.get('/health', (req, res) => res.json({ status: 'ok', version: '2.0.0' })); -app.listen(PORT, () => console.log('🚀 Server running on port ' + PORT)); +app.listen(PORT, () => console.log(`🚀 Prometheus Advanced running on port ${PORT}`)); From 03db50d77a7268b103b6332400057a3b041f6ffb Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 12:31:19 +0600 Subject: [PATCH 07/10] Update server.js --- server.js | 605 +++++------------------------------------------------- 1 file changed, 48 insertions(+), 557 deletions(-) diff --git a/server.js b/server.js index 16587b2..ba28cbd 100644 --- a/server.js +++ b/server.js @@ -10,321 +10,8 @@ app.use(cors()); app.use(bodyParser.json({ limit: '50mb' })); app.use(bodyParser.urlencoded({ extended: true, limit: '50mb' })); -// Homepage dengan UI Advanced -app.get('/', (req, res) => { - res.send(` - - - - - - Prometheus Advanced Obfuscator - - - -
-

🔐 Prometheus Advanced

-

Enterprise-Grade Lua Obfuscator • Luraph-Style Protection

- -
- 🔄 Control Flow - 🔐 String Encryption - 🎭 VM Wrapper - 🛡️ Anti-Debug - 💀 Dead Code - 🔢 Constant Folding -
- -
-

⚙️ Protection Settings

-
-
-
-
-
-
-
-
-
-
-
-
-
-

🎚️ Obfuscation Level

-
- - - - - -
-
-
- -
-
0
Input (bytes)
-
0
Output (bytes)
-
0x
Size Ratio
-
0
Strings Encrypted
-
- -
-
-

📝 Input Script

- -
-
-

🔐 Protected Output

- -
-
- -
- - - - -
- -
- -
Prometheus Advanced Obfuscator • Luraph-Style Protection • Self-Hosted
-
- - - - - `); -}); +// ... (Bagian HTML tetap sama, tidak perlu diubah) ... +// LANGSUNG KE BAGIAN CLASS LUAOBFUSCATOR // ==================== ADVANCED OBFUSCATOR ENGINE ==================== @@ -356,6 +43,9 @@ class LuaObfuscator { ]); } + // ... (Helper functions tetap sama: generateKey, randomVar, dll) ... + // Copy helper functions dari kode sebelumnya + generateKey(length) { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let result = ''; @@ -378,9 +68,8 @@ class LuaObfuscator { } randomILVar() { - // Generate IL-style variable like Luraph uses: IlIlIlIl const chars = ['I', 'l', '1']; - let result = chars[Math.floor(Math.random() * 2)]; // Start with I or l + let result = chars[Math.floor(Math.random() * 2)]; let length = 10 + Math.floor(Math.random() * 10); for (let i = 1; i < length; i++) { result += chars[Math.floor(Math.random() * chars.length)]; @@ -396,7 +85,6 @@ class LuaObfuscator { return '0x' + crypto.randomBytes(length / 2).toString('hex').toUpperCase(); } - // XOR encryption for strings xorEncrypt(str, key) { let result = []; for (let i = 0; i < str.length; i++) { @@ -405,226 +93,94 @@ class LuaObfuscator { return result; } - // Generate string decryption function generateStringDecryptor() { const funcName = this.randomILVar(); const keyVar = this.randomILVar(); const dataVar = this.randomILVar(); const resultVar = this.randomILVar(); const indexVar = this.randomILVar(); - return { name: funcName, code: `local ${funcName}=(function(${dataVar},${keyVar})local ${resultVar}="";for ${indexVar}=1,#${dataVar} do ${resultVar}=${resultVar}..string.char(bit32.bxor(${dataVar}[${indexVar}],string.byte(${keyVar},(${indexVar}-1)%#${keyVar}+1)));end;return ${resultVar};end);` }; } - // Convert number to complex expression obfuscateNumber(num) { if (this.level < 2) return num.toString(); - const methods = [ - // Method 1: Addition - () => { - const a = Math.floor(Math.random() * num); - const b = num - a; - return `(${a}+${b})`; - }, - // Method 2: Subtraction - () => { - const a = num + Math.floor(Math.random() * 1000); - const b = a - num; - return `(${a}-${b})`; - }, - // Method 3: XOR - () => { - const a = Math.floor(Math.random() * 65535); - const b = num ^ a; - return `bit32.bxor(${a},${b})`; - }, - // Method 4: Multiplication/Division - () => { + () => { const a = Math.floor(Math.random() * num); const b = num - a; return `(${a}+${b})`; }, + () => { const a = num + Math.floor(Math.random() * 1000); const b = a - num; return `(${a}-${b})`; }, + () => { const a = Math.floor(Math.random() * 65535); const b = num ^ a; return `bit32.bxor(${a},${b})`; }, + () => { const divisors = [2, 4, 5, 8, 10, 16, 20, 25]; - for (const d of divisors) { - if (num % d === 0) { - return `(${num/d}*${d})`; - } - } + for (const d of divisors) { if (num % d === 0) return `(${num/d}*${d})`; } return num.toString(); - }, - // Method 5: Nested - () => { - const a = Math.floor(num / 2); - const b = num - a; - const c = Math.floor(Math.random() * 100); - return `((${a}+${b})+${c}-${c})`; } ]; - - const method = methods[Math.floor(Math.random() * methods.length)]; - return method(); + return methods[Math.floor(Math.random() * methods.length)](); } - // Encrypt string and add to table encryptString(str) { if (str.length === 0) return '""'; - if (str.length > 200) return null; // Skip very long strings - + if (str.length > 200) return null; this.stats.stringsEncrypted++; const encrypted = this.xorEncrypt(str, this.encryptionKey); - - return { - data: `{${encrypted.join(',')}}`, - key: `"${this.encryptionKey}"` - }; + return { data: `{${encrypted.join(',')}}`, key: `"${this.encryptionKey}"` }; } - // Generate junk code that looks real generateJunkCode(count = 5) { const junk = []; - for (let i = 0; i < count; i++) { - const type = Math.floor(Math.random() * 8); + const type = Math.floor(Math.random() * 4); // Simplified junk const v1 = this.randomILVar(); - const v2 = this.randomILVar(); - const v3 = this.randomILVar(); const n1 = this.randomInt(); - const n2 = this.randomInt(); - - switch (type) { - case 0: - junk.push(`local ${v1}=${n1};`); - break; - case 1: - junk.push(`local ${v1}=${n1};local ${v2}=${v1}+${n2};`); - break; - case 2: - junk.push(`local ${v1}=function()return ${n1} end;`); - break; - case 3: - junk.push(`local ${v1}={${n1},${n2}};`); - break; - case 4: - junk.push(`local ${v1}=bit32.bxor(${n1},${n2});`); - break; - case 5: - junk.push(`local ${v1}=(function()local ${v2}=${n1};return ${v2}+${n2} end)();`); - break; - case 6: - junk.push(`local ${v1}=string.rep("",0);`); - break; - case 7: - junk.push(`local ${v1},${v2}=${n1},${n2};local ${v3}=${v1}*${v2};`); - break; - } + if(type===0) junk.push(`local ${v1}=${n1};`); + else if(type===1) junk.push(`local ${v1}=function()return ${n1} end;`); } - return junk.join(''); } - // Generate opaque predicates (always true/false but looks complex) generateOpaquePredicate(isTrue = true) { - const v = this.randomILVar(); const n1 = this.randomInt(1, 1000); - const n2 = this.randomInt(1, 1000); - - const truePredicates = [ - `(${n1}*${n1}>=${n1})`, - `(type("")=="string")`, - `(${n1}==${n1})`, - `(bit32.band(${n1},0)==0 or bit32.band(${n1},0)~=0)`, - `((${n1}+${n2})-(${n2})==${n1})`, - `(not not true)`, - `(#""==0)`, - `(math.abs(-${n1})==${n1})` - ]; - - const falsePredicates = [ - `(${n1}>${n1})`, - `(type("")=="number")`, - `(${n1}==${n1+1})`, - `(#""~=0)`, - `(nil)`, - `(false)`, - `(not true)` - ]; - - const predicates = isTrue ? truePredicates : falsePredicates; - return predicates[Math.floor(Math.random() * predicates.length)]; + return isTrue ? `(${n1}==${n1})` : `(${n1}~=${n1})`; } - // Generate anti-debug checks generateAntiDebug() { - const checks = []; - const errorVar = this.randomILVar(); const checkVar = this.randomILVar(); - - // Check for common debug tools - checks.push(` -local ${checkVar}=(function() -local ${errorVar}=false; -pcall(function() -if getgenv then -local _g=getgenv(); -if _g.SimpleSpy or _g.RemoteSpy or _g.HttpSpy or _g.Hydroxide or _g.Dex or _g.DarkDex then -${errorVar}=true; -end; -end; -end); -if ${errorVar} then return nil end; -return true; -end)(); -if not ${checkVar} then return end; -`); - - return checks.join(''); + return `local ${checkVar}=(function()pcall(function()if getgenv and(getgenv().SimpleSpy or getgenv().RemoteSpy)then while true do end end end)return true end)();`; } - // Generate environment wrapper generateEnvWrapper() { const envVar = this.randomILVar(); - const wrapperVar = this.randomILVar(); - - return `local ${envVar}=setmetatable({},{__index=function(self,key)return rawget(self,key)or getfenv()[key]or _G[key]end,__newindex=function(self,key,value)rawset(self,key,value)end});setfenv(1,${envVar});`; + return `local ${envVar}=setmetatable({},{__index=function(s,k)return rawget(s,k)or getfenv()[k]or _G[key]end});setfenv(1,${envVar});`; } - // Main obfuscation function + // MAIN OBFUSCATE FUNCTION (YANG DIPERBAIKI) obfuscate(script) { let result = script; const stringDecryptor = this.generateStringDecryptor(); let needsDecryptor = false; - // Step 1: String Encryption + // ... (String Encryption & Variable Mangling steps tetap sama) ... if (this.settings.strEncrypt !== false) { - // Handle double-quoted strings result = result.replace(/"([^"\\]*(\\.[^"\\]*)*)"/g, (match, content) => { if (content.length === 0 || content.length > 150) return match; const encrypted = this.encryptString(content); - if (encrypted) { - needsDecryptor = true; - return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; - } + if (encrypted) { needsDecryptor = true; return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; } return match; }); - - // Handle single-quoted strings result = result.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, (match, content) => { if (content.length === 0 || content.length > 150) return match; const encrypted = this.encryptString(content); - if (encrypted) { - needsDecryptor = true; - return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; - } + if (encrypted) { needsDecryptor = true; return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; } return match; }); } - // Step 2: Variable Mangling if (this.settings.varMangle !== false) { const varMap = new Map(); const localPattern = /local\s+([a-zA-Z_][a-zA-Z0-9_]*)/g; let match; - const tempScript = script; while ((match = localPattern.exec(tempScript)) !== null) { const varName = match[1]; @@ -633,125 +189,60 @@ if not ${checkVar} then return end; this.stats.varsRenamed++; } } - varMap.forEach((newName, oldName) => { const regex = new RegExp(`\\b${oldName}\\b`, 'g'); result = result.replace(regex, newName); }); } - - // Step 3: Constant Folding (Number Obfuscation) - if (this.settings.constFold !== false && this.level >= 2) { - result = result.replace(/\b(\d+)\b/g, (match, num) => { - const n = parseInt(num); - if (isNaN(n) || n > 100000 || n < 0) return match; - if (Math.random() > 0.7) return match; // Skip some for variation - return this.obfuscateNumber(n); - }); - } - - // Step 4: Build final output + + // Build final output let output = []; - - // Add header output.push(`-- Protected with Prometheus Advanced | ${new Date().toISOString().split('T')[0]}`); - output.push(`-- Level: ${this.level} | Strings: ${this.stats.stringsEncrypted} | Vars: ${this.stats.varsRenamed}`); - // Add VM wrapper start if (this.settings.vmWrapper !== false) { const vmFunc = this.randomILVar(); - const vmEnv = this.randomILVar(); output.push(`local ${vmFunc}=(function()`); - // Add environment wrapper - if (this.settings.envWrapper !== false) { - output.push(this.generateEnvWrapper()); - } - - // Add anti-debug - if (this.settings.antiDebug !== false) { - output.push(this.generateAntiDebug()); - } - - // Add junk code - if (this.settings.deadCode !== false) { - output.push(this.generateJunkCode(5 + this.level * 2)); - } - - // Add string decryptor if needed - if (needsDecryptor) { - output.push(stringDecryptor.code); - } + if (this.settings.envWrapper !== false) output.push(this.generateEnvWrapper()); + if (this.settings.antiDebug !== false) output.push(this.generateAntiDebug()); + if (this.settings.deadCode !== false) output.push(this.generateJunkCode(5)); + if (needsDecryptor) output.push(stringDecryptor.code); - // Add control flow if (this.settings.controlFlow !== false) { const condVar = this.randomILVar(); - const predicate = this.generateOpaquePredicate(true); - output.push(`local ${condVar}=${predicate};`); + output.push(`local ${condVar}=${this.generateOpaquePredicate(true)};`); output.push(`if ${condVar} then`); + output.push(result); - // More junk - if (this.settings.deadCode !== false) { - output.push(this.generateJunkCode(3)); + // FIX: Watermark di sini! + if (this.settings.watermark) { + const wmVar = this.randomILVar(); + output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); } - output.push(result); output.push('end;'); } else { output.push(result); + // FIX: Watermark di sini! + if (this.settings.watermark) { + const wmVar = this.randomILVar(); + output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + } } output.push(`end);return ${vmFunc}();`); } else { - // Simple wrapper without VM - if (needsDecryptor) { - output.push(stringDecryptor.code); - } - if (this.settings.deadCode !== false) { - output.push(this.generateJunkCode(3)); - } + if (needsDecryptor) output.push(stringDecryptor.code); output.push(result); - } - - // Add watermark if enabled - if (this.settings.watermark) { - const wmVar = this.randomILVar(); - output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + if (this.settings.watermark) { + const wmVar = this.randomILVar(); + output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + } } return output.join('\n'); } } -// API Endpoint -app.post('/api/obfuscate', (req, res) => { - try { - const { script, settings } = req.body; - - if (!script || typeof script !== 'string') { - return res.json({ success: false, error: 'No script provided' }); - } - - if (script.length > 500000) { - return res.json({ success: false, error: 'Script too large (max 500KB)' }); - } - - const obfuscator = new LuaObfuscator(settings || {}); - const result = obfuscator.obfuscate(script); - - res.json({ - success: true, - result: result, - stats: obfuscator.stats - }); - - } catch (error) { - console.error('Obfuscation error:', error); - res.json({ success: false, error: error.message }); - } -}); - -// Health check -app.get('/health', (req, res) => res.json({ status: 'ok', version: '2.0.0' })); - -app.listen(PORT, () => console.log(`🚀 Prometheus Advanced running on port ${PORT}`)); +// ... (API Endpoint & App Listen tetap sama) ... +// Copy bagian bawah dari kode sebelumnya From 46547e35ea830c6918536d59b39fba7199c505a2 Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 12:40:10 +0600 Subject: [PATCH 08/10] Update server.js --- server.js | 306 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 228 insertions(+), 78 deletions(-) diff --git a/server.js b/server.js index ba28cbd..73105cd 100644 --- a/server.js +++ b/server.js @@ -6,14 +6,194 @@ const crypto = require('crypto'); const app = express(); const PORT = process.env.PORT || 3000; +// Middleware app.use(cors()); app.use(bodyParser.json({ limit: '50mb' })); app.use(bodyParser.urlencoded({ extended: true, limit: '50mb' })); -// ... (Bagian HTML tetap sama, tidak perlu diubah) ... -// LANGSUNG KE BAGIAN CLASS LUAOBFUSCATOR +// ==================== HTML UI ==================== +app.get('/', (req, res) => { + res.send(` + + + + + + Prometheus Advanced + + + +
+

🔐 Prometheus Advanced

+

Self-Hosted Lua Obfuscator

+ +
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

📝 Input Script

+ +
+
+

🔐 Output

+ +
+
+ +
+ + + +
+ +
+
-// ==================== ADVANCED OBFUSCATOR ENGINE ==================== + + + + `); +}); + +// ==================== OBFUSCATOR LOGIC ==================== class LuaObfuscator { constructor(settings = {}) { @@ -22,58 +202,25 @@ class LuaObfuscator { this.stats = { stringsEncrypted: 0, varsRenamed: 0 }; this.encryptionKey = this.generateKey(16); this.varCounter = 0; - this.stringTable = []; this.reserved = new Set([ 'and','break','do','else','elseif','end','false','for','function','goto', 'if','in','local','nil','not','or','repeat','return','then','true','until','while', - 'game','workspace','script','Instance','Vector3','CFrame','Vector2','Color3', - 'BrickColor','UDim2','UDim','Enum','Ray','Region3','Rect','math','string','table', - 'coroutine','os','debug','bit32','utf8','print','warn','error','assert','pcall', - 'xpcall','loadstring','require','spawn','delay','wait','task','tick','time','typeof', - 'type','tostring','tonumber','pairs','ipairs','next','select','unpack','pack', - 'setmetatable','getmetatable','rawget','rawset','rawequal','rawlen', - 'getfenv','setfenv','getgenv','getrenv','setreadonly','getrawmetatable', - 'hookfunction','hookmetamethod','newcclosure','islclosure','iscclosure', - 'checkcaller','getcallingscript','getnamecallmethod','setnamecallmethod', - 'firetouchinterest','fireproximityprompt','fireclickdetector', - 'getsenv','getmenv','getscriptclosure','getscripts','getrunningscripts', - 'getcustomasset','getsynasset','isrbxactive','setclipboard','setfflag', - 'Drawing','cleardrawcache','getrenderproperty','setrenderproperty','isrenderobj', - '_G','shared','_VERSION','self' + 'game','workspace','script','print','warn','error','pcall','loadstring' ]); } - // ... (Helper functions tetap sama: generateKey, randomVar, dll) ... - // Copy helper functions dari kode sebelumnya - generateKey(length) { const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; let result = ''; - for (let i = 0; i < length; i++) { - result += chars.charAt(Math.floor(Math.random() * chars.length)); - } - return result; - } - - randomVar(prefix = '') { - const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_'; - const allChars = chars + '0123456789'; - let length = 8 + Math.floor(Math.random() * 8); - let result = prefix + chars[Math.floor(Math.random() * chars.length)]; - for (let i = 1; i < length; i++) { - result += allChars[Math.floor(Math.random() * allChars.length)]; - } - this.varCounter++; + for (let i = 0; i < length; i++) result += chars.charAt(Math.floor(Math.random() * chars.length)); return result; } randomILVar() { const chars = ['I', 'l', '1']; let result = chars[Math.floor(Math.random() * 2)]; - let length = 10 + Math.floor(Math.random() * 10); - for (let i = 1; i < length; i++) { - result += chars[Math.floor(Math.random() * chars.length)]; - } + let length = 8 + Math.floor(Math.random() * 8); + for (let i = 1; i < length; i++) result += chars[Math.floor(Math.random() * chars.length)]; return result; } @@ -81,10 +228,6 @@ class LuaObfuscator { return Math.floor(Math.random() * (max - min + 1)) + min; } - randomHex(length = 8) { - return '0x' + crypto.randomBytes(length / 2).toString('hex').toUpperCase(); - } - xorEncrypt(str, key) { let result = []; for (let i = 0; i < str.length; i++) { @@ -99,27 +242,13 @@ class LuaObfuscator { const dataVar = this.randomILVar(); const resultVar = this.randomILVar(); const indexVar = this.randomILVar(); + return { name: funcName, code: `local ${funcName}=(function(${dataVar},${keyVar})local ${resultVar}="";for ${indexVar}=1,#${dataVar} do ${resultVar}=${resultVar}..string.char(bit32.bxor(${dataVar}[${indexVar}],string.byte(${keyVar},(${indexVar}-1)%#${keyVar}+1)));end;return ${resultVar};end);` }; } - obfuscateNumber(num) { - if (this.level < 2) return num.toString(); - const methods = [ - () => { const a = Math.floor(Math.random() * num); const b = num - a; return `(${a}+${b})`; }, - () => { const a = num + Math.floor(Math.random() * 1000); const b = a - num; return `(${a}-${b})`; }, - () => { const a = Math.floor(Math.random() * 65535); const b = num ^ a; return `bit32.bxor(${a},${b})`; }, - () => { - const divisors = [2, 4, 5, 8, 10, 16, 20, 25]; - for (const d of divisors) { if (num % d === 0) return `(${num/d}*${d})`; } - return num.toString(); - } - ]; - return methods[Math.floor(Math.random() * methods.length)](); - } - encryptString(str) { if (str.length === 0) return '""'; if (str.length > 200) return null; @@ -131,11 +260,9 @@ class LuaObfuscator { generateJunkCode(count = 5) { const junk = []; for (let i = 0; i < count; i++) { - const type = Math.floor(Math.random() * 4); // Simplified junk const v1 = this.randomILVar(); const n1 = this.randomInt(); - if(type===0) junk.push(`local ${v1}=${n1};`); - else if(type===1) junk.push(`local ${v1}=function()return ${n1} end;`); + junk.push(`local ${v1}=${n1};`); } return junk.join(''); } @@ -155,33 +282,40 @@ class LuaObfuscator { return `local ${envVar}=setmetatable({},{__index=function(s,k)return rawget(s,k)or getfenv()[k]or _G[key]end});setfenv(1,${envVar});`; } - // MAIN OBFUSCATE FUNCTION (YANG DIPERBAIKI) obfuscate(script) { let result = script; const stringDecryptor = this.generateStringDecryptor(); let needsDecryptor = false; - // ... (String Encryption & Variable Mangling steps tetap sama) ... + // 1. String Encryption if (this.settings.strEncrypt !== false) { result = result.replace(/"([^"\\]*(\\.[^"\\]*)*)"/g, (match, content) => { if (content.length === 0 || content.length > 150) return match; const encrypted = this.encryptString(content); - if (encrypted) { needsDecryptor = true; return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; } + if (encrypted) { + needsDecryptor = true; + return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; + } return match; }); result = result.replace(/'([^'\\]*(\\.[^'\\]*)*)'/g, (match, content) => { if (content.length === 0 || content.length > 150) return match; const encrypted = this.encryptString(content); - if (encrypted) { needsDecryptor = true; return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; } + if (encrypted) { + needsDecryptor = true; + return `${stringDecryptor.name}(${encrypted.data},${encrypted.key})`; + } return match; }); } + // 2. Variable Mangling if (this.settings.varMangle !== false) { const varMap = new Map(); const localPattern = /local\s+([a-zA-Z_][a-zA-Z0-9_]*)/g; let match; const tempScript = script; + while ((match = localPattern.exec(tempScript)) !== null) { const varName = match[1]; if (!varMap.has(varName) && !this.reserved.has(varName)) { @@ -194,9 +328,11 @@ class LuaObfuscator { result = result.replace(regex, newName); }); } - - // Build final output + + // 3. Final Build let output = []; + + // Header (Fixed Newline) output.push(`-- Protected with Prometheus Advanced | ${new Date().toISOString().split('T')[0]}`); if (this.settings.vmWrapper !== false) { @@ -214,19 +350,17 @@ class LuaObfuscator { output.push(`if ${condVar} then`); output.push(result); - // FIX: Watermark di sini! + // Watermark INSIDE control flow if (this.settings.watermark) { - const wmVar = this.randomILVar(); - output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + output.push(`local ${this.randomILVar()}="Protected by Prometheus";`); } output.push('end;'); } else { output.push(result); - // FIX: Watermark di sini! + // Watermark INSIDE wrapper if (this.settings.watermark) { - const wmVar = this.randomILVar(); - output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + output.push(`local ${this.randomILVar()}="Protected by Prometheus";`); } } @@ -235,8 +369,7 @@ class LuaObfuscator { if (needsDecryptor) output.push(stringDecryptor.code); output.push(result); if (this.settings.watermark) { - const wmVar = this.randomILVar(); - output.push(`local ${wmVar}="Protected by Prometheus Advanced";`); + output.push(`local ${this.randomILVar()}="Protected by Prometheus";`); } } @@ -244,5 +377,22 @@ class LuaObfuscator { } } -// ... (API Endpoint & App Listen tetap sama) ... -// Copy bagian bawah dari kode sebelumnya +// API Route +app.post('/api/obfuscate', (req, res) => { + try { + const { script, settings } = req.body; + if (!script || typeof script !== 'string') return res.json({ success: false, error: 'No script' }); + + const obfuscator = new LuaObfuscator(settings || {}); + const result = obfuscator.obfuscate(script); + + res.json({ success: true, result: result }); + } catch (error) { + res.json({ success: false, error: error.message }); + } +}); + +// Start Server (BIND TO 0.0.0.0 for Render) +app.listen(PORT, '0.0.0.0', () => { + console.log(`🚀 Prometheus running on port ${PORT}`); +}); From 837d30f968d20141392407fd3bd72ee305f2553d Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 12:45:26 +0600 Subject: [PATCH 09/10] Update Dockerfile --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8380370..9116783 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,23 @@ -FROM node:18-alpine +FROM node:18-bullseye +# Set working directory WORKDIR /app +# Copy package info dulu COPY package*.json ./ -RUN npm install --production +# Install SEMUA dependencies (hapus --production agar lebih aman) +RUN npm install +# Copy sisa file COPY . . +# Set Environment Variable +ENV PORT=3000 +ENV NODE_ENV=production + +# Buka Port EXPOSE 3000 +# Jalankan server CMD ["node", "server.js"] From 557798087d0e048dd2358209e61b2d0371ede724 Mon Sep 17 00:00:00 2001 From: trianaq765-cmd Date: Mon, 12 Jan 2026 12:45:56 +0600 Subject: [PATCH 10/10] Update package.json --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d3fc876..17df815 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,15 @@ { "name": "prometheus-web", "version": "1.0.0", - "description": "Prometheus Lua Obfuscator Web Interface", + "description": "Obfuscator", "main": "server.js", "scripts": { "start": "node server.js" }, "dependencies": { - "express": "^4.18.2", "body-parser": "^1.20.2", "cors": "^2.8.5", - "multer": "^1.4.5-lts.1" + "express": "^4.18.2" }, "engines": { "node": ">=18.0.0"