-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddvararg.lua
More file actions
33 lines (26 loc) · 993 Bytes
/
Addvararg.lua
File metadata and controls
33 lines (26 loc) · 993 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
-- This Script is Part of the Prometheus Obfuscator by Levno_710
--
-- AddVararg.lua
--
-- This Script provides a Simple Obfuscation Step that wraps the entire Script into a function
local Step = require("prometheus.step");
local Ast = require("prometheus.ast");
local visitast = require("prometheus.visitast");
local AstKind = Ast.AstKind;
local AddVararg = Step:extend();
AddVararg.Description = "This Step Adds Vararg to all Functions";
AddVararg.Name = "Add Vararg";
AddVararg.SettingsDescriptor = {
}
function AddVararg:init(settings)
end
function AddVararg:apply(ast)
visitast(ast, nil, function(node)
if node.kind == AstKind.FunctionDeclaration or node.kind == AstKind.LocalFunctionDeclaration or node.kind == AstKind.FunctionLiteralExpression then
if #node.args < 1 or node.args[#node.args].kind ~= AstKind.VarargExpression then
node.args[#node.args + 1] = Ast.VarargExpression();
end
end
end)
end
return AddVararg;