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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
@echo off
|
|
2
|
-
ECHO Building Prometheus ...
|
|
3
|
-
RMDIR /s /q build
|
|
4
|
-
MKDIR build
|
|
5
|
-
glue.exe ./srlua.exe prometheus-main.lua build/prometheus.exe
|
|
6
|
-
robocopy ./src ./build/lua /E>nul
|
|
7
|
-
|
|
8
|
-
robocopy . ./build lua51.dll>nul
|
|
9
|
-
|
|
1
|
+
@echo off
|
|
2
|
+
ECHO Building Prometheus ...
|
|
3
|
+
RMDIR /s /q build
|
|
4
|
+
MKDIR build
|
|
5
|
+
glue.exe ./srlua.exe prometheus-main.lua build/prometheus.exe
|
|
6
|
+
robocopy ./src ./build/lua /E>nul
|
|
7
|
+
|
|
8
|
+
robocopy . ./build lua51.dll>nul
|
|
9
|
+
|
|
10
10
|
ECHO Done!
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Prometheus is an Lua Obfuscator, that is written in pure Lua.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Prometheus
|
|
6
|
-
|
|
7
|
-
Prometheus can obfuscate Lua51 as well as Roblox's LuaU, which is an optionally typed superset of Lua51.
|
|
8
|
-
|
|
9
|
-
View Prometheus on [github](https://github.com/levno-710/Prometheus).
|
|
10
|
-
|
|
11
|
-
This Documentation only applies to the newest version of Prometheus.
|
|
1
|
+
---
|
|
2
|
+
description: Prometheus is an Lua Obfuscator, that is written in pure Lua.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Prometheus
|
|
6
|
+
|
|
7
|
+
Prometheus can obfuscate Lua51 as well as Roblox's LuaU, which is an optionally typed superset of Lua51.
|
|
8
|
+
|
|
9
|
+
View Prometheus on [github](https://github.com/levno-710/Prometheus).
|
|
10
|
+
|
|
11
|
+
This Documentation only applies to the newest version of Prometheus.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# Table of contents
|
|
2
|
-
|
|
3
|
-
* [Prometheus](README.md)
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
* [Installation](getting-started/installation.md)
|
|
8
|
-
* [Obfuscating your first script](getting-started/obfuscating-your-first-script.md)
|
|
9
|
-
* [Command Line Options](getting-started/command-line-options.md)
|
|
10
|
-
* [Presets](getting-started/presets.md)
|
|
11
|
-
* [Writing a custom Config File](getting-started/writing-a-custom-config-file.md)
|
|
12
|
-
* [The Config Object](getting-started/the-config-object.md)
|
|
13
|
-
|
|
14
|
-
## Steps
|
|
15
|
-
|
|
16
|
-
* [WrapInFunction](steps/wrapinfunction.md)
|
|
17
|
-
* [Vmify](steps/vmify.md)
|
|
18
|
-
* [SplitStrings](steps/splitstrings.md)
|
|
19
|
-
* [ProxifyLocals](steps/proxifylocals.md)
|
|
20
|
-
* [EncryptStrings](steps/encryptstrings.md)
|
|
21
|
-
* [ConstantArray](steps/constantarray.md)
|
|
22
|
-
* [AntiTamper](steps/anti-tamper.md)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
## advanced
|
|
26
|
-
|
|
27
|
-
* [Using Prometheus in your Lua Application](advanced/using-prometheus-in-your-lua-application.md)
|
|
1
|
+
# Table of contents
|
|
2
|
+
|
|
3
|
+
* [Prometheus](README.md)
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
* [Installation](getting-started/installation.md)
|
|
8
|
+
* [Obfuscating your first script](getting-started/obfuscating-your-first-script.md)
|
|
9
|
+
* [Command Line Options](getting-started/command-line-options.md)
|
|
10
|
+
* [Presets](getting-started/presets.md)
|
|
11
|
+
* [Writing a custom Config File](getting-started/writing-a-custom-config-file.md)
|
|
12
|
+
* [The Config Object](getting-started/the-config-object.md)
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
* [WrapInFunction](steps/wrapinfunction.md)
|
|
17
|
+
* [Vmify](steps/vmify.md)
|
|
18
|
+
* [SplitStrings](steps/splitstrings.md)
|
|
19
|
+
* [ProxifyLocals](steps/proxifylocals.md)
|
|
20
|
+
* [EncryptStrings](steps/encryptstrings.md)
|
|
21
|
+
* [ConstantArray](steps/constantarray.md)
|
|
22
|
+
* [AntiTamper](steps/anti-tamper.md)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## advanced
|
|
26
|
+
|
|
27
|
+
* [Using Prometheus in your Lua Application](advanced/using-prometheus-in-your-lua-application.md)
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
# Using Prometheus in your Lua Application
|
|
2
|
-
|
|
3
|
-
Prometheus can also be used as a library for your custom Lua Applications instead of using its cli tool. 
|
|
4
|
-
|
|
5
|
-
In order to do that you'll first need to clone the github repo:
|
|
6
|
-
|
|
7
|
-
```batch
|
|
8
|
-
git clone "https://github.com/levno-710/Prometheus.git"
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
After that, you'll need to copy everything within the src folder to your project. Let's say you created a folder named `prometheus`, where all the Prometheus files are located. You can the use the following code to obfuscate a string:
|
|
12
|
-
|
|
13
|
-
{% code title="use_prometheus.lua" %}
|
|
14
|
-
```lua
|
|
15
|
-
local Prometheus = require("prometheus.prometheus")
|
|
16
|
-
|
|
17
|
-
-- If you don't want console output
|
|
18
|
-
Prometheus.Logger.logLevel = Prometheus.Logger.LogLevel.Error
|
|
19
|
-
|
|
20
|
-
-- Your code
|
|
21
|
-
local code = 'print("Hello, World!")'
|
|
22
|
-
|
|
23
|
-
-- Create a Pipeline using the Strong preset
|
|
24
|
-
local pipeline = Prometheus.Pipeline:fromConfig(Prometheus.Presets.Strong)
|
|
25
|
-
|
|
26
|
-
-- Apply the obfuscation and print the result
|
|
27
|
-
print(pipeline:apply(code));
|
|
28
|
-
```
|
|
29
|
-
{% endcode %}
|
|
30
|
-
|
|
31
|
-
Instead of passing the Strong preset you could also pass a custom [Config Object](../getting-started/the-config-object.md).
|
|
1
|
+
# Using Prometheus in your Lua Application
|
|
2
|
+
|
|
3
|
+
Prometheus can also be used as a library for your custom Lua Applications instead of using its cli tool. 
|
|
4
|
+
|
|
5
|
+
In order to do that you'll first need to clone the github repo:
|
|
6
|
+
|
|
7
|
+
```batch
|
|
8
|
+
git clone "https://github.com/levno-710/Prometheus.git"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
After that, you'll need to copy everything within the src folder to your project. Let's say you created a folder named `prometheus`, where all the Prometheus files are located. You can the use the following code to obfuscate a string:
|
|
12
|
+
|
|
13
|
+
{% code title="use_prometheus.lua" %}
|
|
14
|
+
```lua
|
|
15
|
+
local Prometheus = require("prometheus.prometheus")
|
|
16
|
+
|
|
17
|
+
-- If you don't want console output
|
|
18
|
+
Prometheus.Logger.logLevel = Prometheus.Logger.LogLevel.Error
|
|
19
|
+
|
|
20
|
+
-- Your code
|
|
21
|
+
local code = 'print("Hello, World!")'
|
|
22
|
+
|
|
23
|
+
-- Create a Pipeline using the Strong preset
|
|
24
|
+
local pipeline = Prometheus.Pipeline:fromConfig(Prometheus.Presets.Strong)
|
|
25
|
+
|
|
26
|
+
-- Apply the obfuscation and print the result
|
|
27
|
+
print(pipeline:apply(code));
|
|
28
|
+
```
|
|
29
|
+
{% endcode %}
|
|
30
|
+
|
|
31
|
+
Instead of passing the Strong preset you could also pass a custom [Config Object](../getting-started/the-config-object.md).
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# Command Line Options
|
|
2
|
-
|
|
3
|
-
The following table provides a brief overview over the command line options:
|
|
4
|
-
|
|
5
|
-
| Option | Usage |
|
|
6
|
-
| ----------------------------- | ----------------------------------------------------------- |
|
|
7
|
-
| --preset \[name]; --p \[name] | Specify the config preset to be used; [Details](presets.md) |
|
|
8
|
-
| --config \[path]; --c \[path] | Specify the path to a custom config file |
|
|
9
|
-
| --out \[path]; --o \[path] | Specify the path of the output file |
|
|
10
|
-
| --nocolors | Disable ansi colors escape sequences |
|
|
11
|
-
| --Lua51 | Handle input as Lua 5.1 |
|
|
12
|
-
| --LuaU | Handle input as LuaU |
|
|
13
|
-
| --pretty | Pretty print the output |
|
|
1
|
+
# Command Line Options
|
|
2
|
+
|
|
3
|
+
The following table provides a brief overview over the command line options:
|
|
4
|
+
|
|
5
|
+
| Option | Usage |
|
|
6
|
+
| ----------------------------- | ----------------------------------------------------------- |
|
|
7
|
+
| --preset \[name]; --p \[name] | Specify the config preset to be used; [Details](presets.md) |
|
|
8
|
+
| --config \[path]; --c \[path] | Specify the path to a custom config file |
|
|
9
|
+
| --out \[path]; --o \[path] | Specify the path of the output file |
|
|
10
|
+
| --nocolors | Disable ansi colors escape sequences |
|
|
11
|
+
| --Lua51 | Handle input as Lua 5.1 |
|
|
12
|
+
| --LuaU | Handle input as LuaU |
|
|
13
|
+
| --pretty | Pretty print the output |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
|
|
3
|
-
To install Prometheus, simply clone the Github Repository using:
|
|
4
|
-
|
|
5
|
-
```batch
|
|
6
|
-
git clone "https://github.com/levno-710/Prometheus.git"
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Alternatively you can download the Sources [here](https://github.com/levno-710/Prometheus/archive/refs/heads/master.zip).
|
|
10
|
-
|
|
11
|
-
Prometheus also Requires LuaJIT or Lua51 in order to work. The Lua51 binaries can be downloaded [here](https://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/).
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
To install Prometheus, simply clone the Github Repository using:
|
|
4
|
+
|
|
5
|
+
```batch
|
|
6
|
+
git clone "https://github.com/levno-710/Prometheus.git"
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Alternatively you can download the Sources [here](https://github.com/levno-710/Prometheus/archive/refs/heads/master.zip).
|
|
10
|
+
|
|
11
|
+
Prometheus also Requires LuaJIT or Lua51 in order to work. The Lua51 binaries can be downloaded [here](https://sourceforge.net/projects/luabinaries/files/5.1.5/Tools%20Executables/).
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
# Obfuscating your first script
|
|
2
|
-
|
|
3
|
-
Now that you have downloaded and Prometheus, you probably wonder how to use it. In this quick tutorial you are going to learn how to obfuscate your first file.
|
|
4
|
-
|
|
5
|
-
Note that in the following command examples `lua` should be replaced by your lua implementation.
|
|
6
|
-
|
|
7
|
-
Create the following file within the Prometheus main directory that you just downloaded:
|
|
8
|
-
|
|
9
|
-
{% code title="hello_world.lua" %}
|
|
10
|
-
```lua
|
|
11
|
-
print("Hello, World")
|
|
12
|
-
```
|
|
13
|
-
{% endcode %}
|
|
14
|
-
|
|
15
|
-
Now run the following command inside of the Prometheus directory:
|
|
16
|
-
|
|
17
|
-
```batch
|
|
18
|
-
lua ./cli.lua ./hello_world.lua
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
You may notice, that the console output looks weird. If that is the case, your terminal does not support ansi color escape sequences. You should add the `--nocolors` option:
|
|
22
|
-
|
|
23
|
-
```batch
|
|
24
|
-
lua ./cli.lua --nocolors ./hello_world.lua
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
This should create the following file:
|
|
28
|
-
|
|
29
|
-
{% code title="hello_world.obfuscated.lua" %}
|
|
30
|
-
```lua
|
|
31
|
-
print("Hello, World")
|
|
32
|
-
```
|
|
33
|
-
{% endcode %}
|
|
34
|
-
|
|
35
|
-
As you can see, the file hasn't changed at all. That is because by default prometheus is just a minifier and the code we gave it was already as small as possible. To actually obfuscate the file, prometheus must be told which obfuscation steps it should apply in which order. In order to do this, the cli provides the `--preset` option which allows you to specify the name of a predefined configuration. There are currently the following presets:
|
|
36
|
-
|
|
37
|
-
* Minify
|
|
38
|
-
* Weak
|
|
39
|
-
* Medium
|
|
40
|
-
* Strong
|
|
41
|
-
|
|
42
|
-
In order to perform the obfuscation, you need to specify that Prometheus should use the Strong preset:
|
|
43
|
-
|
|
44
|
-
```batch
|
|
45
|
-
lua ./cli.lua --preset Medium ./hello_world.lua
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The `hello_world.obfuscated.lua` should now contain the obfuscated code that should still print "Hello World".
|
|
49
|
-
|
|
50
|
-
Note that using the "Strong" preset is not recommended for large projects.
|
|
1
|
+
# Obfuscating your first script
|
|
2
|
+
|
|
3
|
+
Now that you have downloaded and Prometheus, you probably wonder how to use it. In this quick tutorial you are going to learn how to obfuscate your first file.
|
|
4
|
+
|
|
5
|
+
Note that in the following command examples `lua` should be replaced by your lua implementation.
|
|
6
|
+
|
|
7
|
+
Create the following file within the Prometheus main directory that you just downloaded:
|
|
8
|
+
|
|
9
|
+
{% code title="hello_world.lua" %}
|
|
10
|
+
```lua
|
|
11
|
+
print("Hello, World")
|
|
12
|
+
```
|
|
13
|
+
{% endcode %}
|
|
14
|
+
|
|
15
|
+
Now run the following command inside of the Prometheus directory:
|
|
16
|
+
|
|
17
|
+
```batch
|
|
18
|
+
lua ./cli.lua ./hello_world.lua
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You may notice, that the console output looks weird. If that is the case, your terminal does not support ansi color escape sequences. You should add the `--nocolors` option:
|
|
22
|
+
|
|
23
|
+
```batch
|
|
24
|
+
lua ./cli.lua --nocolors ./hello_world.lua
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This should create the following file:
|
|
28
|
+
|
|
29
|
+
{% code title="hello_world.obfuscated.lua" %}
|
|
30
|
+
```lua
|
|
31
|
+
print("Hello, World")
|
|
32
|
+
```
|
|
33
|
+
{% endcode %}
|
|
34
|
+
|
|
35
|
+
As you can see, the file hasn't changed at all. That is because by default prometheus is just a minifier and the code we gave it was already as small as possible. To actually obfuscate the file, prometheus must be told which obfuscation steps it should apply in which order. In order to do this, the cli provides the `--preset` option which allows you to specify the name of a predefined configuration. There are currently the following presets:
|
|
36
|
+
|
|
37
|
+
* Minify
|
|
38
|
+
* Weak
|
|
39
|
+
* Medium
|
|
40
|
+
* Strong
|
|
41
|
+
|
|
42
|
+
In order to perform the obfuscation, you need to specify that Prometheus should use the Strong preset:
|
|
43
|
+
|
|
44
|
+
```batch
|
|
45
|
+
lua ./cli.lua --preset Medium ./hello_world.lua
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `hello_world.obfuscated.lua` should now contain the obfuscated code that should still print "Hello World".
|
|
49
|
+
|
|
50
|
+
Note that using the "Strong" preset is not recommended for large projects.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# Presets
|
|
2
|
-
|
|
3
|
-
The following table provides an overview over the presets
|
|
4
|
-
|
|
5
|
-
| name | size | speed |
|
|
6
|
-
| ------ | ------ | ------- |
|
|
7
|
-
| Minify | tiny | fastest |
|
|
8
|
-
| Weak | small | fast |
|
|
9
|
-
| Medium | medium | medium |
|
|
10
|
-
| Strong | huge | slowest |
|
|
1
|
+
# Presets
|
|
2
|
+
|
|
3
|
+
The following table provides an overview over the presets
|
|
4
|
+
|
|
5
|
+
| name | size | speed |
|
|
6
|
+
| ------ | ------ | ------- |
|
|
7
|
+
| Minify | tiny | fastest |
|
|
8
|
+
| Weak | small | fast |
|
|
9
|
+
| Medium | medium | medium |
|
|
10
|
+
| Strong | huge | slowest |
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
# The Config Object
|
|
2
|
-
|
|
3
|
-
Prometheus takes a configuration objetct. In this object there can be many properties applied. \
|
|
4
|
-
The following table provides an overview:
|
|
5
|
-
|
|
6
|
-
| Property | type | possible values | default |
|
|
7
|
-
| ------------- | ------- | -------------------------------------------- | ----------------- |
|
|
8
|
-
| LuaVersion | string | "Lua51", "LuaU" | "Lua51" |
|
|
9
|
-
| PrettyPrint | boolean | true, false | false |
|
|
10
|
-
| VarNamePrefix | string | any | "" |
|
|
11
|
-
| NameGenerator | string | "Mangled", "MangledShuffled", "Il", "Number" | "MangledShuffled" |
|
|
12
|
-
| Seed | number | any | 0 |
|
|
13
|
-
| Steps | table | StepConfig\[] | {} |
|
|
14
|
-
|
|
15
|
-
As this table shows, all properties in the config object are optional as they have a default value.
|
|
16
|
-
|
|
17
|
-
As an example, here is the code for the minify preset:
|
|
18
|
-
|
|
19
|
-
```lua
|
|
20
|
-
{
|
|
21
|
-
-- The default LuaVersion is Lua51
|
|
22
|
-
LuaVersion = "Lua51";
|
|
23
|
-
-- For minifying no VarNamePrefix is applied
|
|
24
|
-
VarNamePrefix = "";
|
|
25
|
-
-- Name Generator for Variables
|
|
26
|
-
NameGenerator = "MangledShuffled";
|
|
27
|
-
-- No pretty printing
|
|
28
|
-
PrettyPrint = false;
|
|
29
|
-
-- Seed is generated based on current time
|
|
30
|
-
Seed = 0;
|
|
31
|
-
-- No obfuscation steps
|
|
32
|
-
Steps = {
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Steps
|
|
39
|
-
|
|
40
|
-
The most important property is the Steps property. This property must be a table of so called Step Configs. A Step in Prometheus describes a single transformation applied to your script by the Prometheus obfuscation pipeline. A StepConfiguration consists of the Name of the Step as well as settings for the step. All Steps will later be applied in the order they are defined. A single Step can be defined twice and will then be applied twice.
|
|
41
|
-
|
|
42
|
-
```lua
|
|
43
|
-
-- Obfuscation steps
|
|
44
|
-
Steps = {
|
|
45
|
-
{
|
|
46
|
-
-- This obfuscation step puts all constants into an array at the beginning of the code
|
|
47
|
-
Name = "ConstantArray";
|
|
48
|
-
Settings = {
|
|
49
|
-
-- Apply to Strings only
|
|
50
|
-
StringsOnly = true;
|
|
51
|
-
-- Apply to all Constants, 0.5 would only affect 50% of strings
|
|
52
|
-
Treshold = 1;
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Under [Steps](broken-reference), you can find all current Steps, their names as well as the possible options.
|
|
1
|
+
# The Config Object
|
|
2
|
+
|
|
3
|
+
Prometheus takes a configuration objetct. In this object there can be many properties applied. \
|
|
4
|
+
The following table provides an overview:
|
|
5
|
+
|
|
6
|
+
| Property | type | possible values | default |
|
|
7
|
+
| ------------- | ------- | -------------------------------------------- | ----------------- |
|
|
8
|
+
| LuaVersion | string | "Lua51", "LuaU" | "Lua51" |
|
|
9
|
+
| PrettyPrint | boolean | true, false | false |
|
|
10
|
+
| VarNamePrefix | string | any | "" |
|
|
11
|
+
| NameGenerator | string | "Mangled", "MangledShuffled", "Il", "Number" | "MangledShuffled" |
|
|
12
|
+
| Seed | number | any | 0 |
|
|
13
|
+
| Steps | table | StepConfig\[] | {} |
|
|
14
|
+
|
|
15
|
+
As this table shows, all properties in the config object are optional as they have a default value.
|
|
16
|
+
|
|
17
|
+
As an example, here is the code for the minify preset:
|
|
18
|
+
|
|
19
|
+
```lua
|
|
20
|
+
{
|
|
21
|
+
-- The default LuaVersion is Lua51
|
|
22
|
+
LuaVersion = "Lua51";
|
|
23
|
+
-- For minifying no VarNamePrefix is applied
|
|
24
|
+
VarNamePrefix = "";
|
|
25
|
+
-- Name Generator for Variables
|
|
26
|
+
NameGenerator = "MangledShuffled";
|
|
27
|
+
-- No pretty printing
|
|
28
|
+
PrettyPrint = false;
|
|
29
|
+
-- Seed is generated based on current time
|
|
30
|
+
Seed = 0;
|
|
31
|
+
-- No obfuscation steps
|
|
32
|
+
Steps = {
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Steps
|
|
39
|
+
|
|
40
|
+
The most important property is the Steps property. This property must be a table of so called Step Configs. A Step in Prometheus describes a single transformation applied to your script by the Prometheus obfuscation pipeline. A StepConfiguration consists of the Name of the Step as well as settings for the step. All Steps will later be applied in the order they are defined. A single Step can be defined twice and will then be applied twice.
|
|
41
|
+
|
|
42
|
+
```lua
|
|
43
|
+
-- Obfuscation steps
|
|
44
|
+
Steps = {
|
|
45
|
+
{
|
|
46
|
+
-- This obfuscation step puts all constants into an array at the beginning of the code
|
|
47
|
+
Name = "ConstantArray";
|
|
48
|
+
Settings = {
|
|
49
|
+
-- Apply to Strings only
|
|
50
|
+
StringsOnly = true;
|
|
51
|
+
-- Apply to all Constants, 0.5 would only affect 50% of strings
|
|
52
|
+
Treshold = 1;
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Under [Steps](broken-reference), you can find all current Steps, their names as well as the possible options.
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
# Writing a custom Config File
|
|
2
|
-
|
|
3
|
-
Configuration Files for Prometheus are just lua modules, that return a single object, which contains the configuration. Let's say we have the following config file:
|
|
4
|
-
|
|
5
|
-
{% code title="config.lua" %}
|
|
6
|
-
```lua
|
|
7
|
-
return {
|
|
8
|
-
-- The default LuaVersion is Lua51
|
|
9
|
-
LuaVersion = "Lua51"; -- or "LuaU"
|
|
10
|
-
-- All Variables will start with this prefix
|
|
11
|
-
VarNamePrefix = "";
|
|
12
|
-
-- Name Generator for Variables that look like this: b, a, c, D, t, G
|
|
13
|
-
NameGenerator = "MangledShuffled";
|
|
14
|
-
-- No pretty printing
|
|
15
|
-
PrettyPrint = false;
|
|
16
|
-
-- Seed is generated based on current time
|
|
17
|
-
-- When specifying a seed that is not 0, you will get the same output every time
|
|
18
|
-
Seed = 0;
|
|
19
|
-
-- Obfuscation steps
|
|
20
|
-
Steps = {
|
|
21
|
-
{
|
|
22
|
-
-- This obfuscation step puts all constants into an array at the beginning of the code
|
|
23
|
-
Name = "ConstantArray";
|
|
24
|
-
Settings = {
|
|
25
|
-
-- Apply to Strings only
|
|
26
|
-
StringsOnly = true;
|
|
27
|
-
-- Apply to all Constants, 0.5 would only affect 50% of strings
|
|
28
|
-
Treshold = 1;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
{% endcode %}
|
|
35
|
-
|
|
36
|
-
One can now obfuscate a script using this configuration by running:
|
|
37
|
-
|
|
38
|
-
```batch
|
|
39
|
-
lua ./cli.lua --config config.lua hello_world.lua
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
You should get the following output:
|
|
43
|
-
|
|
44
|
-
{% code title="hello_world.obfuscated.lua" %}
|
|
45
|
-
```lua
|
|
46
|
-
local N={"Hello, World!"}local function k(k)return N[k+40058]end print(k(-40057))
|
|
47
|
-
```
|
|
48
|
-
{% endcode %}
|
|
49
|
-
|
|
50
|
-
As you can see, the only transformation that was applied to our Hello World example was putting all strings (in this case only `"Hello, World!"` ) into an array and creating a wrapper function for retrieving the value.
|
|
51
|
-
|
|
52
|
-
### How does the Config File work?
|
|
53
|
-
|
|
54
|
-
The config file is simply a lua file, that returns the configuration object. Please note that this lua file is sandboxed by Prometheus when loading the configuration, meaning that you can't use any predefined functions like `tostring` or libraries like `math`.
|
|
55
|
-
|
|
56
|
-
See [The Config Object](the-config-object.md) to learn what this configuration object consists of.
|
|
1
|
+
# Writing a custom Config File
|
|
2
|
+
|
|
3
|
+
Configuration Files for Prometheus are just lua modules, that return a single object, which contains the configuration. Let's say we have the following config file:
|
|
4
|
+
|
|
5
|
+
{% code title="config.lua" %}
|
|
6
|
+
```lua
|
|
7
|
+
return {
|
|
8
|
+
-- The default LuaVersion is Lua51
|
|
9
|
+
LuaVersion = "Lua51"; -- or "LuaU"
|
|
10
|
+
-- All Variables will start with this prefix
|
|
11
|
+
VarNamePrefix = "";
|
|
12
|
+
-- Name Generator for Variables that look like this: b, a, c, D, t, G
|
|
13
|
+
NameGenerator = "MangledShuffled";
|
|
14
|
+
-- No pretty printing
|
|
15
|
+
PrettyPrint = false;
|
|
16
|
+
-- Seed is generated based on current time
|
|
17
|
+
-- When specifying a seed that is not 0, you will get the same output every time
|
|
18
|
+
Seed = 0;
|
|
19
|
+
-- Obfuscation steps
|
|
20
|
+
Steps = {
|
|
21
|
+
{
|
|
22
|
+
-- This obfuscation step puts all constants into an array at the beginning of the code
|
|
23
|
+
Name = "ConstantArray";
|
|
24
|
+
Settings = {
|
|
25
|
+
-- Apply to Strings only
|
|
26
|
+
StringsOnly = true;
|
|
27
|
+
-- Apply to all Constants, 0.5 would only affect 50% of strings
|
|
28
|
+
Treshold = 1;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
{% endcode %}
|
|
35
|
+
|
|
36
|
+
One can now obfuscate a script using this configuration by running:
|
|
37
|
+
|
|
38
|
+
```batch
|
|
39
|
+
lua ./cli.lua --config config.lua hello_world.lua
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You should get the following output:
|
|
43
|
+
|
|
44
|
+
{% code title="hello_world.obfuscated.lua" %}
|
|
45
|
+
```lua
|
|
46
|
+
local N={"Hello, World!"}local function k(k)return N[k+40058]end print(k(-40057))
|
|
47
|
+
```
|
|
48
|
+
{% endcode %}
|
|
49
|
+
|
|
50
|
+
As you can see, the only transformation that was applied to our Hello World example was putting all strings (in this case only `"Hello, World!"` ) into an array and creating a wrapper function for retrieving the value.
|
|
51
|
+
|
|
52
|
+
### How does the Config File work?
|
|
53
|
+
|
|
54
|
+
The config file is simply a lua file, that returns the configuration object. Please note that this lua file is sandboxed by Prometheus when loading the configuration, meaning that you can't use any predefined functions like `tostring` or libraries like `math`.
|
|
55
|
+
|
|
56
|
+
See [The Config Object](the-config-object.md) to learn what this configuration object consists of.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: This step provides an obfuscation step, that breaks the script, when someone tries to tamper with it.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Anti Tamper
|
|
6
|
-
|
|
7
|
-
### Settings
|
|
8
|
-
|
|
9
|
-
| Name | type | description | values |
|
|
10
|
-
| ----------- | ---- | ------------------------------------------- | --------------------------------------- |
|
|
11
|
-
| UseDebug | boolean | Uses the debug library in lua. Disable this if you don't have access to debug library | "true","false" |
|
|
1
|
+
---
|
|
2
|
+
description: This step provides an obfuscation step, that breaks the script, when someone tries to tamper with it.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Anti Tamper
|
|
6
|
+
|
|
7
|
+
### Settings
|
|
8
|
+
|
|
9
|
+
| Name | type | description | values |
|
|
10
|
+
| ----------- | ---- | ------------------------------------------- | --------------------------------------- |
|
|
11
|
+
| UseDebug | boolean | Uses the debug library in lua. Disable this if you don't have access to debug library | "true","false" |
|