File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,33 @@ local RandomStrings = require("obfuscator.randomStrings");
77
88local RandomLiterals = {};
99
10- function RandomLiterals .String ()
11- return RandomStrings .randomStringNode ();
10+ local function callNameGenerator (generatorFunction , ...)
11+ if (type (generatorFunction ) == " table" ) then
12+ generatorFunction = generatorFunction .generateName ;
13+ end
14+ return generatorFunction (... );
15+ end
16+
17+ function RandomLiterals .String (pipeline )
18+ return Ast .StringExpression (callNameGenerator (pipeline .namegenerator , math.random (1 , 4096 )));
19+ end
20+
21+ function RandomLiterals .Dictionary ()
22+ return RandomStrings .randomStringNode (true );
1223end
1324
1425function RandomLiterals .Number ()
1526 return Ast .NumberExpression (math.random (- 8388608 , 8388607 ));
1627end
1728
18- function RandomLiterals .Any ()
19- local type = math.random (1 , 2 );
29+ function RandomLiterals .Any (pipeline )
30+ local type = math.random (1 , 3 );
2031 if type == 1 then
21- return RandomLiterals .String ();
32+ return RandomLiterals .String (pipeline );
2233 elseif type == 2 then
2334 return RandomLiterals .Number ();
35+ elseif type == 3 then
36+ return RandomLiterals .Dictionary ();
2437 end
2538end
2639
You can’t perform that action at this time.
0 commit comments