-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathmangled_shuffled.lua
More file actions
35 lines (29 loc) · 898 Bytes
/
mangled_shuffled.lua
File metadata and controls
35 lines (29 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-- This Script is Part of the Prometheus Obfuscator by levno-710
--
-- namegenerators/mangled_shuffled.lua
--
-- This Script provides a function for generation of mangled names with shuffled character order
local util = require("prometheus.util");
local chararray = util.chararray;
local VarDigits = chararray("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");
local VarStartDigits = chararray("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
local function generateName(id, _)
local name = ''
local d = id % #VarStartDigits
id = (id - d) / #VarStartDigits
name = name..VarStartDigits[d+1]
while id > 0 do
local e = id % #VarDigits
id = (id - e) / #VarDigits
name = name..VarDigits[e+1]
end
return name
end
local function prepare(_)
util.shuffle(VarDigits);
util.shuffle(VarStartDigits);
end
return {
generateName = generateName,
prepare = prepare
};