lua-obfuscator 3.0.0 → 3.0.2
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/README.md +61 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# lua-obfuscator
|
|
2
|
+
|
|
3
|
+
A powerful Lua / Luau obfuscator with VM-based protection.
|
|
4
|
+
|
|
5
|
+
`lua-obfuscator` is a modern, high-quality obfuscation tool designed for Lua and Luau (especially for Roblox, FiveM, and standalone Lua projects). It features a custom VM (Vmify) to significantly raise reverse engineering difficulty.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install lua-obfuscator
|
|
13
|
+
# or
|
|
14
|
+
yarn add lua-obfuscator
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { obfuscate } from 'lua-obfuscator';
|
|
21
|
+
|
|
22
|
+
const source = `
|
|
23
|
+
local function factorial(n)
|
|
24
|
+
if n <= 1 then return 1 end
|
|
25
|
+
return n * factorial(n - 1)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
print(factorial(10))
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
const obfuscated = obfuscate(source, "luaU", {
|
|
32
|
+
steps: [
|
|
33
|
+
{ name: "InsertJunk" },
|
|
34
|
+
{ name: "RenameVariables" },
|
|
35
|
+
{ name: "Vmify" },
|
|
36
|
+
{ name: "ConstantArray" },
|
|
37
|
+
{ name: "GlobalMapping" },
|
|
38
|
+
{ name: "StringsToExpressions" },
|
|
39
|
+
{ name: "NumbersToExpressions" },
|
|
40
|
+
{ name: "EncryptStrings" },
|
|
41
|
+
{ name: "WrapInFunction" },
|
|
42
|
+
],
|
|
43
|
+
minify: true,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
console.log(obfuscated);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Features
|
|
50
|
+
|
|
51
|
+
| Feature | Description |
|
|
52
|
+
|--------------------------|-------------|
|
|
53
|
+
| InsertJunk | Inserts meaningless junk statements |
|
|
54
|
+
| RenameVariables | Renames variables to random strings |
|
|
55
|
+
| Vmify | Advanced custom VM (bytecode + interpreter) — core strength |
|
|
56
|
+
| ConstantArray | Wraps constants into a randomized array |
|
|
57
|
+
| GlobalMapping | Maps globals (`print`, `_G`, etc.) to a randomized table |
|
|
58
|
+
| StringsToExpressions | Converts strings like `"abc"` into concatenated expressions |
|
|
59
|
+
| NumbersToExpressions | Converts numbers into complex arithmetic expressions |
|
|
60
|
+
| EncryptStrings | Encrypts strings using XOR |
|
|
61
|
+
| WrapInFunction | Wraps the entire script in an IIFE |
|