lua-obfuscator 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +40 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -14
- package/dist/prometheus/LICENSE +661 -661
- package/dist/prometheus/build.bat +9 -9
- package/dist/prometheus/doc/README.md +11 -11
- package/dist/prometheus/doc/SUMMARY.md +27 -27
- package/dist/prometheus/doc/advanced/using-prometheus-in-your-lua-application.md +31 -31
- package/dist/prometheus/doc/getting-started/command-line-options.md +13 -13
- package/dist/prometheus/doc/getting-started/installation.md +11 -11
- package/dist/prometheus/doc/getting-started/obfuscating-your-first-script.md +50 -50
- package/dist/prometheus/doc/getting-started/presets.md +10 -10
- package/dist/prometheus/doc/getting-started/the-config-object.md +58 -58
- package/dist/prometheus/doc/getting-started/writing-a-custom-config-file.md +56 -56
- package/dist/prometheus/doc/steps/anti-tamper.md +11 -11
- package/dist/prometheus/doc/steps/constantarray.md +71 -71
- package/dist/prometheus/doc/steps/encryptstrings.md +86 -86
- package/dist/prometheus/doc/steps/proxifylocals.md +47 -47
- package/dist/prometheus/doc/steps/splitstrings.md +40 -40
- package/dist/prometheus/doc/steps/vmify.md +9 -9
- package/dist/prometheus/doc/steps/wrapinfunction.md +29 -29
- package/dist/prometheus/readme.md +57 -57
- package/dist/prometheus/readme.txt +4 -4
- package/package.json +5 -1
- package/src/index.ts +81 -75
- package/tsconfig.json +12 -12
- package/src/prometheus/.editorconfig +0 -4
- package/src/prometheus/.gitattributes +0 -2
- package/src/prometheus/.gitbook.yaml +0 -1
- package/src/prometheus/.github/ISSUE_TEMPLATE/bug_report.md +0 -25
- package/src/prometheus/.github/workflows/Build.yml +0 -49
- package/src/prometheus/.github/workflows/Test.yml +0 -19
- package/src/prometheus/LICENSE +0 -661
- package/src/prometheus/benchmark.lua +0 -34
- package/src/prometheus/build.bat +0 -10
- package/src/prometheus/cli.lua +0 -12
- package/src/prometheus/doc/README.md +0 -11
- package/src/prometheus/doc/SUMMARY.md +0 -27
- package/src/prometheus/doc/advanced/using-prometheus-in-your-lua-application.md +0 -31
- package/src/prometheus/doc/getting-started/command-line-options.md +0 -13
- package/src/prometheus/doc/getting-started/installation.md +0 -11
- package/src/prometheus/doc/getting-started/obfuscating-your-first-script.md +0 -50
- package/src/prometheus/doc/getting-started/presets.md +0 -10
- package/src/prometheus/doc/getting-started/the-config-object.md +0 -58
- package/src/prometheus/doc/getting-started/writing-a-custom-config-file.md +0 -56
- package/src/prometheus/doc/steps/anti-tamper.md +0 -11
- package/src/prometheus/doc/steps/constantarray.md +0 -71
- package/src/prometheus/doc/steps/encryptstrings.md +0 -86
- package/src/prometheus/doc/steps/proxifylocals.md +0 -47
- package/src/prometheus/doc/steps/splitstrings.md +0 -40
- package/src/prometheus/doc/steps/vmify.md +0 -9
- package/src/prometheus/doc/steps/wrapinfunction.md +0 -29
- package/src/prometheus/prometheus-main.lua +0 -1
- package/src/prometheus/readme.md +0 -57
- package/src/prometheus/readme.txt +0 -5
- package/src/prometheus/src/cli.lua +0 -154
- package/src/prometheus/src/colors.lua +0 -61
- package/src/prometheus/src/highlightlua.lua +0 -61
- package/src/prometheus/src/logger.lua +0 -62
- package/src/prometheus/src/presets.lua +0 -174
- package/src/prometheus/src/prometheus/ast.lua +0 -792
- package/src/prometheus/src/prometheus/bit.lua +0 -521
- package/src/prometheus/src/prometheus/compiler/compiler.lua +0 -2365
- package/src/prometheus/src/prometheus/enums.lua +0 -106
- package/src/prometheus/src/prometheus/namegenerators/Il.lua +0 -41
- package/src/prometheus/src/prometheus/namegenerators/confuse.lua +0 -169
- package/src/prometheus/src/prometheus/namegenerators/mangled.lua +0 -26
- package/src/prometheus/src/prometheus/namegenerators/mangled_shuffled.lua +0 -35
- package/src/prometheus/src/prometheus/namegenerators/number.lua +0 -11
- package/src/prometheus/src/prometheus/namegenerators.lua +0 -7
- package/src/prometheus/src/prometheus/parser.lua +0 -969
- package/src/prometheus/src/prometheus/pipeline.lua +0 -250
- package/src/prometheus/src/prometheus/randomLiterals.lua +0 -41
- package/src/prometheus/src/prometheus/randomStrings.lua +0 -24
- package/src/prometheus/src/prometheus/scope.lua +0 -332
- package/src/prometheus/src/prometheus/step.lua +0 -79
- package/src/prometheus/src/prometheus/steps/AddVararg.lua +0 -33
- package/src/prometheus/src/prometheus/steps/AntiTamper.lua +0 -194
- package/src/prometheus/src/prometheus/steps/ConstantArray.lua +0 -521
- package/src/prometheus/src/prometheus/steps/EncryptStrings.lua +0 -239
- package/src/prometheus/src/prometheus/steps/NumbersToExpressions.lua +0 -82
- package/src/prometheus/src/prometheus/steps/ProxifyLocals.lua +0 -313
- package/src/prometheus/src/prometheus/steps/SplitStrings.lua +0 -338
- package/src/prometheus/src/prometheus/steps/Vmify.lua +0 -30
- package/src/prometheus/src/prometheus/steps/Watermark.lua +0 -61
- package/src/prometheus/src/prometheus/steps/WatermarkCheck.lua +0 -50
- package/src/prometheus/src/prometheus/steps/WrapInFunction.lua +0 -45
- package/src/prometheus/src/prometheus/steps.lua +0 -12
- package/src/prometheus/src/prometheus/tokenizer.lua +0 -546
- package/src/prometheus/src/prometheus/unparser.lua +0 -866
- package/src/prometheus/src/prometheus/util.lua +0 -297
- package/src/prometheus/src/prometheus/visitast.lua +0 -245
- package/src/prometheus/src/prometheus.lua +0 -71
- package/src/prometheus/tests/closures.lua +0 -12
- package/src/prometheus/tests/fibonacci.lua +0 -10
- package/src/prometheus/tests/loops.lua +0 -8
- package/src/prometheus/tests/primes.lua +0 -18
- package/src/prometheus/tests.lua +0 -149
package/src/prometheus/tests.lua
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
-- This Script is Part of the Prometheus Obfuscator by Levno_710
|
|
2
|
-
--
|
|
3
|
-
-- test.lua
|
|
4
|
-
-- This file will Perform tests using all lua files within the tests directory
|
|
5
|
-
|
|
6
|
-
-- Require Prometheus
|
|
7
|
-
local Prometheus = require("src.prometheus")
|
|
8
|
-
|
|
9
|
-
-- Enable Debugging
|
|
10
|
-
-- logger.logLevel = logger.LogLevel.Debug;
|
|
11
|
-
|
|
12
|
-
-- Config Variables - Later passed as Parameters
|
|
13
|
-
local noColors = false; -- Wether Colors in the Console output should be enabled
|
|
14
|
-
local isWindows = true; -- Wether the Test are Performed on a Windows or Linux System
|
|
15
|
-
local ciMode = false; -- Wether the Test error are ignored or not
|
|
16
|
-
|
|
17
|
-
for _, currArg in pairs(arg) do
|
|
18
|
-
if currArg == "--Linux" then
|
|
19
|
-
isWindows = false
|
|
20
|
-
end
|
|
21
|
-
if currArg == "--CI" then
|
|
22
|
-
ciMode = true
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
-- Enable/Disable Console Colors - this may be needed because cmd.exe and powershell.exe do not support ANSI Color Escape Sequences. The Windows Terminal Application is needed
|
|
27
|
-
Prometheus.colors.enabled = not noColors;
|
|
28
|
-
|
|
29
|
-
-- Apply Obfuscation Pipeline
|
|
30
|
-
local pipeline = Prometheus.Pipeline:new({
|
|
31
|
-
Seed = 0; -- For Using Time as Seed
|
|
32
|
-
VarNamePrefix = ""; -- No Custom Prefix
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
-- "Mangled" for names like this : a, b, c, d, ...
|
|
36
|
-
-- "MangledShuffled" is the same except the chars come in a different order - Recomended
|
|
37
|
-
-- "Il" for weird names like this : IlIIl1llI11l1 - Recomended to make less readable
|
|
38
|
-
-- "Number" for names like this : _1, _2, _3, ... - Not recomended
|
|
39
|
-
pipeline:setNameGenerator("MangledShuffled");
|
|
40
|
-
|
|
41
|
-
print("Performing Prometheus Tests ...")
|
|
42
|
-
local function scandir(directory)
|
|
43
|
-
local i, t, popen = 0, {}, io.popen
|
|
44
|
-
local pfile = popen(isWindows and 'dir "'..directory..'" /b' or 'ls -a "'..directory..'"')
|
|
45
|
-
for filename in pfile:lines() do
|
|
46
|
-
if string.sub(filename, -4) == ".lua" then
|
|
47
|
-
i = i + 1
|
|
48
|
-
t[i] = filename
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
pfile:close()
|
|
52
|
-
return t
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
local function shallowcopy(orig)
|
|
56
|
-
local orig_type = type(orig)
|
|
57
|
-
local copy
|
|
58
|
-
if orig_type == 'table' then
|
|
59
|
-
copy = {}
|
|
60
|
-
for orig_key, orig_value in pairs(orig) do
|
|
61
|
-
copy[orig_key] = orig_value
|
|
62
|
-
end
|
|
63
|
-
else -- number, string, boolean, etc
|
|
64
|
-
copy = orig
|
|
65
|
-
end
|
|
66
|
-
return copy
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
local function validate(a, b)
|
|
70
|
-
local outa = "";
|
|
71
|
-
local outb = "";
|
|
72
|
-
|
|
73
|
-
local enva = shallowcopy(getfenv(a));
|
|
74
|
-
local envb = shallowcopy(getfenv(a));
|
|
75
|
-
|
|
76
|
-
enva.print = function(...)
|
|
77
|
-
for i, v in ipairs({...}) do
|
|
78
|
-
outa = outa .. tostring(v);
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
envb.print = function(...)
|
|
83
|
-
for i, v in ipairs({...}) do
|
|
84
|
-
outb = outb .. tostring(v);
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
setfenv(a, enva);
|
|
89
|
-
setfenv(b, envb);
|
|
90
|
-
|
|
91
|
-
if(not pcall(a)) then error("Expected Reference Program not to Fail!") end
|
|
92
|
-
if(not pcall(b)) then return false, outa, nil end
|
|
93
|
-
|
|
94
|
-
return outa == outb, outa, outb
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
local presets = Prometheus.Presets;
|
|
99
|
-
local testdir = "./tests/"
|
|
100
|
-
local failed = {};
|
|
101
|
-
Prometheus.Logger.logLevel = Prometheus.Logger.LogLevel.Error;
|
|
102
|
-
local fc = 0;
|
|
103
|
-
for i, filename in ipairs(scandir(testdir)) do
|
|
104
|
-
local path = testdir .. filename;
|
|
105
|
-
local file = io.open(path,"r");
|
|
106
|
-
|
|
107
|
-
local code = file:read("*a");
|
|
108
|
-
print(Prometheus.colors("[CURRENT] ", "magenta") .. filename);
|
|
109
|
-
for name, preset in pairs(presets) do
|
|
110
|
-
for i = #preset.Steps, 1, -1 do
|
|
111
|
-
if preset.Steps[i].Name == "AntiTamper" then
|
|
112
|
-
table.remove(preset.Steps, i);
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
pipeline = Prometheus.Pipeline:fromConfig(preset);
|
|
116
|
-
local obfuscated = pipeline:apply(code);
|
|
117
|
-
|
|
118
|
-
local funca = loadstring(code);
|
|
119
|
-
local funcb = loadstring(obfuscated);
|
|
120
|
-
|
|
121
|
-
if funcb == nil then
|
|
122
|
-
print(Prometheus.colors("[FAILED] ", "red") .. "(" .. filename .. "): " .. name .. ", Invalid Lua!");
|
|
123
|
-
print("[SOURCE]", obfuscated);
|
|
124
|
-
fc = fc + 1;
|
|
125
|
-
else
|
|
126
|
-
local validated, outa, outb = validate(funca, funcb);
|
|
127
|
-
|
|
128
|
-
if not validated then
|
|
129
|
-
print(Prometheus.colors("[FAILED] ", "red") .. "(" .. filename .. "): " .. name);
|
|
130
|
-
print("[OUTA] ", outa);
|
|
131
|
-
print("[OUTB] ", outb);
|
|
132
|
-
print("[SOURCE]", obfuscated);
|
|
133
|
-
fc = fc + 1;
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
file:close();
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
if fc < 1 then
|
|
141
|
-
print(Prometheus.colors("[PASSED] ", "green") .. "All tests passed!");
|
|
142
|
-
return 0;
|
|
143
|
-
else
|
|
144
|
-
print(Prometheus.colors("[FAILED] ", "red") .. "Some tests failed!");
|
|
145
|
-
if ciMode then
|
|
146
|
-
error("Test Failed!")
|
|
147
|
-
end
|
|
148
|
-
return -1;
|
|
149
|
-
end
|