local function dump(...)
local args = {...}
if #args > 1 then
error("invalid input: too many arguments", 3)
elseif #args < 1 then
error("invalid input: expected a file path", 3)
end
local IDENTIFIER = "[%w_]+"
local file = io.open(args[1]);
local input = file:read("*a")
file:close()
local a, b, deserialize, d, e =
input:match("(.+)(local function " .. IDENTIFIER .. "%(%.%.%.%).+local function )(" .. IDENTIFIER .. ")(%(%).+)(" .. "local function " .. IDENTIFIER .. "%(" .. IDENTIFIER .. ", ?" .. IDENTIFIER .. ", ?" .. IDENTIFIER .. "%).+)")
local injection = [[if true then
local instructions = ]] .. deserialize .. [[()[1]
for _, inst in next, instructions do
if #inst == 3 then
print(inst[3])
end
end
return
end;]]
local chunk, err = (loadstring or load)(a .. b .. deserialize .. d .. injection .. e)
if err then
warn(err)
return
end
chunk()
end
dump(...)
this works on any script outputted with the basic obfuscate option using from the command line is simple. save the code block above to a file called something like dumper.lua and then:
lua dumper.lua [path to an obfuscated file]
constants will appear in stdout