g={} xm=gg.prompt({"选择脚本"},{"/storage/emulated/0/"},{"file"}) data=io.open(xm[1],'r'):read("*a") path="/sdcard/小沈78"--禁止删 Numto16=function(num) if type(num)~="number" or num>255 or num<0 then return num else local sp=string.format("%x",num) if #sp==1 then sp="0"..sp end return "\\x"..sp end end toLuaHex=function(str) return(string.gsub(str,".",function(x) return(Numto16(string.byte(x))) end)) end To_16=function(txt) local sp=string.format("%x",txt) if #sp==1 then sp="0"..sp end return "\\x"..sp end function To__16(str) return(str:gsub(".",function(x) return(To_16(string.byte(x))) end)) end function RandomStr(len) len=len or math.random(4,6) local str = "" str = string.char(math.random(65, 90)) for num = 1, len - 1 do local number = math.random(1, 3) if number == 1 then str = str .. string.char(math.random(65, 90)) elseif number == 2 then str = str .. string.char(math.random(97, 122)) elseif number == 3 then str = str .. string.char(math.random(48, 57)) end end return str end function suiji() local ret,rec ret="" for i=1,3 do rec=string.char(math.random(150,190)) ret=ret..rec end weizhi="�" ret=weizhi..ret..weizhi..string.char(math.random(150,190))..weizhi return ret end ___name={} function _Random(Table_name,Random,...) local xxxx=... if not ___name[Table_name] then _ENV[Table_name]={} ___name[Table_name]=true end while(true)do x=_ENV[Random](xxxx) if not _ENV[Table_name][x] then _ENV[Table_name][x]=x str=x break end end return(str) end Table_name=RandomStr() Dec_name=RandomStr() _ENV["字符串"]={} String={} table.insert(String,"local "..Table_name.."={}") xmnb={} local KEY=math.random(1,32) function NZF_Str(STR) if(STR=="")then;return("\034\034")end Str=STR STRING=_ENV["字符串"][STR] if(STRING)then;return(STRING)end ascll={string.byte(STR,1,-1)} res={} Key=math.random(128,255) table.insert(xmnb,To_16(Key)) for index,value in ipairs(ascll) do value=value~(Key~KEY) value=To_16(value) table.insert(res,value) end Name=Table_name.."['".._Random("乱码","suiji").."']" table.insert(String,Name.."=(function();return(Str_dec('"..table.concat(res).."'));end)()") STR="("..Dec_name.."("..Name.."))" _ENV["字符串"][Str]=STR return STR end Enc_10Num=function(num) return("Char['"..To_16(num).."']") end -- 标准库 fuc = { ["gg"] = 2, ["os"] = 2, ["io"] = 2, ["string"] = 2, ["math"] = 2, ["table"] = 2, ["debug"] = 2, ["bit32"] = 2, ["utf8"] = 2, } local Min_num = function(...) local arm = {...} local num = nil for i, v in pairs(arm) do if v ~= nil then if not num then num = v elseif num > v then num = v end end end return num end Enc_Str=function(data) local gr = {} repeat local s1, ss1, x1, xx1, str s1 = string.find(data, "\034")--单引号 ss1 = string.find(data, "\039")--双引号 x1 = string.find(data, "%[[=]*%[")--中括号 xx1 = string.find(data, "%-%-")--注释 str = Min_num(s1, ss1, x1, xx1) if str == nil then break end if str == s1 then data = data:gsub("(.-)(\034.-\034)",function(t1, t2) gr[#gr + 1] = t1 t2 = string.gsub(t2, "\\\\","\\092") t2 = string.gsub(t2, "\\\034", "\\034") if t2:sub(-1, -1) ~= "\034" then return t2 end t3 = load("return "..t2) if not t3 then print("\034加密失败\n"..t2) os.exit() end gr[#gr + 1] = NZF_Str(t3(),true) return "" end, 1) elseif str == ss1 then data = data:gsub("(.-)(\039.-\039)",function(t1, t2) gr[#gr + 1] = t1 t2 = string.gsub(t2, "\\\\","\\092") t2 = string.gsub(t2, "\\\039", "\\039") if t2:sub(-1, -1) ~= "\039" then return t2 end t3 = load("return "..t2) if not t3 then print("\039加密失败\n"..t2) os.exit() end gr[#gr + 1] = NZF_Str(t3(),true) return "" end, 1) elseif str == x1 then local g1 = string.match(data,"%[([=]*)%[") data=data:gsub("(.-)(%["..g1.."%[.-%]"..g1.."%])",function(t1, t2) gr[#gr + 1] = t1 t3 = load("return "..t2) if not t3 then print("[[加密失败\n"..t2) os.exit() end gr[#gr + 1] = NZF_Str(t3(),true) return "" end, 1) elseif str == xx1 then d1, d2, d3, d4 = string.find(data, "%-%-(%[([=]*)%[)") if d1 == xx1 then data = string.gsub(data, "(.-)%-%-%[" .. d4 .. "%[.-%]" .. d4 .. "%]", function(txt1) gr[#gr + 1] = txt1 return " " end, 1) else data = string.gsub(data, "(.-)%-%-[^\n]*", function(txt1) gr[#gr + 1] = txt1 return "" end, 1) end else break end until not str gr[#gr+1]=data gr = table.concat(gr):gsub("return%s+end","return 0\nend") gr = gr:gsub("%-%-%[%[.-%]%]",""):gsub("%-%-[^\n]+", "") return gr end --data='print("小沈加密:企业版'..[[\n]]..'购买联系3776566938@qq.com")'..data data=Enc_Str(data)--字符串 XM={} table.insert(XM,[=[ local Char={} local __pairs,string__byte,string__char=pairs,string.byte,string.char for index=#Char,255 do Char[index]=string__char(index) Char[(Char[index])]=index end local INDEX=#Char/#Char ]=]) table.insert(XM,"local xmnb='"..table.concat(xmnb).."'") table.insert(XM,[=[ local Str_dec=function(str) local Res={} for index,value in __pairs({string__byte(str,1,#str)}) do Res[index]=(value~(]=]..Enc_10Num(KEY)..[=[~string__byte(xmnb,INDEX))) end INDEX=INDEX+#xmnb/#xmnb return(Res) end ]=]) table.insert(XM,"local "..Dec_name..[=[=function(Table) local res="" for index,value in __pairs(Table) do res=res..Char[(value)] end return(res) end ]=]) local Goto=function(num) num=num or math.random( 4,10) hg = "" return ";if(Char['xm'])then;" .. hg:rep(num * 2) .. "::hg::;end;" end ___=function(Table) res="" for i, v in pairs(Table) do res=res..v..Goto() end return res end String=true and ___(String) or table.concat(String,"\n") table.insert(XM,String) XM=table.concat(XM,"\n") data=XM..data local value_var = math.random(130,140) -- 虚拟化的配置 local start_dec=[===[ local value_var local ar3="p" local tab_by = {} local asc_EA = "i" local asc_E5 = "s" local asc_E7 = "g" local asc_EC = "n" local ar1="(" local asc_E9 = "h" local asc_EF = "a" local asc_EB = "t" local asc_E4 = "r" local ar2=")" local asc_E2 = "c" local asc_E1 = "m" local asc_E3 = "o" local ar4 = "d" local asc_E6 = "u" local asc_E8 = "b" local asc_EQ = "e" local char = _ENV[asc_E5 .. asc_EB .. asc_E4 .. asc_EA .. asc_EC .. asc_E7][asc_E2 .. asc_E9 .. asc_EF .. asc_E4] local gmtch = _ENV[asc_E5 .. asc_EB .. asc_E4 .. asc_EA .. asc_EC .. asc_E7][asc_E7 .. asc_E1 .. asc_EF .. asc_EB .. asc_E2 .. asc_E9] local match = _ENV[asc_E5 .. asc_EB .. asc_E4 .. asc_EA .. asc_EC .. asc_E7][asc_E1 .. asc_EF .. asc_EB .. asc_E2 .. asc_E9] local tonum = _ENV[asc_EB .. asc_E3 .. asc_EC .. asc_E6 .. asc_E1 .. asc_E8 .. asc_EQ .. asc_E4] local dump_ = _ENV[asc_E5 .. asc_EB .. asc_E4 .. asc_EA .. asc_EC .. asc_E7][ar4 .. asc_E6 .. asc_E1 .. ar3] local Char = {} for i = 0, 255 do Char[i] = char(i) Char[char(i)] = i end local set_tab_ = {} local erp = (function() value_var = dump_(function() local a = "千禧年科技学院加密" do return end do return end do return end end) end)() value_var = match(value_var,Char[1]..Char[0]..Char[0]..Char[0]..Char[4]..Char[2]..Char[0]..Char[0]..Char[0]..ar1.."."..ar2..Char[0]) value_var = Char[value_var] local decrypt_Var = function(txt, free, free2, free3) if txt == nil then return {} end if txt == 1 then return free+free2 elseif txt == 2 then return free-free2 elseif txt == 3 then return free*free2 elseif txt == 4 then return free/free2 elseif txt == 5 then return free^free2 elseif txt == 6 then return free~free2 elseif txt == 7 then return free&free2 elseif txt == 8 then return free|free2 elseif txt == 9 then return free%free2 elseif txt == 10 then return free//free2 elseif txt == 11 then return free<>free2 elseif txt == 13 then return ~free elseif txt == 14 then return -free elseif txt == 15 then return #free elseif set_tab_[txt] then return set_tab_[txt] end local txt2 = "" for i in gmtch(txt, ".") do i = Char[i] ~ value_var txt2=txt2..Char[i] end if free then txt2=tonum(txt2) end set_tab_[txt] = txt2 return set_tab_[txt] end ]===] data="local enc_at = (function()\nlocal data_enc = \"enc_slepwtl\"\n"..data.."\nend)()" data=start_dec.."\n\n"..data local fa = string.rep( '(function() ', 1) local fb = string.rep(' end)()', 1) data = fa .. data .. fb io.open("加密残留.Lua","w"):write(data) local enc = _ENV or _G local Load = enc["l".."o".."a".."d"] local Tostring = enc["t".."o".."s".."t".."r".."i".."n".."g"] local String = enc["s".."t".."r".."i".."n".."g"] local Table = enc["t".."a".."b".."l".."e"] local Char = String["c".."h".."a".."r"] local Concat = Table["c".."o".."n".."c".."a".."t"] function v(code, key) code = Tostring(code) key = Tostring(key) local schedule = {} for i = 0, 255 do schedule[i] = i end local j = 0 for i = 0, 255 do j = (j + schedule[i] + key:byte(i % #key + 1)) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] end local i, j = 0, 0 local res = {} for n = 1, #code do i = (i + 1) % 256 j = (j + schedule[i]) % 256 schedule[i], schedule[j] = schedule[j], schedule[i] res[n] = Char(schedule[(schedule[i] + schedule[j]) % 256] ~ code:byte(n)) end return Concat(res) end local function str_enc(str) local t = {string.byte(str, 1, -1)} for i = 1, #t do t[i] = string.format('\\x%02x', t[i]) end return table.concat(t) end -- 尝试加载并编译脚本 local func, err = load(data) if not func then print("脚本加载失败: " .. tostring(err)) return end data = string.dump(func, true) local data = v(data, "key") data = "\nlocal v \nlocal enc = _ENV or _G\nlocal Load = enc[\"l\"..\"o\"..\"a\"..\"d\"]\nlocal Tostring = enc[\"t\"..\"o\"..\"s\"..\"t\"..\"r\"..\"i\"..\"n\"..\"g\"]\nlocal String = enc[\"s\"..\"t\"..\"r\"..\"i\"..\"n\"..\"g\"]\nlocal Table = enc[\"t\"..\"a\"..\"b\"..\"l\"..\"e\"]\nlocal Char = String[\"c\"..\"h\"..\"a\"..\"r\"]\nlocal Concat = Table[\"c\"..\"o\"..\"n\"..\"c\"..\"a\"..\"t\"]\nfunction v(code, key)\n code = Tostring(code)\n key = Tostring(key)\n\n local schedule = {}\n for i = 0, 255 do schedule[i] = i end\n local j = 0\n for i = 0, 255 do\n j = (j + schedule[i] + key:byte(i % #key + 1)) % 256\n schedule[i], schedule[j] = schedule[j], schedule[i]\n end\n\n local i, j = 0, 0\n local res = {}\n for n = 1, #code do\n i = (i + 1) % 256\n j = (j + schedule[i]) % 256\n schedule[i], schedule[j] = schedule[j], schedule[i]\n res[n] = Char(schedule[(schedule[i] + schedule[j]) % 256] ~ code:byte(n))\n end\n\n return Concat(res)\nend\n".."\nv=(function (...)\nreturn Load(v(...))()\nend)(\""..str_enc(data).."\",\"key\")" -- 编译加密后的代码 local encryptedFunc, err = load(data) xmo="--[[" UI=[=[ ]=] .. xmo .. [=[ ]=] data="(function(...)\nlocal main=(function(...)\n"..data.."\nend)(_ENV)\nend)([===["..UI.."]===])" data=string.dump(load(data),true) _G['250区块'] = function(code) code=code:gsub("%.linedefined %d+",".linedefined 0") code=code:gsub("%.lastlinedefined %d+",".lastlinedefined 0") code=code:gsub("%.maxstacksize %d+",".maxstacksize 250") return code end _G['upval'] = function (a, b) local c = {} for i = a, b do table.insert(c, string.format(".upval v%d nil ; u%d", i, i)) end return table.concat(c, "\n") end _G['清理垃圾'] = function(code) code=code:gsub('\n\t*%s*','\n') :gsub('\n\t*%.local [^\n]+','') :gsub('\n\t*%.end local[^\n]+','') :gsub('\n\t*%.line [^\n]+','') :gsub("\n\t*%s*; .end local v[^\n]+","") local arr = {'"[^\n]-[^\\]"', '-?%d[%w%.]*', '""'} local opNames = { 'ADD', 'SUB', 'MUL', 'DIV', 'MOD', 'POW', 'GETTABLE', 'SETTABLE', 'SELF', 'GETTABUP', 'SETTABUP', 'EQ', 'LT', 'LE' } for i, const in pairs(arr) do local A1 = 210 + (i % 3) for k, zl in pairs(opNames) do code = string.gsub(code, '(\n(\t*)(' .. zl .. ') %w+ )(' .. const .. ') (' .. const .. ')', function(p1, tab, name, p2, p3) local A2 = A1 + 1 return '\n' .. tab .. 'LOADK v' .. A1 .. ' ' .. p2 .. '\n\n' .. tab .. 'LOADK v' .. A2 .. ' ' .. p3 .. p1 .. 'v' .. A1 .. ' v' .. A2 .. '\n' end) code = string.gsub(code, '(\n(\t*)(' .. zl .. ') %w+ %w+ )(' .. const .. ')', function(p1, tab, name, p2) return '\n' .. tab .. 'LOADK v' .. A1 .. ' ' .. p2 .. p1 .. 'v' .. A1 .. '\n' end) code = string.gsub(code, '(\n(\t*)(' .. zl .. ') %w+ )(' .. const .. ')( %w+)', function(p1, tab, name, p2, p3) return '\n' .. tab .. 'LOADK v' .. A1 .. ' ' .. p2 .. '\n' .. p1 .. 'v' .. A1 .. p3 end) end end return code end _G['常量加固'] = function (code) code=code:gsub("(%u+)( [uv]%d+[^\n]-)(\".-\")",function(x,z,y) --print(x,z,y) local MAX=math.random(1,50) local MIN=math.random(200,209) if x=="LOADK" then --print(x) return x..z..y end return "LOADK v"..MAX.." "..y.."\nTESTSET v"..MIN.." v"..MAX.." 1\nTESTSET v"..math.random(220,229).." v"..math.random(230,239).." 1\nLOADBOOL v"..MIN.." 1\n"..x..z.."v"..MIN end) return code end Ran_key,tab_final = {},{} for i = 1, math.random(2800,3300) do Ran_key[i] = math.random(200,240) end tab_ran = {} Ran_index = function(num) local zl = {} if not num then num = math.random(4, 9) end for x = 1, num do zl[#zl+1] = "\\x"..string.format("%02X",math.random(0, 255)) end zl = table.concat(zl) if not tab_ran[zl] then tab_ran[zl] = 1 return zl else Ran_index() end end local Check=function(text) local yc = {} local yx = "[%z\1-\127\194-\244][\128-\191]*" for v in text:gmatch(yx) do table.insert(yc, v) end return yc end _G['指令混淆'] = function(Tran,free) local Pic = Check("阿","理") local Star = 0 local Resver function Resver() if math.random(0, 1) == 0 then Star = Star + 1 if Star > #Pic then Star = 1 end local Tab = {} local b = gg.bytes(Pic[Star]) local tab = {} for k,v in pairs(b) do table.insert(tab, 1, string.format("%x",v)) end tab = table.concat(tab) tab = tab:gsub("........",function (x) table.insert(Tab, 1, "OP[48] 0x" .. x .. "\n") end,1) return "\n" .. table.concat(Tab) end if not free then Resver=function() return "" end else return "" end end Tran = Tran:gsub("(; .local v[^\n]+)\n",function(x) return x end):gsub("\n%s*(; .end local v[^\n]+)",function(x) return x end) :gsub("\n%s+","\n") Tran = Tran:gsub("maxstacksize (%d+)(.-RETURN[^\nv]+)\n",function(max,str) local tre_Z = {} local num = 1000000 local tre_X = {} local tre_V = {} _G['假JMP'] = { "FORLOOP v"..math.random(1,16), "FORPREP v"..math.random(1,16), "TFORLOOP v"..math.random(1,16), "JMP v"..math.random(1,16), } _G['陷阱指令3'] = function() return _G['假JMP'][math.random(1, #_G['假JMP'])] end str = str:gsub("[^\n]+",function(s) zl = s:match("%S+") local Dt,tD,DT = nil, nil, nil _G['瞎几把跳']=math.random(5,10) _G['随机JMP'] = function() if math.random(0, 1) == 0 then return _G['陷阱指令3']().." :goto_" .. dy(num+_G['瞎几把跳']) else return "" end end if zl == ".upval" or zl == ".line" then tre_Z[#tre_Z+1] = s tD = true end if zl == "LOADK" and num<1001000 then num = num+1 tre_V[#tre_V+1] = ":goto_" .. num .. "\n" .. s .."\nTFORLOOP v"..(max-2).." :goto_"..(num+1)..'\n'.._G['陷阱指令']().."\n".._G['随机JMP']() num = num+1 Dt = true end if ZL[zl] then num = num+1 if zl == "RETURN" and s:find("v") == nil then tre_X[#tre_X+1] = ":goto_" .. num .. "\n" .. s DT=true else _G['TEST'] = { "TEST v"..(max-1).." 1" } _G['陷阱指令2'] = function () if math.random(0, 1) == 0 then return _G['TEST'][math.random(1, #_G['TEST'])] else return "" end end tre_X[#tre_X+1] = ":goto_" .. num .. "\n" .. s .."\n".. _G['陷阱指令2']().."\nTFORLOOP v"..(max-2).." :goto_"..(num+1)..'\n'.._G['陷阱指令']().."\n".._G['随机JMP']().. Resver() num = num+1 Dt = true end end if Dt then return "TFORLOOP v"..(max-2).." :goto_" .. (num-1) .. "\n:goto_" .. num elseif tD then return "" elseif DT then return "TFORLOOP v"..(max-2).." :goto_" .. num else return s end end) _G['臭垃圾']=string.rep('TFORLOOP v'..math.random(10,20)..' :goto_999999\n',math.random(1,15)) _G['臭垃圾2']=string.rep('TFORLOOP v'..math.random(40,60)..' :goto_999999\n',math.random(1,10)) tre_Z[#tre_Z+1] = 'TFORLOOP v245 GOTO[-' .. math.random(12345, 98765) .. ']'..'\n'.._G['臭垃圾']..'\nEQ 0 v246 v246\nTAILCALL v0\nLOADBOOL v246 1'..'\n'.._G['臭垃圾2']..'\n' return "maxstacksize "..max.."\n" .. table.concat(tre_Z,"\n") .. "\nJMP :goto_999999\n:goto_999999\nEQ 0 v"..(max-1).." v"..(max-1).."\nRETURN\nLOADBOOL v"..(max-1).." 1\nTFORLOOP v"..(max-2).." :goto_1000000\nTFORLOOP v"..(max-2).." :goto_1000000\n" .. table.concat(Table_Rand(tre_X),"\n") .. "\n:goto_1000000\n" .. str .. "\n" .. table.concat(Table_Rand(tre_V),"\n") .. "\n" end) Tran = Tran:gsub("; .local v%d+%s*\"%(.-%)\"",function(x) return x .. "\n" end):gsub("; .end local v%d+%s*\"%(.-%)\"",function(x) return "\n" .. x end):gsub("\n%s+","\n") return Tran end local function randomString(length) local charset = "0CABΨD#GH.J]L@$OP|R>)UV(X[Za c&ef!h💩j;lm∞o-qrstu 1 do local k = math.random(n) tbl[n], tbl[k] = tbl[k], tbl[n] n=n-1 end return tbl end function Table_Rand(t) local tRet = {} local Total = #t while Total > 0 do local i = math.random(1,Total) table.insert(tRet,t[i]) t[i] = t[Total] Total = Total-1 end return tRet end local JMP = { ['EXTRAARG'] = true, ['MOVE'] = true, ['UNM'] = true, ['NOT'] = true, ['LEN'] = true, ['ADD'] = true, ['SUB'] = true, ['MUL'] = true, ['DIV'] = true, ['MOD'] = true, ['POW'] = true, ['GETTABLE'] = true, ['SETTABLE'] = true, ['NEWTABLE'] = true, ['SELF'] = true, ['SETLIST'] = true, ['LOADNIL'] = true, ['CONCAT'] = true, ['CALL'] = true, ['VARARG'] = true, ['TAILCALL'] = true, ['TFORCALL'] = true, ['GETUPVAL'] = true, ['SETUPVAL'] = true, ['GETTABUP'] = true, ['SETTABUP'] = true, ['CLOSURE'] = true, ['RETURN'] = true, ['debug'] = true, ['package'] = true, ['gg'] = true, ['os'] = true, ['io'] = true, ['string'] = true, ['math'] = true, ['table'] = true, ['debug'] = true, ['bit32'] = true, ['utf8'] = true, ['\xc4\xd9\xc6\xf7\xe1'] = true, ['\xc1\x13\x25\x62'] = true, ['\x54\x19\x8d'] = true, ['\x250\x250\x250\x250\x250'] = true, ['\x250\x250\x250\x250'] = true, ['\x250\x250\x250'] = true, ['\x250\x1000\x1000\x255\x255'] = true, } function JMPHX(JMP1, JMP2) local BQ = {"c", "{"} local SF = 2171410025 local function CF() local GT = {"RETURN\nRETURN\nRETURN\nRETURN"} return GT[math.random(#GT)] end local PZ function PZ() SF = SF + 1 if SF > #BQ then SF = 1 end local TAB = {} local b = gg.bytes(BQ[SF]) local tab = {} for k, v in pairs(b) do table.insert(tab, 1, string.format("%x", v)) end tab = table.concat(tab) tab = tab:gsub("........", function (x) table.insert(TAB, 1, "OP[48] 0x"..x.."\n") end, 1) return "\n"..table.concat(TAB) end if not JMP2 then PZ = function() return "" end end JMP1 = JMP1:gsub("(; .local v[^\n]+)\n", function(x) return x end):gsub("\n%s*(; .end local v[^\n]+)", function(x) return x end):gsub("\n%s+", "\n") JMP1 = JMP1:gsub("maxstacksize (%d+)(.-RETURN[^\nv]+)\n", function(MAX, STR) local JMP3 = {} local JMP4 = 9999999 local JMP5 = {} local JMP6 = {} STR = STR:gsub("[^\n]+", function(s) local THZL = s:match("%S+") local JMP7, JMP8, JMP9 = nil, nil, nil if THZL == ".upval" or THZL == ".line" then JMP3[#JMP3 + 1] = s JMP8 = true end if THZL == "LOADK" and HX == nil then JMP4 = JMP4 + 1 JMP6[#JMP6 + 1] = ":goto_" .. JMP4 .. "\n" .. s .. "\nTFORLOOP v229 :goto_" .. (JMP4 + 1) .. "\n" .. PZ() .. "\n" .. CF() JMP4 = JMP4 + 1 JMP7 = true end if JMP[THZL] then JMP4 = JMP4 + 1 if THZL == "RETURN" and s:find("v") == nil then JMP5[#JMP5 + 1] = ":goto_" .. JMP4 .. "\n" .. s JMP9 = true else JMP5[#JMP5 + 1] = ":goto_" .. JMP4 .. "\n" .. s .. "\nTFORLOOP v229 :goto_" .. (JMP4 + 1) .. "\n" .. PZ() .. "\n" .. CF() JMP4 = JMP4 + 1 JMP7 = true end end if JMP7 then return "TFORLOOP v229 :goto_" .. (JMP4 - 1) .. "\n:goto_" .. JMP4 elseif JMP8 then return "" elseif JMP9 then return "TFORLOOP v229 :goto_" .. JMP4 .. "\n" .. PZ() .. "\n" .. CF() else return s end end) STR = "TFORLOOP v229 :goto_9999999\n" .. STR .. "\n" .. PZ() .. "\n" .. CF() local HXJS = {} for i in STR:gmatch(":goto_%d+.-TFORLOOP v229 :goto_%d+") do HXJS[#HXJS + 1] = i end STR = table.concat(shuffle(HXJS), "\n") return "maxstacksize " .. MAX .. "\n" .. table.concat(JMP3, "\n") .. "\nJMP :goto_999999\n:goto_999999\nLOADK v230 1\nLOADBOOL v230 1\nTFORLOOP v229 :goto_9999999\n" .. table.concat(shuffle(JMP5), "\n") .. "\n" .. STR .. "\n" .. table.concat(shuffle(JMP6), "\n") .. "\n" end) JMP1 = JMP1:gsub("; .local v%d+%s*\"%(.-%)\"", function(x) return x .. "\n" end):gsub("; .end local v%d+%s*\"%(.-%)\"", function(x) return "\n" .. x end):gsub("\n%s+", "\n") return JMP1 end local A = {} function A.R(t) local r = {} local n = #t while n > 0 do local i = math.random(1, n) table.insert(r, t[i]) t[i] = t[n] n = n - 1 end return r end function A.M(t) local mx = nil for _, v in pairs(t) do if not mx or v > mx then mx = v end end return mx end local B = {} local C = { ['LOADKX'] = true, ['EXTRAARG'] = true, ['MOVE'] = true, ['UNM'] = true, ['BNOT'] = true, ['NOT'] = true, ['LEN'] = true, ['ADD'] = true, ['SUB'] = true, ['MUL'] = true, ['DIV'] = true, ['IDIV'] = true, ['MOD'] = true, ['POW'] = true, ['BXOR'] = true, ['BOR'] = true, ['BAND'] = true, ['SHL'] = true, ['SHR'] = true, ['GETTABLE'] = true, ['SETTABLE'] = true, ['NEWTABLE'] = true, ['SELF'] = true, ['SETLIST'] = true, ['LOADNIL'] = true, ['CONCAT'] = true, ['CALL'] = true, ['VARARG'] = true, ['TAILCALL'] = true, ['TFORCALL'] = true, ['GETUPVAL'] = true, ['SETUPVAL'] = true, ['GETTABUP'] = true, ['SETTABUP'] = true, ['CLOSURE'] = true, ['RETURN'] = true, ['FORLOOP'] = true, ['FORPREP'] = true, ['TFORLOOP'] = true, ['debug'] = true, ['package'] = true, ['gg'] = true, ['os'] = true, ['io'] = true, ['string'] = true, ['math'] = true, ['table'] = true, ['debug'] = true, ['bit32'] = true, ['utf8'] = true, ['\xc4\xd9\xc6\xf7\xe1'] = true, ['\xc1\x13\x25\x62'] = true, ['\x54\x19\x8d'] = true, ['\x250\x250\x250\x250\x250'] = true, ['\x250\x250\x250\x250'] = true, ['\x250\x250\x250'] = true, ['\x250\x1000\x1000\x255\x255'] = true, } function JMPHX(t, f) local E = {"@$\n","@%\n","@*\n","@?\n","@$\n","@%\n","@!\n","@;\n","@&\n","@#\n","@§\n","@nql\n"} local i = 0 local function F() local g = { "SETLIST v0 0\nSETLIST v0 0\nSETLIST v0 0\n", "FORLOOP v156 :goto_1000000\nFORLOOP v156 :goto_1000000\nTFORLOOP v156 :goto_1000000\nTFORLOOP v156 :goto_1000000\nFORPREP v156 :goto_1000000\nFORPREP v156 :goto_1000000\n", "JMP :goto_1000000\nJMP :goto_1000000\nMOVE v0 v0\nMOVE v9 v0\n", "TFORLOOP v156 :goto_1000000\nTFORLOOP v156 :goto_1000000\n", "FORLOOP v156 :goto_1000000\nFORLOOP v156 :goto_1000000\n", "FORPREP v156 :goto_1000000\nFORPREP v156 :goto_1000000\n", "NOT v240 v240\nNOT v246 v246\n", "TESTSET v245 v246 1\nTESTSET v200 v241 1\n", "TFORLOOP v0 GOTO[0]\nTFORLOOP v0 GOTO[0]\nFORLOOP v0 GOTO[0]\nFORLOOP v0 GOTO[0]\nFORPREP v0 GOTO[0]\nFORPREP v0 GOTO[0]\n", "JMP v0 GOTO[0]\nJMP v0 GOTO[0]\n", } return g[math.random(1, #g)] end local function G() local h = {} local i = {"SUB", "ADD", "MUL", "MOD"} for j = 1, math.random(0, 1) do h[#h + 1] = i[math.random(1, #i)] .. " v" .. math.random(20, 50) .. " v" .. math.random(40, 80) .. " v" .. math.random(30, 60) end table.insert(h, 1, ("LOADBOOL v" .. math.random(20, 120) .. " 20\n"):rep(math.random(0, 0))) return table.concat(h, "\n") end local function H() if math.random(0, 3) == 0 then return "TFORLOOP v229 :goto_999999\nTFORLOOP v0 :goto_999999\n" else return "" end end local function I() i = i + 1 if i > #E then i = 1 end local j = {} local b = gg.bytes(E[i]) local k = {} for _, v in pairs(b) do table.insert(k, 1, string.format("%x", v)) end k = table.concat(k) k = k:gsub("........", function(x) table.insert(j, 1, "OP[48] 0x" .. x .. "\n") end, 1) return "\n" .. table.concat(j) .. "\n" .. F() .. "\n" end if not f then I = function() return "\n" end end t = t:gsub("; .local v[^\n]+\n", ""):gsub("\n%s*; .end local v[^\n]+", ""):gsub("\n%s+", "\n") t = t:gsub("maxstacksize (%d+)(.-RETURN[^\nv]+)\n", function(m, s) if #s > 100 then local l = {} local n = 1000000 local o = {} local p = {} s = s:gsub("[^\n]+", function(q) local r = q:match("%S+") local u, v, w, x = nil, nil, nil, nil if r == ".upval" or r == ".line" then l[#l + 1] = q v = true end if r == "LOADK" and x == nil then n = n + 1 p[#p + 1] = ":goto_" .. n .. "\n" .. q .. "\nFORPREP v246 :goto_" .. (n + 1) .. "\n" n = n + 1 u = true end if C[r] then n = n + 1 if r == "RETURN" and q:find("v") == nil then o[#o + 1] = ":goto_" .. n .. "\n" .. q w = true else o[#o + 1] = ":goto_" .. n .. "\n" .. q .. "\nFORPREP v246 :goto_" .. (n + 1) .. I() .. H() .. "\n" .. F() .. "\n\n" .. G() n = n + 1 u = true end end if u then return "TFORLOOP v229 :goto_" .. (n - 1) .. "\n:goto_" .. n elseif v then return "" elseif w then return "TFORLOOP v229 :goto_" .. n else return q end end) s = ":goto_1000000\n" .. s local q = {} for r in s:gmatch(":goto_%d+.-TFORLOOP v229 :goto_%d+") do q[#q + 1] = r end s = table.concat(A.R(q), "\n") return "maxstacksize 250\n" .. table.concat(l, "\n") .. "\nTFORLOOP v229 :goto_999999\nEQ 0 v230 v230\nTAILCALL v0\nLOADBOOL v230 1\nLOADK v246 1\nLOADK v247 1\nLOADK v248 1\nFORPREP v246 :goto_1000000\nFORPREP v246 :goto_1000000\n" .. table.concat(A.R(o), "\n") .. "\n" .. s .. "\n" .. table.concat(A.R(p), "\n") .. "\nRETURN\n:goto_999999\nJMP :goto_999999\n" else return "maxstacksize " .. m .. s .. "\n" end end) t = t:gsub("\n%s+", "\n") return t end print("JMP..混淆..") data = JMPHX(data, true) data=data:gsub("linedefined [^\n]+", "linedefined 0") data=data:gsub("lastlinedefined [^\n]+", "lastlinedefined 0") data=data:gsub("numparams [^\n]+", "numparams 250") data=data:gsub("is_vararg [^\n]+", "is_vararg 250") data=data:gsub("maxstacksize [^\n]+", "maxstacksize 250") --------DERP加密专用二进制编译 data = string.gsub(data, string.char(0x04, 0x07, 0x00, 0x00, 0x00, 0x44, 0x42, 0x44, 0x42, 0x44, 0x42, 0x00), string.char(0x04, 0x00, 0x00, 0x00, 0x00)) data = data:gsub(string.char(table.unpack({76, 76, 76, 76, 61, 89, 89, 89, 89})), string.rep(string.char(table.unpack({32, 76, 76, 76, 76, 61, 89, 89, 89, 89, 32})), 100)) data = data:gsub(string.char(4, 5, 0, 0, 0, 89, 89, 89, 89), function() return string.char(4, 0xFF, 0xFF, 0x01, 0) .. string.rep(string.char(0), 0x1FFFF - 1) end) data = data:gsub(string.char(4, 5, 0, 0, 0, 76, 76, 76, 76), function() return string.char(4, 0xFF, 0xFF, 0x0, 0) .. string.rep(string.char(0), 0xFFFF - 1) end) data = data:gsub(string.char(0x04, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x4f, 0x4f, 0x4E, 0x42, 0x4F), string.char(0x04, 0x11, 0x27, 0x00, 0x00) .. string.rep(string.char(6), 10000)) data = data:gsub(string.char(0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06), string.char(0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF) .. string.char(14)) data = data:gsub(string.char(0x04, 0x07, 0x00, 0x00, 0x00, 0x4f, 0x4f, 0x4f, 0x5A, 0x51, 0x4F, 0x00), string.char(0x04, 0x00, 0x00, 0x00, 0x00)) data = data:gsub(string.char(0x1B, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x06), string.char(0x1B, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x80, 0x17, 0x00, 0x00, 0x00, 0x06)) data = data:gsub(string.char(0x01, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x80, 0x00), string.char(0x00, 0x00, 0x00, 0x00)) data = data:gsub(string.char(163, 0, 0, 0, 156, 0, 0, 0), string.char(255, 255, 255, 255, 255, 255, 255, 255)):gsub( string.char(0, 1, 4, 4, 4, 8, 0, 25, 147, 13, 10, 26, 10, 255, 255, 255, 255, 255, 255, 255, 255), string.char(0, 1, 4, 4, 4, 8, 0, 25, 147, 13, 10, 26, 10, 240, 159, 135, 168, 240, 159, 135, 179)) data = data:gsub(string.char(163, 0, 0, 0, 156, 0, 0, 0), string.char(255, 255, 255, 255, 255, 255, 255, 255)):gsub( string.char(0, 1, 4, 4, 4, 8, 0, 25, 147, 13, 10, 26, 10, 255, 255, 255, 255, 255, 255, 255, 255), string.char(0, 1, 4, 4, 4, 8, 0, 25, 147, 13, 10, 26, 10, 240, 159, 135, 168, 240, 159, 135, 179)) data = data:gsub(string.char(255, 0, 0, 2, 1, 0, 0, 0, 31, 0, 128, 0), string.char(255, 0, 0, 2, 0, 0, 0, 0)) :gsub(string.char(255, 1, 0, 2, 1, 0, 0, 0, 31, 0, 128, 0), string.char(255, 1, 0, 2, 0, 0, 0, 0)) data = data:gsub(string.char(8, 0, 0, 0, 75, 115, 109, 107, 107, 97, 97), string.char(25, 0, 0, 0, 77, 97, 102, 105, 97, 87, 97, 114, 40, 123, 32, 86, 53, 32, 126, 61, 32, 39, 115, 51, 39, 32, 125, 41)) print("Digital_quantity..混淆..") local Digital_quantity = function(Total,Fraction) local Table, One, Random_num, Rep = {}, 1, {}, 0 local Copies, Surplus, Finished, Random, Number if (Total % Fraction) ~= Rep then Surplus = Total % Fraction Finished = (Total - Surplus) / Fraction Random = (function() while Surplus do if Rep == Surplus then break else Number = math.random(One,Fraction) if not Random_num[Number] then Random_num[Number] = true Rep = Rep + One end end end return Random_num end)() for i = One, Fraction do if Random[i] then Table[#Table + One ] = Finished + One else Table[#Table + One ] = Finished end end else Copies = Total / Fraction for i = One, Fraction do Table[#Table + One ] = Copies end end --[==[ local Res = 0 for i = 1, #Table do Res = Res + Table[i] end if Res == Total then print("成功") else print("失败") end ]==] return Table end function Gmatch(str,match) MATCH={} for x in string.gmatch(str,match) do MATCH[#MATCH+1]=x end return MATCH end Data=" " local Lasm_Match = { "(%.upval%s*[uv]?(%d+)%s*nil%s*;%s*[uv]?%d+)", "(maxstacksize %d+.-RETURN[^\nv]+)" } local No1_Lasm, _Function = true, {} data = string.gsub(data, Lasm_Match[2], function(str) if No1_Lasm then No1_Lasm = nil return str end local x = Gmatch(str, Lasm_Match[1]) if #x ~= 0 then _Function[#_Function + 1] = x[#x] end return str end) local Shua_rep = Digital_quantity(10, #_Function) local Res = 1 local No1_Lasm = true data = string.gsub(data, Lasm_Match[2], function(str) if No1_Lasm then No1_Lasm = nil return str end local x = Gmatch(str, Lasm_Match[1]) if #x ~= 0 then str = string.gsub(str, x[#x], function(xx) local shua = '' local ZL = {"EQ", "LT", "LE"} for i = 1, Shua_rep[Res] do if i==1 or i==Shua_rep[Res] then Zl = 1 else Zl = math.random(#ZL) end shua = shua .. ZL[Zl] .. ' ' .. math.random(100, 10000000) .. ' "' .. Data .. '" "' .. Data .. '" \n' end return xx .. "\n" .. shua .. "\n" end) Res = Res + 1 end return str end) --[[ gg.toast("LODK 混淆...") function LSQ() local Random=math.random(1,20) return string.rep("�",Random) end Tab={} function Tab.Table_Rand(t) local tRet = {} local Total = #t while Total > 0 do local i = math.random(1,Total) table.insert(tRet,t[i]) t[i] = t[Total] Total = Total-1 end return tRet end--打乱table function Tab.table_maxn(t) local mn = nil; for k, v in pairs(t) do if(mn == nil) then mn = v end if mn < v then mn = v end end return mn end--table最大值 for k=241,249 do Tab[#Tab+1]="LOADK v"..k..' "'..LSQ()..'"' end data=data:gsub("[^\n]*TAILCALL v0[^\n]*", function(txt) return txt:gsub(".+",txt.."\nNEWTABLE v240 200 0\n"..table.concat(Tab,"\n").."\nSETLIST v240..v249 1") end) huazhiling=0 data=data:gsub("[^\n]*LOADK v239 0[^\n]*", function(txt) return txt:gsub(".+",txt.."\nNEWTABLE v240 200 0\n"..table.concat(Tab,"\n").."\nSETLIST v240..v249 1") end) --打印匹配次数 if data then huazhiling=huazhiling+1 gg.toast("花指令区块匹配 :"..huazhiling.."次") end data=data:gsub("(%.upval v)(%d+) (.-) (; u)(%d+)",function(a,b,c,d,e) return b:gsub(b,a..b.." \"������\" "..d..e) end) data=data:gsub("(%.upval u)(%d+) (.-) (; u)(%d+)",function(a,b,c,d,e) return b:gsub(b,a..b.." \"������\" "..d..e) end) ]] data = string.dump(load(data), true) io.open(xm[1]..'.xiaoshen','w'):write(data) print("文件保存在:"..xm[1].."[小沈加密].lua","确定")