|
1 | | -// --- script.js --- |
| 1 | +/** |
| 2 | + * Pobfus 0.8 Beta - CamBuscate Engine |
| 3 | + * Lead Developer: tenringsofdoom1x |
| 4 | + */ |
2 | 5 |
|
3 | | -// 1. Better Randomization Engine |
4 | | -const randomHex = (l) => "_0x" + Math.floor(Math.random() * 0xFFFFFF).toString(16).padEnd(l, '0'); |
| 6 | +const ASCII_LOGO = String.raw` |
| 7 | +ooooooooo. .o8 .o88o. |
| 8 | +` + "`" + `888 ` + "`" + `Y88. "888 888 ` + "`" + `" |
| 9 | + 888 .d88' .ooooo. 888oooo. o888oo oooo oooo .oooo.o |
| 10 | + 888ooo88P' d88' ` + "`" + `88b d88' ` + "`" + `88b 888 ` + "`" + `888 ` + "`" + `888 d88( "8 |
| 11 | + 888 888 888 888 888 888 888 888 ` + "`" + `"Y88b. |
| 12 | + 888 888 888 888 888 888 888 888 o. )88b |
| 13 | +o888o ` + "`" + `Y8bod8P' ` + "`" + `Y8bod8P' o888o ` + "`" + `V88V"V8P' 8""888P'`; |
5 | 14 |
|
| 15 | +const VERSION_TAG = "\n [ ENGINE: CAMBUSCATE 0.1 | V0.8 BETA ]"; |
| 16 | + |
| 17 | +// Initialization |
| 18 | +document.addEventListener('DOMContentLoaded', () => { |
| 19 | + const logoDisplay = document.getElementById('logoDisplay'); |
| 20 | + if (logoDisplay) { |
| 21 | + logoDisplay.innerText = ASCII_LOGO + VERSION_TAG; |
| 22 | + } |
| 23 | + // Anti-Inspect Protection |
| 24 | + document.addEventListener('contextmenu', e => e.preventDefault()); |
| 25 | +}); |
| 26 | + |
| 27 | +/** |
| 28 | + * Generates a unique, high-entropy ID for filenames |
| 29 | + */ |
| 30 | +function generateId(length) { |
| 31 | + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#@'; |
| 32 | + let result = ''; |
| 33 | + for (let i = 0; i < length; i++) { |
| 34 | + result += chars.charAt(Math.floor(Math.random() * chars.length)); |
| 35 | + } |
| 36 | + return result; |
| 37 | +} |
| 38 | + |
| 39 | +/** |
| 40 | + * Main Obfuscation Engine |
| 41 | + */ |
6 | 42 | function pobfusStart() { |
7 | 43 | const input = document.getElementById('inputCode').value; |
8 | | - if (!input) return alert("Input required!"); |
| 44 | + if (!input) { |
| 45 | + alert("System Error: No source code detected in buffer."); |
| 46 | + return; |
| 47 | + } |
9 | 48 |
|
10 | | - // 2. Control Flow Flattening (State Machine) |
11 | | - // We create random 'states' so the code doesn't run top-to-bottom. |
12 | | - const states = [10, 25, 42, 67, 88].sort(() => Math.random() - 0.5); |
13 | | - const v_state = randomHex(4); |
14 | | - const v_vm = randomHex(6); |
15 | | - |
16 | | - // 3. Dynamic Keying (Logo-Linked) |
17 | | - const logoSig = ASCII_LOGO.length % 255; |
18 | | - const baseKey = Math.floor(Math.random() * 150) + 50; |
19 | | - const finalKey = baseKey ^ logoSig; |
| 49 | + // CamBuscate 0.1 Integrity Logic |
| 50 | + // This links the decryption key to the exact byte length of the logo |
| 51 | + const logoSig = (ASCII_LOGO + VERSION_TAG).length % 255; |
| 52 | + const internalSeed = 0x4B; |
| 53 | + const finalKey = internalSeed ^ logoSig; |
| 54 | + |
| 55 | + // XOR Virtualization |
20 | 56 | const bytes = input.split('').map(c => c.charCodeAt(0) ^ finalKey); |
| 57 | + const vmName = "_0x" + Math.random().toString(36).substring(7); |
21 | 58 |
|
22 | | - // 4. The Flattened VM Template |
23 | | - const vm = `--[[ |
| 59 | + const outputVM = `--[[ |
24 | 60 | ${ASCII_LOGO} |
25 | | - [ VERSION: 0.7 FLATTENED ] |
26 | | ---]] |
27 | | -local ${v_vm} = function() |
| 61 | +${VERSION_TAG} |
| 62 | +]] |
| 63 | +local ${vmName} = function() |
28 | 64 | local _data = {${bytes.join(',')}} |
29 | | - local _k = ${baseKey} ~ (#debug.getinfo(1).source % 255) |
| 65 | + local _sig = #debug.getinfo(1).source % 255 |
| 66 | + local _k = ${internalSeed} ~ _sig |
30 | 67 | local _res = "" |
31 | | - local ${v_state} = ${states[0]} |
32 | | -
|
33 | | - -- Control Flow Flattening Dispatcher |
34 | | - while ${v_state} ~= 0 do |
35 | | - if ${v_state} == ${states[0]} then |
36 | | - for i=1, #_data do _res = _res .. string.char(_data[i] ~ _k) end |
37 | | - ${v_state} = ${states[1]} |
38 | | - elseif ${v_state} == ${states[1]} then |
39 | | - local _f = loadstring or load |
40 | | - local _s, _err = pcall(_f(_res)) |
41 | | - if not _s then error("!! TAMPER !!") end |
42 | | - ${v_state} = 0 -- Exit State |
43 | | - else |
44 | | - -- Junk State (Confusion for De-obfuscators) |
45 | | - local _junk = math.pi * math.random() |
46 | | - ${v_state} = 0 |
47 | | - end |
| 68 | + for i=1, #_data do _res = _res .. string.char(_data[i] ~ _k) end |
| 69 | + local _f = loadstring or load |
| 70 | + local _ok, _exec = pcall(_f(_res)) |
| 71 | + if not _ok then |
| 72 | + warn("POBFUS V0.8: TAMPER DETECTED") |
| 73 | + while true do end |
48 | 74 | end |
49 | 75 | end |
| 76 | +pcall(${vmName})`; |
50 | 77 |
|
51 | | -pcall(${v_vm}) |
52 | | -`; |
| 78 | + document.getElementById('outputCode').value = outputVM; |
| 79 | + console.log(`[POBFUS] Build successful. Entropy Key: ${finalKey}`); |
| 80 | +} |
53 | 81 |
|
54 | | - document.getElementById('outputCode').value = vm; |
55 | | - } const output = `--[[ |
56 | | -${POBFUS_LOGO} |
57 | | - [ VERSION: 0.7 BETA ] |
58 | | - [ PROTECTION: VM + X-TABLE ] |
59 | | ---]] |
| 82 | +/** |
| 83 | + * Clipboard & File Handling |
| 84 | + */ |
| 85 | +function copyToClipboard() { |
| 86 | + const el = document.getElementById('outputCode'); |
| 87 | + if (!el.value) return; |
| 88 | + |
| 89 | + navigator.clipboard.writeText(el.value).then(() => { |
| 90 | + // Optional: Trigger a GitHub-style tooltip or toast here |
| 91 | + alert("Successfully copied to clipboard."); |
| 92 | + }); |
| 93 | +} |
60 | 94 |
|
61 | | -local _0xData = {${bytes.join(",")}} |
62 | | -local _0xKey = ${key} |
63 | | -local _0xBuffer = "" |
64 | | -${generateJunk()} |
| 95 | +function downloadFile() { |
| 96 | + const content = document.getElementById('outputCode').value; |
| 97 | + if (!content) return; |
65 | 98 |
|
66 | | -local _0xVM = function() |
67 | | - local _0xEnvCheck = getfenv and getfenv() or _G |
68 | | - ${generateJunk()} |
69 | | - for i=1, #_0xData do |
70 | | - _0xBuffer = _0xBuffer .. string.char(_0xData[i] ~ _0xKey) |
71 | | - if i % 20 == 0 then |
72 | | - ${generateJunk()} |
73 | | - end |
74 | | - end |
75 | | - ${generateJunk()} |
76 | | - local _0xLoad = loadstring or load |
77 | | - return _0xLoad |
| 99 | + const uniqueId = generateId(16); |
| 100 | + const fileName = `pobfus-${uniqueId}.lua`; |
| 101 | + |
| 102 | + const blob = new Blob([content], { type: 'text/plain' }); |
| 103 | + const link = document.createElement('a'); |
| 104 | + link.href = URL.createObjectURL(blob); |
| 105 | + link.download = fileName; |
| 106 | + link.click(); |
| 107 | + |
| 108 | + console.log(`[FS] File Exported: ${fileName}`); |
| 109 | + } |
0 commit comments