forked from PY44N/Lua-Obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rerubi.min.lua
1 lines (1 loc) · 8.52 KB
/
Rerubi.min.lua
1
return (function(a,b)local c=select;local d=string.byte;local e=string.sub;local f={{b='OpArgR',c='OpArgN'},{b='OpArgK',c='OpArgN'},{b='OpArgU',c='OpArgU'},{b='OpArgR',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgK',c='OpArgN'},{b='OpArgR',c='OpArgK'},{b='OpArgK',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgK',c='OpArgK'},{b='OpArgU',c='OpArgU'},{b='OpArgR',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgR'},{b='OpArgR',c='OpArgN'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgK',c='OpArgK'},{b='OpArgR',c='OpArgU'},{b='OpArgR',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgU',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgR',c='OpArgN'},{b='OpArgN',c='OpArgU'},{b='OpArgU',c='OpArgU'},{b='OpArgN',c='OpArgN'},{b='OpArgU',c='OpArgN'},{b='OpArgU',c='OpArgN'}}local g={'ABC','ABx','ABC','ABC','ABC','ABx','ABC','ABx','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','AsBx','ABC','ABC','ABC','ABC','ABC','ABC','ABC','ABC','AsBx','AsBx','ABC','ABC','ABC','ABx','ABC'}local function h(i,j,k)if k then local l=i/2^(j-1)%2^(k-1-(j-1)+1)return l-l%1 else local m=2^(j-1)if i%(m+m)>=m then return 1 else return 0 end end end;local function n(o)local p=1;local q;local r;local function s()local t=d(o,p,p)p=p+1;return t end;local function u()local v,w,x,y=d(o,p,p+3)p=p+4;return y*16777216+x*65536+w*256+v end;local function z()return u()*4294967296+u()end;local function A()local B=u()local C=u()local D=1;local E=h(C,1,20)*2^32+B;local F=h(C,21,31)local G=(-1)^h(C,32)if F==0 then if E==0 then return G*0 else F=1;D=0 end elseif F==2047 then if E==0 then return G*1/0 else return G*0/0 end end;return math.ldexp(G,F-1023)*(D+E/2^52)end;local function H(I)local J;if I then J=e(o,p,p+I-1)p=p+I else I=q()if I==0 then return end;J=e(o,p,p+I-1)p=p+I end;return J end;local function K()local L={}local M={}local N={}local O={Instr=L,Const=M,Proto=N,Lines={},Name=H(),FirstL=r(),LastL=r(),Upvals=s(),Args=s(),Vargs=s(),Stack=s()}local P={}if O.Name then O.Name=e(O.Name,1,-2)end;for Q=1,r()do local R=u()local S=h(R,1,6)local T=g[S+1]local U=f[S+1]local V={Enum=S,Value=R,h(R,7,14)}if T=='ABC'then V[2]=h(R,24,32)V[3]=h(R,15,23)elseif T=='ABx'then V[2]=h(R,15,32)elseif T=='AsBx'then V[2]=h(R,15,32)-131071 end;do if S==26 or S==27 then V[3]=V[3]==0 end;if S>=23 and S<=25 then V[1]=V[1]~=0 end;if U.b=='OpArgK'then V[3]=V[3]or false;if V[2]>=256 then local W=V[2]-256;V[4]=W;local X=P[W]if not X then X={}P[W]=X end;X[#X+1]={Inst=V,Register=4}end end;if U.c=='OpArgK'then V[4]=V[4]or false;if V[3]>=256 then local W=V[3]-256;V[5]=W;local X=P[W]if not X then X={}P[W]=X end;X[#X+1]={Inst=V,Register=5}end end end;L[Q]=V end;for Q=1,r()do local T=s()local W;if T==1 then W=s()~=0 elseif T==3 then W=A()elseif T==4 then W=e(H(),1,-2)end;local Y=P[Q-1]if Y then for Z=1,#Y do Y[Z].Inst[Y[Z].Register]=W end end;M[Q-1]=W end;for Q=1,r()do N[Q-1]=K()end;do local _=O.Lines;for Q=1,r()do _[Q]=u()end;for a0=1,r()do H()u()u()end;for a0=1,r()do H()end end;return O end;do assert(H(4)=="\27Lua","Lua bytecode expected.")assert(s()==0x51,"Only Lua 5.1 is supported.")s()s()local a1=s()local a2=s()if a1==4 then r=u elseif a1==8 then r=z else error('Integer size not supported',2)end;if a2==4 then q=u elseif a2==8 then q=z else error('Sizet size not supported',2)end;assert(H(3)=="\4\8\0","Unsupported bytecode target platform")end;return K()end;local function a3(...)return c('#',...),{...}end;local function a4(O,b,a5)local L=O.Instr;local M=O.Const;local N=O.Proto;local function a6(a7,a8)local a9=O.Name or'Code'local aa=O.Lines[a8]or'?'error(string.format('%s:%s: %s',a9,aa,tostring(a7)),0)end;return function(...)local ab,ac=1,-1;local ad,ae={},c('#',...)-1;local af={}local ag={}local ah=setmetatable({},{__index=af,__newindex=function(a0,ai,aj)if ai>ac then ac=ai end;af[ai]=aj end})local function ak()local V,al;while true do V=L[ab]al=V.Enum;ab=ab+1;if al==0 then ah[V[1]]=ah[V[2]]elseif al==1 then ah[V[1]]=M[V[2]]elseif al==2 then ah[V[1]]=V[2]~=0;if V[3]~=0 then ab=ab+1 end elseif al==3 then local am=ah;for Q=V[1],V[2]do am[Q]=nil end elseif al==4 then ah[V[1]]=a5[V[2]]elseif al==5 then ah[V[1]]=b[M[V[2]]]elseif al==6 then local am=ah;am[V[1]]=am[V[2]][V[5]or am[V[3]]]elseif al==7 then b[M[V[2]]]=ah[V[1]]elseif al==8 then a5[V[2]]=ah[V[1]]elseif al==9 then local am=ah;am[V[1]][V[4]or am[V[2]]]=V[5]or am[V[3]]elseif al==10 then ah[V[1]]={}elseif al==11 then local am=ah;local an=V[1]local ao=am[V[2]]local ap=V[5]or am[V[3]]am[an+1]=ao;am[an]=ao[ap]elseif al==12 then local am=ah;am[V[1]]=(V[4]or am[V[2]])+(V[5]or am[V[3]])elseif al==13 then local am=ah;am[V[1]]=(V[4]or am[V[2]])-(V[5]or am[V[3]])elseif al==14 then local am=ah;am[V[1]]=(V[4]or am[V[2]])*(V[5]or am[V[3]])elseif al==15 then local am=ah;am[V[1]]=(V[4]or am[V[2]])/(V[5]or am[V[3]])elseif al==16 then local am=ah;am[V[1]]=(V[4]or am[V[2]])%(V[5]or am[V[3]])elseif al==17 then local am=ah;am[V[1]]=(V[4]or am[V[2]])^(V[5]or am[V[3]])elseif al==18 then ah[V[1]]=-ah[V[2]]elseif al==19 then ah[V[1]]=not ah[V[2]]elseif al==20 then ah[V[1]]=#ah[V[2]]elseif al==21 then local am=ah;local ao=V[2]local aq=am[ao]for Q=ao+1,V[3]do aq=aq..am[Q]end;ah[V[1]]=aq elseif al==22 then ab=ab+V[2]elseif al==23 then local am=ah;local ao=V[4]or am[V[2]]local ap=V[5]or am[V[3]]if ao==ap~=V[1]then ab=ab+1 end elseif al==24 then local am=ah;local ao=V[4]or am[V[2]]local ap=V[5]or am[V[3]]if ao<ap~=V[1]then ab=ab+1 end elseif al==25 then local am=ah;local ao=V[4]or am[V[2]]local ap=V[5]or am[V[3]]if ao<=ap~=V[1]then ab=ab+1 end elseif al==26 then if V[3]then if ah[V[1]]then ab=ab+1 end elseif ah[V[1]]then else ab=ab+1 end elseif al==27 then local ao=ah[V[2]]if V[3]then if ao then ab=ab+1 else ah[V[1]]=ao end elseif ao then ah[V[1]]=ao else ab=ab+1 end elseif al==28 then local an=V[1]local ao=V[2]local ap=V[3]local am=ah;local ar,as;local at,au;ar={}if ao~=1 then if ao~=0 then at=an+ao-1 else at=ac end;au=0;for Q=an+1,at do au=au+1;ar[au]=am[Q]end;at,as=a3(am[an](unpack(ar,1,at-an)))else at,as=a3(am[an]())end;ac=an-1;if ap~=1 then if ap~=0 then at=an+ap-2 else at=at+an-1 end;au=0;for Q=an,at do au=au+1;am[Q]=as[au]end end elseif al==29 then local an=V[1]local ao=V[2]local am=ah;local ar,as;local at;local av=0;ar={}if ao~=1 then if ao~=0 then at=an+ao-1 else at=ac end;for Q=an+1,at do ar[#ar+1]=am[Q]end;as={am[an](unpack(ar,1,at-an))}else as={am[an]()}end;for aw in pairs(as)do if aw>av then av=aw end end;return as,av elseif al==30 then local an=V[1]local ao=V[2]local am=ah;local au,ax;local at;if ao==1 then return elseif ao==0 then at=ac else at=an+ao-2 end;ax={}au=0;for Q=an,at do au=au+1;ax[au]=am[Q]end;return ax,au elseif al==31 then local an=V[1]local am=ah;local ay=am[an+2]local aw=am[an]+ay;am[an]=aw;if ay>0 then if aw<=am[an+1]then ab=ab+V[2]am[an+3]=aw end else if aw>=am[an+1]then ab=ab+V[2]am[an+3]=aw end end elseif al==32 then local an=V[1]local am=ah;am[an]=assert(tonumber(am[an]),'`for` initial value must be a number')am[an+1]=assert(tonumber(am[an+1]),'`for` limit must be a number')am[an+2]=assert(tonumber(am[an+2]),'`for` step must be a number')am[an]=am[an]-am[an+2]ab=ab+V[2]elseif al==33 then local an=V[1]local ap=V[3]local am=ah;local az=an+2;local aA={am[an](am[an+1],am[an+2])}for Q=1,ap do ah[az+Q]=aA[Q]end;if am[an+3]~=nil then am[an+2]=am[an+3]else ab=ab+1 end elseif al==34 then local an=V[1]local ao=V[2]local ap=V[3]local am=ah;if ap==0 then ab=ab+1;ap=L[ab].Value end;local az=(ap-1)*50;local aB=am[an]if ao==0 then ao=ac-an end;for Q=1,ao do aB[az+Q]=am[an+Q]end elseif al==35 then local an=V[1]local aC={}for Q=1,#ag do local aD=ag[Q]for aE=0,#aD do local aF=aD[aE]local am=aF[1]local p=aF[2]if am==ah and p>=an then aC[p]=am[p]aF[1]=aC end end end elseif al==36 then local aG=N[V[2]]local am=ah;local aH;local aI;if aG.Upvals~=0 then aH={}aI=setmetatable({},{__index=function(a0,ai)local aJ=aH[ai]return aJ[1][aJ[2]]end,__newindex=function(a0,ai,aj)local aJ=aH[ai]aJ[1][aJ[2]]=aj end})for Q=1,aG.Upvals do local aK=L[ab]if aK.Enum==0 then aH[Q-1]={am,aK[2]}elseif aK.Enum==4 then aH[Q-1]={a5,aK[2]}end;ab=ab+1 end;ag[#ag+1]=aH end;am[V[1]]=a4(aG,b,aI)elseif al==37 then local an=V[1]local ao=V[2]local am,aL=ah,ad;ac=an-1;for Q=an,an+(ao>0 and ao-1 or ae)do am[Q]=aL[Q-an]end end end end;local ar={...}for Q=0,ae do if Q>=O.Args then ad[Q-O.Args]=ar[Q+1]else ah[Q]=ar[Q+1]end end;local an,ao,ap=pcall(ak)if an then if ao and ap>0 then return unpack(ao,1,ap)end;return else a6(ao,ab-1)end end end;local aM=n(a)return a4(aM,b or getfenv(0)),aM end)