Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local t = {...}
- local file = fs.open(t[1],"r")
- local cont = file.readAll()
- file.close()
- local function compile(c)
- local cont2 = string.dump(c)
- local i = string.len(cont2)
- local n = 1
- local m = ""
- while (i > 0) do
- byt = tostring(string.byte(cont2,n) + math.abs(math.floor(200*math.sin(n))))
- while (string.len(byt) < 3) do
- byt = "0".. byt
- end
- m = m .. "a" .. byt
- i = i -1
- n = n + 1
- end
- return m
- end
- local function compileN(c)
- local cont2 = string.dump(c)
- local i = string.len(cont2)
- local n = 1
- local m = ""
- while (i > 0) do
- byt = tostring(string.byte(cont2,n))
- while (string.len(byt) < 3) do
- byt = "0".. byt
- end
- m = m .. "\\" .. byt
- i = i -1
- n = n + 1
- end
- return m
- end
- function compileR(c,...)
- local function split(str, pat)
- local t = {} -- NOTE: use {n = 0} in Lua-5.0
- local fpat = "(.-)" .. pat
- local last_end = 1
- local s, e, cap = str:find(fpat, 1)
- while s do
- if s ~= 1 or cap ~= "" then
- table.insert(t,cap)
- end
- last_end = e+1
- s, e, cap = str:find(fpat, last_end)
- end
- if last_end <= #str then
- cap = str:sub(last_end)
- table.insert(t, cap)
- end
- return t
- end
- c = split(c,"a")
- local i = #c
- local n = 1
- local m = ""
- while (i > 0) do
- byt = tostring(tonumber(c[n]) - math.abs(math.floor(200*math.sin(n))))
- while (string.len(byt) < 3) do
- byt = "0".. byt
- end
- m = m .. "\\" .. byt
- i = i -1
- n = n + 1
- end
- return loadstring('loadstring("' .. m .. '")(...)')(...)
- end
- ir = compile(loadstring(cont))
- ir2 = compileN(compileR)
- local file2 = fs.open(t[2],"w")
- file2.writeLine('loadstring("' .. ir2 .. '")("' .. ir .. '",...)')
- file2.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement