генератор мусора для ваших луа скриптов. усложните проникновения в ваше чудо. развивайтесь.
автор: @Azller Lollison
автор: @Azller Lollison
Lua:
local ffi = require 'ffi'
ffi.cdef [[
int setenv(const char* name);
typedef const char *LPCSTR;
typedef LPCSTR LPCTSTR;
typedef uint32_t DWORD;
int PlaySound(
LPCTSTR pszSound,
int hmod,
DWORD fdwSound
);
]]
math.randomseed(os.time())
print([[
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Луа генератор мусора
>>>>>>>>>>>>>>>>>>>>>> v_v >>>>>>>>>>>>>>>>>>>>>>
]])
local lastCounter = 0
local function getFileNameFromPath(path)
return string.match(path, '.+\\(.-)$')
end
local function getFileNameFromPathWithoutEx(path)
return string.match(path, '.+\\(.+)%..+$')
end
local trasherInstructions = {{function(name)
return string.format("local %s if %s then %s() end", name, name, name, name)
end}, {function(name)
return string.format("local %s if %s + %s[1] ~= 1 then %s() end", name, name, name, name)
end}, {function(name)
return
string.format("local %s if %s - %s + %s ^ %s == %d then end", name, name, name, name, name, math.random(1000))
end}, {function(name)
return string.format("local %s while %s do if %s then %s() end end", name, name, name, name)
end}, {function(name)
return string.format("local %s if (%s + %s()) > %s[1][2][%s] then %s() end", name, name, name, name, name, name)
end}, {function(name)
return string.format(
"local %s local function _____%s(%s_1, %s_2, %s_3, %s_4, %s_5, %s_6, %s_7, %s_8, %s_9, %s_10) end _____%s()",
name, name, name, name, name, name, name, name, name, name, name, name, name)
end}, {function(name)
return string.format("local %s if not %s == %s then %s() end", name, name, name, name)
end}, {function(name)
return string.format("local %s if not %s >= %s then %s() end", name, name, name, name)
end}, {function(name)
return string.format("local %s if -%s <= %s then %s() end", name, name, name, name)
end}, {function(name)
return string.format("local %s if not %s == not (%s == %s) then %s() end", name, name, name, name, name)
end}, {function(name)
return string.format("local %s local %s______ = %d", name, name, math.random(100000))
end}, {function(name)
return string.format("local %s if not %s() ~= -%s then %s() end", name, name, name, name)
end}, {function(name)
return string.format("local %s local %s_ = 1 repeat until %s", name, name, name)
end}, {function(name)
return string.format("local %s if %s() >= %s() then %s() end", name, name, name, name)
end}}
local function getLabelsTrash(point, power, id, name)
local antidecomp = ""
local warps = ""
local final = ""
local fake = " "
local fname = ""
for i = lastCounter, lastCounter + 13 do
fname = "local function ________" .. math.random(1000000000) .. "()"
warps = ""
antidecomp = "\n::_" .. i .. "::\n"
for a = 1, power * 100 do
warps = warps .. "goto _" .. i .. "; "
end
for i = 1, 13 do
fake = fake .. "local function __" .. math.random(10000000) .. "() "
fake = fake .. trasherInstructions[math.random(#trasherInstructions)][1]("__" .. math.random(10000000)) ..
"\n"
fake = fake .. "end\n"
end
final = final .. antidecomp .. " " .. warps .. "\n" .. fake .. "\n"
final = fname .. final .. "\nend"
end
final = final .. "\n"
lastCounter = lastCounter + 10
return final
end
local function generateTrash(point, power, id, name)
print(string.format("[%s] > Process: %s [P: %d, ID: %s]", name, point:gsub("::", ""), tonumber(power) * 100, id))
local trashHeader = "local function _________" .. math.random(100000000000) .. "()\n"
local labelsTrash = getLabelsTrash(point, power, id, name)
local trashEnd = "\nend"
print(string.format("[%s] > Process ended for: %s [P: %d, ID: %s]\n", name, point:gsub("::", ""),
tonumber(power) * 100, id))
return trashHeader .. labelsTrash .. trashEnd
end
for i = 1, #arg do
local foundedLabels = 0
local validLabels = 0
local file = io.open(arg[i], 'r')
if file then
local fName = getFileNameFromPathWithoutEx(arg[i])
local name = getFileNameFromPath(arg[i])
local text = file:read('*a')
if text then
print(string.format("\n> Start work with %s\n", name))
if text:find("::TRAP_%d+_%d+::") then
for k, v in text:gmatch("::TRAP_%d+_%d+::") do
foundedLabels = foundedLabels + 1
local power, id = k:match("::TRAP_(%d+)_(%d+)::")
if tonumber(power) > 0 and id then
validLabels = validLabels + 1
local res = generateTrash(k, power, id, name)
text = string.gsub(text, k, res)
else
print(string.format("[%s] > Error in getting a label power and ID", name))
end
end
else
print(string.format("[%s] > No trash tags were found", name))
end
local t = io.open(arg[i] .. "-trashed", 'a+')
t:write(text)
t:flush()
t:close()
print(string.format("> End work with %s. [%d | %d]", name, foundedLabels, validLabels))
os.execute(string.format('luajit -b "%s-trashed" "%s-trashed.luac"', name, fName))
os.execute(string.format("rm %s-trashed", name))
else
print(string.format("> Error in getting a file text. [%s]", name))
end
end
end
print("\n> Work ended.")
print("\n> Work ended.")
- чтобы сгенерировать мусор в скрипте, ставим метки в исходном коде скрипта в виде:
::TRAP_POWER_ID::
- вместо слова "POWER" ставим число от 1 до 80. чем больше число - тем больше будет мусора.
- к "ID" прибавляем +1 число после каждой новой метки.
пример:
::TRAP_50_1::
::TRAP_50_2::
::TRAP_30_3::
::TRAP_POWER_ID::
- вместо слова "POWER" ставим число от 1 до 80. чем больше число - тем больше будет мусора.
- к "ID" прибавляем +1 число после каждой новой метки.
пример:
::TRAP_50_1::
::TRAP_50_2::
::TRAP_30_3::
Последнее редактирование: