-- Dakarun sealed loader (Lua/Luau). Paste into your executor and run. -- Signature is verified before anything executes. local _dkr_selfck = "1315166108" local _dkr_bridge = { httpget = httpget, gethui = gethui, setfpscap = setfpscap, request = request, toclipboard = toclipboard, http_get = httpget, islclosure = islclosure, identifyexecutor = identifyexecutor, hookfunction = hookfunction, getinstances = getinstances, getgenv = getgenv, loadstring = loadstring, setscriptable = setscriptable, workspace = workspace, newcclosure = newcclosure, getrenv = getrenv, shared = shared, isscriptable = isscriptable, getrunningscripts = getrunningscripts, getfpscap = getfpscap, getloadedmodules = getloadedmodules, setclipboard = setclipboard, iscclosure = iscclosure, fireproximityprompt = fireproximityprompt, fireclickdetector = fireclickdetector, game = game, getobjects = getobjects, getnilinstances = getnilinstances, } local _dkr_hostg = _G local _dkr_z0 = 897563025 local _dkr_z1 = 100490067 local _dkr_schar, _dkr_ssub, _dkr_tconcat = string.char, string.sub, table.concat local _dkr_print = print if not (_dkr_schar and _dkr_ssub and _dkr_tconcat and string.byte) then error("Dakarun: runtime unavailable") end local _dkr_gi = debug and debug.getinfo if _dkr_gi then local _dkr_hookok = true local function _dkr_isc(f) local _dkr_i = _dkr_gi(f, "S") return _dkr_i and _dkr_i.what == "C" end if not (_dkr_isc(_dkr_tconcat) and _dkr_isc(_dkr_schar) and _dkr_isc(_dkr_ssub) and _dkr_isc(string.byte)) then _dkr_hookok = false end _dkr_isc = nil if not _dkr_hookok then error("Dakarun: environment mismatch") end end _dkr_gi = nil local _dkr_vm = (function() local eua=-1 local eub=0 local euc=1 local eud=2 local eue=3 local euf=4 local eug=5 local euh=6 local eui=7 local euj=8 local euk=9 local eul=10 local eum=11 local eun=12 local euo=13 local eup=14 local euq=15 local eur=16 local eus=17 local eut=18 local euu=19 local euv=20 local euw=21 local eux=22 local euy=23 local euz=24 local eva=25 local evb=26 local evc=27 local evd=28 local eve=29 local evf=30 local evg=31 local evh=32 local evi=33 local evj=34 local evk=35 local evl=36 local evm=37 local evn=38 local evo=39 local evp=40 local evq=41 local evr=42 local evs=43 local evt=evs+1 local evu={kind='__mark'}local evv=64 local evw=evv*12 local evx=evw/64 local evy=16 local function evz(ewa,ewb)local ewc=ewa[ewb]+ewa[ewb+1]*256+ewa[ewb+2]*65536+ewa[ewb+3]*16777216 if ewc>=2147483648 then ewc=ewc-4294967296 end return ewc end local function ewd(ewe)if ewe==nil then return'nil'end local ewf=type(ewe)if ewf=='number'then return'number'elseif ewf=='string'then return'string'elseif ewf=='boolean'then return'boolean'elseif ewf=='userdata'then return'userdata'end if ewf=='table'then local ewg=ewe.kind if ewg=='table'then return'table'elseif ewg=='__mark'then return'mark'end return'table'end return'function'end local function ewh(ewi)return ewi==nil or ewi==false end local function ewj(ewk)if ewk==math.huge then return'inf'elseif ewk==-math.huge then return'-inf'elseif ewk~=ewk then return'-nan'end return tostring(ewk)end local function ewl(ewm)if ewm==nil then return'nil'end local ewn=type(ewm)if ewn=='number'then return ewj(ewm)elseif ewn=='string'then return ewm elseif ewn=='boolean'then return ewm and'true'or'false'elseif ewn=='userdata'then return tostring(ewm)elseif ewn=='table'then local ewo=ewm.kind if ewo=='table'then return'table'elseif ewo=='__mark'then return'mark'end return tostring(ewm)end return'function'end local function ewp(ewq)if type(ewq)=='number'then return ewq end if type(ewq)=='string'then if ewq:match('^%s*$')then return nil end return tonumber(ewq)end return nil end local function ewr(ews,ewt)if ewd(ews)~=ewd(ewt)then return false end return ews==ewt end local function ewu(ewv)local eww=type(ewv)if eww=='string'then return's:'..ewv elseif eww=='number'then return'n:'..ewj(ewv)elseif eww=='boolean'then return'b:'..(ewv and'true'or'false')end error('table index is '..ewd(ewv),0)end local function ewx(ewy)local ewz=ewy:sub(1,2)local exa=ewy:sub(3)if ewz=='n:'then return tonumber(exa)elseif ewz=='b:'then return exa=='true'end return exa end local function exb(exc)return type(exc)=='table'and exc.kind=='table'end local function exd(exe,exf)local exg=exe.n+1 exe.n=exg exe[exg]=exf return exe end local function exh(exi,exj)local exk={n=0}for exl=exj,exi.n do exd(exk,exi[exl])end return exk end local exm={}exm.__index=exm local exn function exm.new(exo,exp,exq,exr,exs)local ext=exo.m if#ext~=evt then error('bad opcode map',0)end local exu={}for exv=0,evt-1 do exu[ext[exv+1]+1]=exv end local self=setmetatable({},exm)self.inv=exu self.protos=exo.p self.stack={}self.sp=0 self.frames={}self.output={}self.globals={}local exw={}for exx,exy in ipairs(exo.p)do if exy.code~=nil then exw[exy]={plain=exy.code}else local exz=exx-1 local eya={}for eyb=1,evy do eya[#eya+1]={idx=-1,dec={},last=0}end exw[exy]={cb=exy.cb,cbn=exy.cbn,n=exy.ncode,nonce={exz%256,math.floor(exz/256)%256,math.floor(exz/65536)%256,math.floor(exz/16777216)%256,0,0,0,0,0,0,0,0,},key=exr,tick=0,loads=0,slots=eya,xor=exs,}end end self.readers=exw installBuiltins(self)if exp~=nil then exn(self,exp,exq)end return self end function exm:fetch(eyc,eyd)if eyc.plain then local eye=eyc.plain[eyd+1]if not eye then return nil end return eye[1],eye[2],eye[3]end if eyd<0 or eyd>=eyc.n then return nil end local eyf=math.floor(eyd/evv)local eyg=eyc.slots local eyh,eyi=nil,eyg[1]for eyj=1,#eyg do local eyk=eyg[eyj]if eyk.idx==eyf then eyh=eyk break end if eyk.lasteyc.cbn then eyo=eyc.cbn-eyn end local eyp=eyc.cb local eyq={}for eyr=1,eyo do eyq[eyr]=eyp[eyn+eyr]end local eys=eyc.xor(eyc.key,eyc.nonce,eyq,eyo,eyf*evx)for eyt=1,eyo do eyq[eyt]=0 end local eyu=0 for eyv=0,eyo-12,12 do eyl[eyu+1]=evz(eys,eyv+1)eyl[eyu+2]=evz(eys,eyv+5)eyl[eyu+3]=evz(eys,eyv+9)eyu=eyu+3 end for eyw=1,eyo do eys[eyw]=0 end eyh.idx=eyf eyc.loads=eyc.loads+1 end eyc.tick=eyc.tick+1 eyh.last=eyc.tick local eyx=(eyd%evv)*3 local eyy=eyh.dec return eyy[eyx+1],eyy[eyx+2],eyy[eyx+3]end function exm:push(eyz)local eza=self.sp+1 self.sp=eza self.stack[eza]=eyz end function exm:pop()local ezb=self.sp if ezb==0 then self:fail('stack underflow')end local ezc=self.stack[ezb]self.stack[ezb]=nil self.sp=ezb-1 return ezc end function exm:boxOf(ezd,eze)local ezf=ezd.boxes[eze+1]if ezf==nil then ezf={v=nil}ezd.boxes[eze+1]=ezf end return ezf end function exm:currentLine()local ezg=self.frames[#self.frames]if not ezg then return nil end return ezg.proto.lines[ezg.pc+1]end function exm:fail(ezh)local ezi=self:currentLine()if ezi~=nil then error('line '..ezi..': '..ezh,0)else error(ezh,0)end end function exm:popToMark()local ezj={n=0}while true do local ezk=self:pop()if ezk==evu then break end ezj.n=ezj.n+1 ezj[ezj.n]=ezk end local ezl=ezj.n for ezm=1,math.floor(ezl/2)do local ezn=ezl-ezm+1 ezj[ezm],ezj[ezn]=ezj[ezn],ezj[ezm]end return ezj end function exm:pushFrame(ezo,ezp,ezq)local ezr=ezo.proto local ezs={}for ezt=1,ezr.nparams do local ezu=nil if ezt<=ezp.n then ezu=ezp[ezt]end ezs[ezt]={v=ezu}end local ezv={n=0}if ezr.vararg then for ezw=ezr.nparams+1,ezp.n do exd(ezv,ezp[ezw])end end self.frames[#self.frames+1]={closure=ezo,proto=ezr,reader=self.readers[ezr],pc=0,base=self.sp,boxes=ezs,varargs=ezv,nwant=ezq,}end function exm:callValue(ezx,ezy,ezz)local faa=type(ezx)=='table'and ezx.kind or nil if faa=='closure'then self:pushFrame(ezx,ezy,ezz)return end if faa=='builtin'then local fab=ezx.fn(self,ezy)local fac=fab.n or#fab if ezz==eua then for fad=1,fac do self:push(fab[fad])end else for fae=1,ezz do if fae<=fac then self:push(fab[fae])else self:push(nil)end end end return end if type(ezx)=='function'then self:callHost(ezx,ezy,ezz)return end self:fail('attempt to call a '..ewd(ezx)..' value')end function exm:doReturn(faf)local fag=self.frames[#self.frames]self.frames[#self.frames]=nil if#self.frames==0 then return end for fah=self.sp,fag.base+1,-1 do self.stack[fah]=nil end self.sp=fag.base local fai=faf.n or#faf if fag.nwant==eua then for faj=1,fai do self:push(faf[faj])end else for fak=1,fag.nwant do if fak<=fai then self:push(faf[fak])else self:push(nil)end end end end function exm:run(fal)while#self.frames>fal do self:step()end end function exm:protectedCall(fam,fan)local fao=type(fam)=='table'and fam.kind or nil if fao~='closure'and fao~='builtin'then return{ok=false,vals={n=1,'attempt to call a '..ewd(fam)..' value'}}end local fap=#self.frames local faq=self.sp local far,fas=pcall(function()self:callValue(fam,fan,eua)self:run(fap)end)if not far then for fat=#self.frames,fap+1,-1 do self.frames[fat]=nil end for fau=self.sp,faq+1,-1 do self.stack[fau]=nil end self.sp=faq local fav=type(fas)=='string'and fas or('error: '..tostring(fas))return{ok=false,vals={n=1,fav}}end local faw={n=0}for fax=faq+1,self.sp do exd(faw,self.stack[fax])end for fay=self.sp,faq+1,-1 do self.stack[fay]=nil end self.sp=faq return{ok=true,vals=faw}end function exm:getIndex(faz,fba)if exb(faz)then if type(fba)=='number'and fba==math.floor(fba)and fba>=1 then return faz.arr[fba]end return faz.map[ewu(fba)]end if type(faz)=='table'or type(faz)=='userdata'then return faz[fba]end if type(faz)=='string'then local fbb=self.globals.string if type(fbb)=='table'then local fbc=fbb[fba]if fbc~=nil then return fbc end end self:fail('attempt to index a string value')end self:fail('attempt to index a '..ewd(faz)..' value')end function exm:setIndex(fbd,fbe,fbf)if exb(fbd)then if type(fbe)=='number'and fbe==math.floor(fbe)and fbe>=1 then fbd.arr[fbe]=fbf if fbe>fbd.len then fbd.len=fbe end return end local fbg=ewu(fbe)if fbf==nil then fbd.map[fbg]=nil else fbd.map[fbg]=fbf end return end if type(fbd)=='table'or type(fbd)=='userdata'then fbd[fbe]=self:toHost(fbf)return end self:fail('attempt to index a '..ewd(fbd)..' value')end function exm:step()local fbh=self.frames[#self.frames]local fbi,fbj,fbk=self:fetch(fbh.reader,fbh.pc)fbh.pc=fbh.pc+1 if fbi==nil then self:fail('program counter out of range')end local fbl=self.inv[fbi+1]local fbm=self.stack if fbl==eub then self:push(fbh.proto.consts[fbj+1])elseif fbl==euc then self:push(self:boxOf(fbh,fbj).v)elseif fbl==eud then self:boxOf(fbh,fbj).v=self:pop()elseif fbl==eue then local fbn=fbh.closure.upvals[fbj+1]if not fbn then self:fail('bad upvalue '..fbj)end self:push(fbn.v)elseif fbl==euf then local fbo=fbh.closure.upvals[fbj+1]if not fbo then self:fail('bad upvalue '..fbj)end fbo.v=self:pop()elseif fbl==eug then self:push(self.globals[fbh.proto.consts[fbj+1]])elseif fbl==euh then self.globals[fbh.proto.consts[fbj+1]]=self:pop()elseif fbl==evp then self:boxOf(fbh,fbk).v=fbh.proto.consts[fbj+1]elseif fbl==eui or fbl==euj or fbl==euk or fbl==eul or fbl==eum or fbl==eun then local fbp=self:pop()local fbq=self:pop()if type(fbq)=='number'and type(fbp)=='number'then if fbl==eui then self:push(fbq+fbp)elseif fbl==euj then self:push(fbq-fbp)elseif fbl==euk then self:push(fbq*fbp)elseif fbl==eul then self:push(fbq/fbp)elseif fbl==eum then self:push(fbq-math.floor(fbq/fbp)*fbp)else self:push(fbq^fbp)end else local fbr=ewp(fbq)local fbs=ewp(fbp)if fbr==nil then self:fail('attempt to perform arithmetic on a '..ewd(fbq)..' value')end if fbs==nil then self:fail('attempt to perform arithmetic on a '..ewd(fbp)..' value')end if fbl==eui then self:push(fbr+fbs)elseif fbl==euj then self:push(fbr-fbs)elseif fbl==euk then self:push(fbr*fbs)elseif fbl==eul then self:push(fbr/fbs)elseif fbl==eum then self:push(fbr-math.floor(fbr/fbs)*fbs)else self:push(fbr^fbs)end end elseif fbl==evq or fbl==evr or fbl==evs then local fbt=self:boxOf(fbh,fbj).v local fbu=self:boxOf(fbh,fbk).v if type(fbt)=='number'and type(fbu)=='number'then if fbl==evq then self:push(fbt+fbu)elseif fbl==evr then self:push(fbt-fbu)else self:push(fbt*fbu)end else local fbv=ewp(fbt)local fbw=ewp(fbu)if fbv==nil then self:fail('attempt to perform arithmetic on a '..ewd(fbt)..' value')end if fbw==nil then self:fail('attempt to perform arithmetic on a '..ewd(fbu)..' value')end if fbl==evq then self:push(fbv+fbw)elseif fbl==evr then self:push(fbv-fbw)else self:push(fbv*fbw)end end elseif fbl==euo then local fbx=self:pop()if type(fbx)=='number'then self:push(-fbx)else local fby=ewp(fbx)if fby==nil then self:fail('attempt to perform arithmetic on a '..ewd(fbx)..' value')end self:push(-fby)end elseif fbl==eup then local fbz=self:pop()local fca=self:pop()local fcb,fcc=type(fca),type(fbz)if(fcb~='string'and fcb~='number')or(fcc~='string'and fcc~='number')then local fcd=(fcb~='string'and fcb~='number')and ewd(fca)or ewd(fbz)self:fail('attempt to concatenate a '..fcd..' value')end self:push(ewl(fca)..ewl(fbz))elseif fbl==euq then local fce=self:pop()if type(fce)=='string'then self:push(#fce)elseif exb(fce)then self:push(fce.len)elseif type(fce)=='table'then self:push(#fce)else self:fail('attempt to get length of a '..ewd(fce)..' value')end elseif fbl==eur then self:push(ewh(self:pop()))elseif fbl==eus then local fcf=self:pop()local fcg=self:pop()self:push(ewr(fcg,fcf))elseif fbl==eut or fbl==euu then local fch=self:pop()local fci=self:pop()local fcj,fck=type(fci),type(fch)if fcj=='number'and fck=='number'then self:push((fbl==eut and fci1 then local fef=ewp(fed[2])if type(fee)=='string'and fef~=nil then local feg=fee:match('^%s*(.-)%s*$')local feh=tonumber(feg,fef)return fdp(feh)end return fdp(nil)end local fei=ewp(fee)return fdp(fei)end)fdt.pairs=fdm('pairs',function(fej,fek)local fel=fek[1]local fem={n=0}local fen if exb(fel)then for feo=1,fel.len do if fel.arr[feo]~=nil then exd(fem,feo)end end for fep in pairs(fel.map)do exd(fem,ewx(fep))end fen=function(feq)local fer=nil if type(feq)=='number'then fer=fel.arr[feq]end if fer==nil then fer=fel.map[ewu(feq)]end return fer end elseif type(fel)=='table'then for fes in pairs(fel)do exd(fem,fes)end fen=function(fet)return fel[fet]end else fej:fail("bad argument #1 to 'pairs' (table expected, got "..ewd(fel)..")")end local feu={i=0}return fdp(fdm('pairsnext',function()feu.i=feu.i+1 if feu.i>fem.n then return fdr()end local fev=fem[feu.i]return{n=2,fev,fen(fev)}end))end)fdt.ipairs=fdm('ipairs',function(few,fex)local fey=fex[1]local fez if exb(fey)then fez=function(ffa)return fey.arr[ffa]end elseif type(fey)=='table'then fez=function(ffb)return fey[ffb]end else few:fail("bad argument #1 to 'ipairs' (table expected, got "..ewd(fey)..")")end local ffc={i=1}return fdp(fdm('ipairsnext',function()local ffd=fez(ffc.i)if ffd==nil then return fdr()end local ffe=ffc.i ffc.i=ffc.i+1 return{n=2,ffe,ffd}end))end)fdt.error=fdm('error',function(fff,ffg)local ffh=ffg[1]error(ffh==nil and'error'or ewl(ffh),0)end)fdt.assert=fdm('assert',function(ffi,ffj)local ffk=ffj[1]if ewh(ffk)then error(ffj.n>1 and ewl(ffj[2])or'assertion failed!',0)end return fdp(ffk)end)fdt.select=fdm('select',function(ffl,ffm)local ffn=ffm[1]local ffo=ffm.n-1 if ffn=='#'then return fdp(ffo)end local ffp=ewp(ffn)if ffp==nil or ffp~=math.floor(ffp)then ffl:fail("bad argument #1 to 'select' (number expected, got "..ewd(ffn)..")")end if ffp<1 or ffp>ffo+1 then ffl:fail("bad argument #1 to 'select' (index out of range)")end local ffq={n=0}for ffr=ffp,ffo do exd(ffq,ffm[ffr+1])end return ffq end)fdt.unpack=fdm('unpack',function(ffs,fft)local ffu=fft[1]if not exb(ffu)then ffs:fail("bad argument #1 to 'unpack' (table expected, got "..ewd(ffu)..")")end local ffv=(fft.n>1)and ewp(fft[2])or 1 local ffw=(fft.n>2)and ewp(fft[3])or ffu.len ffv=(ffv==nil)and 1 or math.floor(ffv)ffw=(ffw==nil)and ffu.len or math.floor(ffw)local ffx={n=0}for ffy=ffv,ffw do exd(ffx,ffu.arr[ffy])end return ffx end)fdt.pcall=fdm('pcall',function(ffz,fga)local fgb=ffz:protectedCall(fga[1],exh(fga,2))local fgc={n=0}exd(fgc,fgb.ok)for fgd=1,fgb.vals.n do exd(fgc,fgb.vals[fgd])end return fgc end)fdt.xpcall=fdm('xpcall',function(fge,fgf)local fgg=fgf[1]local fgh=fgf[2]local fgi=type(fgg)=='table'and fgg.kind or nil local fgj=type(fgh)=='table'and fgh.kind or nil if fgi~='closure'and fgi~='builtin'then fge:fail("bad argument #1 to 'xpcall' ("..ewd(fgg).." expected function)")end if fgj~='closure'and fgj~='builtin'then fge:fail("bad argument #2 to 'xpcall' ("..ewd(fgh).." expected function)")end local fgk=fge:protectedCall(fgg,exh(fgf,3))if fgk.ok then local fgl={n=0}exd(fgl,true)for fgm=1,fgk.vals.n do exd(fgl,fgk.vals[fgm])end return fgl end local fgn=fgk.vals[1]local fgo=#fge.frames local fgp=fge.sp local fgq,fgr=pcall(function()fge:callValue(fgh,{n=1,fgn},eua)fge:run(fgo)end)if not fgq then for fgs=#fge.frames,fgo+1,-1 do fge.frames[fgs]=nil end for fgt=fge.sp,fgp+1,-1 do fge.stack[fgt]=nil end fge.sp=fgp error(type(fgr)=='string'and fgr or tostring(fgr),0)end local fgu={n=0}for fgv=fgp+1,fge.sp do exd(fgu,fge.stack[fgv])end for fgw=fge.sp,fgp+1,-1 do fge.stack[fgw]=nil end fge.sp=fgp return{n=2,false,fgu[1]}end)do local fgx=string local fgy=table local function fgz(fha,fhb,fhc)if type(fha)~='string'then fha=tostring(fha)end fhb=tonumber(fhb)if fhb==nil then error("bad argument #2 to 'rep' (number expected)",2)end fhb=math.floor(fhb)if fhb<1 then return''end if fhc==nil or fhc==''then return fgx.rep(fha,fhb)end if type(fhc)~='string'then fhc=tostring(fhc)end local fhd={}for fhe=1,fhb do fhd[fhe]=fha end return fgy.concat(fhd,fhc)end fdt.string={byte=fgx.byte,char=fgx.char,find=fgx.find,format=fgx.format,gmatch=fgx.gmatch,gsub=fgx.gsub,len=fgx.len,lower=fgx.lower,match=fgx.match,rep=fgz,reverse=fgx.reverse,sub=fgx.sub,upper=fgx.upper,}end end exn=function(fhf,fhg,fhh)local fhi=fhf.globals fhi.getgenv=fdm('getgenv',function(fhj,fhk)return fdp(fhj.globals)end)fhi.getrenv=fdm('getrenv',function(fhl,fhm)return fdp(fhh)end)for fhn,fho in pairs(fhg)do if fhn~='getgenv'and fhn~='getrenv'and fhi[fhn]==nil and fho~=nil then fhi[fhn]=fho end end end local function fhp(...)return{n=select('#',...),...}end function exm:toHost(fhq,fhr)if type(fhq)~='table'then return fhq end local fhs=fhq.kind if fhs=='table'then fhr=fhr or{}if fhr[fhq]then return fhr[fhq]end local fht={}fhr[fhq]=fht for fhu=1,fhq.len do if fhq.arr[fhu]~=nil then fht[fhu]=self:toHost(fhq.arr[fhu],fhr)end end for fhv,fhw in pairs(fhq.map)do fht[self:toHost(ewx(fhv),fhr)]=self:toHost(fhw,fhr)end return fht elseif fhs=='closure'or fhs=='builtin'then local fhx=self local fhy=fhq return function(...)local fhz=select('#',...)local fia={n=fhz}for fib=1,fhz do fia[fib]=fhx:toVM(select(fib,...))end local fic=fhx:protectedCall(fhy,fia)if not fic.ok then error(fic.vals[1],0)end local fid=table.unpack or unpack return fid(fic.vals,1,fic.vals.n)end end return fhq end function exm:toVM(fie)return fie end function exm:callHost(fif,fig,fih)local fii={}for fij=1,fig.n do fii[fij]=self:toHost(fig[fij])end local fik=table.unpack or unpack local fil,fim=pcall(function()return fhp(fif(fik(fii,1,fig.n)))end)if not fil then self:fail(fim)end local fin=fim.n if fih==eua then for fio=1,fin do self:push(fim[fio])end else for fip=1,fih do if fip<=fin then self:push(fim[fip])else self:push(nil)end end end end local function fiq(fir,fis,fit,fiu,fiv)local fiw=exm.new(fir,fis,fit,fiu,fiv)local fix={kind='closure',proto=fir.p[1],upvals={}}fiw:pushFrame(fix,{n=0},0)local fiy,fiz=pcall(fiw.run,fiw,0)local fja=fiw.output for fjb,fjc in pairs(fiw.readers)do if fjc.slots then for fjd,fje in ipairs(fjc.slots)do for fjf=1,#fje.dec do fje.dec[fjf]=0 end fje.idx=-1 end end end if not fiy then error(fiz,0)end return fja end return{VM=exm,execute=fiq,MULTRET=eua,OP_COUNT=evt,typeOf=ewd,} end)() local _dkr_ed = (function() local gv=4294967296 local gw,gx,gy,gz,ha,hb if type(bit32)=='table'then gw=bit32.bxor gx=bit32.band gy=bit32.bor gz=bit32.bnot ha=bit32.rshift hb=bit32.lshift else local function hc(hd)return function(he,hf)local hg,hh=0,1 for hj=1,32 do local hk,hl=he%2,hf%2 if hd(hk,hl)then hg=hg+hh end he=(he-hk)/2 hf=(hf-hl)/2 hh=hh*2 end return hg end end gw=hc(function(hm,hn)return hm~=hn end)gx=hc(function(ho,hp)return ho==1 and hp==1 end)gy=hc(function(hq,hr)return hq==1 or hr==1 end)gz=function(ht)return 4294967295-ht end ha=function(hu,hv)return math.floor(hu/(2^hv))end hb=function(hw,hx)if hx==0 then return hw end return(hw%(2^(32-hx)))*(2^hx)end end local function hy(hz,ia)return{h=hz%gv,l=ia%gv}end local function ib(ic,id)local ie=ic.l+id.l local ig=0 if ie>=gv then ie=ie-gv;ig=1 end local ih=ic.h+id.h+ig if ih>=gv then ih=ih-gv end return{h=ih,l=ie}end local function ii(ij,ik)return{h=gw(ij.h,ik.h),l=gw(ij.l,ik.l)}end local function il(im,io)return{h=gx(im.h,io.h),l=gx(im.l,io.l)}end local function ip(iq)return{h=gz(iq.h),l=gz(iq.l)}end local function ir(is,it)it=it%64 if it==0 then return{h=is.h,l=is.l}end if it==32 then return{h=is.l,l=is.h}end if it<32 then return{h=gy(ha(is.h,it),hb(is.l,32-it)),l=gy(ha(is.l,it),hb(is.h,32-it)),}end local iu=it-32 return{h=gy(ha(is.l,iu),hb(is.h,32-iu)),l=gy(ha(is.h,iu),hb(is.l,32-iu)),}end local function iv(iw,ix)return{h=ha(iw.h,ix),l=gy(ha(iw.l,ix),hb(iw.h,32-ix)),}end local function iy(iz,ja,jb)return ii(il(iz,ja),il(ip(iz),jb))end local function jc(jd,je,jf)return ii(ii(il(jd,je),il(jd,jf)),il(je,jf))end local function jg(jh)return ii(ii(ir(jh,28),ir(jh,34)),ir(jh,39))end local function ji(jj)return ii(ii(ir(jj,14),ir(jj,18)),ir(jj,41))end local function jk(jl)return ii(ii(ir(jl,1),ir(jl,8)),iv(jl,7))end local function jm(jn)return ii(ii(ir(jn,19),ir(jn,61)),iv(jn,6))end local jo={'428a2f98d728ae22','7137449123ef65cd','b5c0fbcfec4d3b2f','e9b5dba58189dbbc','3956c25bf348b538','59f111f1b605d019','923f82a4af194f9b','ab1c5ed5da6d8118','d807aa98a3030242','12835b0145706fbe','243185be4ee4b28c','550c7dc3d5ffb4e2','72be5d74f27b896f','80deb1fe3b1696b1','9bdc06a725c71235','c19bf174cf692694','e49b69c19ef14ad2','efbe4786384f25e3','0fc19dc68b8cd5b5','240ca1cc77ac9c65','2de92c6f592b0275','4a7484aa6ea6e483','5cb0a9dcbd41fbd4','76f988da831153b5','983e5152ee66dfab','a831c66d2db43210','b00327c898fb213f','bf597fc7beef0ee4','c6e00bf33da88fc2','d5a79147930aa725','06ca6351e003826f','142929670a0e6e70','27b70a8546d22ffc','2e1b21385c26c926','4d2c6dfc5ac42aed','53380d139d95b3df','650a73548baf63de','766a0abb3c77b2a8','81c2c92e47edaee6','92722c851482353b','a2bfe8a14cf10364','a81a664bbc423001','c24b8b70d0f89791','c76c51a30654be30','d192e819d6ef5218','d69906245565a910','f40e35855771202a','106aa07032bbd1b8','19a4c116b8d2d0c8','1e376c085141ab53','2748774cdf8eeb99','34b0bcb5e19b48a8','391c0cb3c5c95a63','4ed8aa4ae3418acb','5b9cca4f7763e373','682e6ff3d6b2b8a3','748f82ee5defb2fc','78a5636f43172f60','84c87814a1f0ab72','8cc702081a6439ec','90befffa23631e28','a4506cebde82bde9','bef9a3f7b2c67915','c67178f2e372532b','ca273eceea26619c','d186b8c721c0c207','eada7dd6cde0eb1e','f57d4f7fee6ed178','06f067aa72176fba','0a637dc5a2c898a6','113f9804bef90dae','1b710b35131c471b','28db77f523047d84','32caab7b40c72493','3c9ebe0a15c9bebc','431d67c49c100d4c','4cc5d4becb3e42b6','597f299cfc657e2a','5fcb6fab3ad6faec','6c44198c4a475817',}local jp={}for jq=1,80 do local jr=jo[jq]jp[jq]=hy(tonumber(jr:sub(1,8),16),tonumber(jr:sub(9,16),16))end local js={'6a09e667f3bcc908','bb67ae8584caa73b','3c6ef372fe94f82b','a54ff53a5f1d36f1','510e527fade682d1','9b05688c2b3e6c1f','1f83d9abfb41bd6b','5be0cd19137e2179',}local function jt(ju)local jv=#ju local jw=(jv*8)%gv local jx=math.floor(jv/536870912)local jy=128-((jv+1+16)%128)if jy==128 then jy=0 end local jz=jv+1+jy+16 local ka={}for kb=1,jv do ka[kb]=ju:byte(kb)end ka[jv+1]=128 for kc=jv+2,jv+1+jy do ka[kc]=0 end for kd=1,8 do ka[jv+1+jy+kd]=0 end ka[jz-7]=math.floor(jx/16777216)%256 ka[jz-6]=math.floor(jx/65536)%256 ka[jz-5]=math.floor(jx/256)%256 ka[jz-4]=jx%256 ka[jz-3]=math.floor(jw/16777216)%256 ka[jz-2]=math.floor(jw/65536)%256 ka[jz-1]=math.floor(jw/256)%256 ka[jz]=jw%256 local ke={}for kf=1,8 do local kg=js[kf]ke[kf]=hy(tonumber(kg:sub(1,8),16),tonumber(kg:sub(9,16),16))end local kh={}for ki=0,jz/128-1 do local kj=ki*128 for kk=1,16 do local kl=kj+(kk-1)*8 local km=ka[kl+1]*16777216+ka[kl+2]*65536+ka[kl+3]*256+ka[kl+4]local kn=ka[kl+5]*16777216+ka[kl+6]*65536+ka[kl+7]*256+ka[kl+8]kh[kk]=hy(km,kn)end for ko=17,80 do kh[ko]=ib(ib(jm(kh[ko-2]),kh[ko-7]),ib(jk(kh[ko-15]),kh[ko-16]))end local kp,kq,kr,ks,kt,ku,kv,kw=ke[1],ke[2],ke[3],ke[4],ke[5],ke[6],ke[7],ke[8]for kx=1,80 do local ky=ib(ib(ib(ib(kw,ji(kt)),iy(kt,ku,kv)),jp[kx]),kh[kx])local kz=ib(jg(kp),jc(kp,kq,kr))kw=kv;kv=ku;ku=kt;kt=ib(ks,ky)ks=kr;kr=kq;kq=kp;kp=ib(ky,kz)end ke[1]=ib(ke[1],kp)ke[2]=ib(ke[2],kq)ke[3]=ib(ke[3],kr)ke[4]=ib(ke[4],ks)ke[5]=ib(ke[5],kt)ke[6]=ib(ke[6],ku)ke[7]=ib(ke[7],kv)ke[8]=ib(ke[8],kw)end local la={}for lb=1,8 do local lc=ke[lb]la[#la+1]=string.char(math.floor(lc.h/16777216)%256,math.floor(lc.h/65536)%256,math.floor(lc.h/256)%256,lc.h%256,math.floor(lc.l/16777216)%256,math.floor(lc.l/65536)%256,math.floor(lc.l/256)%256,lc.l%256)end return table.concat(la)end local function ld()return{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}end local function le(lf)local lg=ld()for lh=1,16 do lg[lh]=lf[lh]end return lg end local li={65517,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,65535,32767}local function lj(lk)for ll=1,4 do for lm=1,16 do local ln=lk[lm]if ln>=65536 or ln<0 then local lp=math.floor(ln/65536)lk[lm]=ln-lp*65536 if lm==16 then lk[1]=lk[1]+lp*38 else lk[lm+1]=lk[lm+1]+lp end end end end local lq=math.floor(lk[16]/32768)lk[16]=lk[16]-lq*32768 lk[1]=lk[1]+lq*19 for lr=1,3 do local ls=lk[lr]if ls>=65536 then local lt=math.floor(ls/65536)lk[lr]=ls-lt*65536 lk[lr+1]=lk[lr+1]+lt end end local lu={}for lv=1,4 do local lw=0 for lx=1,16 do local ly=lk[lx]-li[lx]-lw if ly<0 then ly=ly+65536;lw=1 else lw=0 end lu[lx]=ly end if lw==0 then for lz=1,16 do lk[lz]=lu[lz]end else break end end return lk end local function ma(mb,mc)local md=ld()for me=1,16 do md[me]=mb[me]+mc[me]end return lj(md)end local function mf(mg,mh)local mi=ld()for mj=1,16 do mi[mj]=mg[mj]-mh[mj]end return lj(mi)end local function mk(ml,mm)local mn={}for mo=1,32 do mn[mo]=0 end for mp=1,16 do local mq=ml[mp]if mq~=0 then for mr=1,16 do mn[mp+mr-1]=mn[mp+mr-1]+mq*mm[mr]end end end for ms=32,17,-1 do local mt=mn[ms]if mt~=0 then mn[ms-16]=mn[ms-16]+mt*38 mn[ms]=0 end end local mu=ld()for mv=1,16 do mu[mv]=mn[mv]end return lj(mu)end local function mw(mx)return mk(mx,mx)end local function my(mz)local na=le(mz)lj(na)for nb=1,16 do if na[nb]~=0 then return false end end return true end local function nc(nd,ne)local nf=le(nd)local ng=le(ne)lj(nf)lj(ng)for nh=1,16 do if nf[nh]~=ng[nh]then return false end end return true end local function ni(nj,nk)local nl=ld()nl[1]=1 for nm=1,#nk do nl=mw(nl)if nk[nm]==1 then nl=mk(nl,nj)end end return nl end local nn={}for no=254,0,-1 do if no>=5 then nn[#nn+1]=1 elseif no==3 or no==1 or no==0 then nn[#nn+1]=1 else nn[#nn+1]=0 end end local np={}for nq=251,0,-1 do np[#np+1]=(nq==0)and 0 or 1 end local nr={}for ns=252,0,-1 do if ns>=3 then nr[#nr+1]=1 elseif ns==3 or ns==1 or ns==0 then nr[#nr+1]=1 else nr[#nr+1]=0 end end local function nt(nu)return ni(nu,nn)end local function nv(nw)if#nw~=32 then return nil end local nx={nw:byte(1,32)}if nx[32]>=128 then return nil end if nx[32]==127 then local ny=true for nz=2,31 do if nx[nz]~=255 then ny=false;break end end if ny and nx[1]>=236 then return nil end end local oa=ld()for ob=1,16 do oa[ob]=nx[2*ob-1]+nx[2*ob]*256 end return oa end local function oc(od)local oe=le(od)lj(oe)local of={}for og=1,16 do of[#of+1]=string.char(oe[og]%256,math.floor(oe[og]/256)%256)end return table.concat(of)end local function oh(oi)local oj=ld()oj[1]=oi%65536 oj[2]=math.floor(oi/65536)%65536 return oj end local ok=mf(ld(),mk(oh(121665),nt(oh(121666))))local ol=ma(ok,ok)local om=ni(oh(2),nr)local function on(oo,oq,os,ot)return{X=oo,Y=oq,Z=os,T=ot}end local function ou()local ov=ld()local ow=ld()ow[1]=1 return on(ov,le(ow),le(ow),ld())end local function ox(oy,oz)local pa=mk(mf(oy.Y,oy.X),mf(oz.Y,oz.X))local pb=mk(ma(oy.Y,oy.X),ma(oz.Y,oz.X))local pc=mk(mk(oy.T,ol),oz.T)local pd=ma(mk(oy.Z,oz.Z),mk(oy.Z,oz.Z))local pe=mf(pb,pa)local pf=mf(pd,pc)local pg=ma(pd,pc)local ph=ma(pb,pa)return on(mk(pe,pf),mk(pg,ph),mk(pf,pg),mk(pe,ph))end local function pi(pj,pk)return nc(mk(pj.X,pk.Z),mk(pk.X,pj.Z))and nc(mk(pj.Y,pk.Z),mk(pk.Y,pj.Z))end local function pl(pm,pn)local po=ou()for pp=32,1,-1 do local pq=pm:byte(pp)for pr=7,0,-1 do po=ox(po,po)if math.floor(pq/(2^pr))%2==1 then po=ox(po,pn)end end end return po end local function ps(pt)local pu=nt(pt.Z)local pv=mk(pt.X,pu)local pw=mk(pt.Y,pu)local px=oc(pw)local py=oc(pv)local pz=py:byte(1)%2 local qa=px:byte(32)px=px:sub(1,31)..string.char(qa+(pz==1 and 128 or 0))return px end local function qb()local qc=ld()for qd=1,15 do qc[qd]=65535 end qc[1]=65517 qc[16]=32767 return qc end local function qe(qf)if#qf~=32 then return nil end local qg=(qf:byte(32)>=128)and 1 or 0 local qh=qf:sub(1,31)..string.char(qf:byte(32)%128)local qi=nv(qh)if not qi then return nil end local qj=mw(qi)local qk=mk(mf(qj,oh(1)),nt(ma(mk(ok,qj),oh(1))))local ql if my(qk)then if qg==1 then return nil end ql=ld()else ql=ni(qk,np)if not nc(mw(ql),qk)then ql=mk(ql,om)if not nc(mw(ql),qk)then return nil end end local qm=oc(ql)if(qm:byte(1)%2)~=qg then ql=mf(qb(),ql)end end return on(ql,qi,oh(1),mk(ql,qi))end local qn='5866666666666666666666666666666666666666666666666666666666666666'local function qo(qp)local qq={}for qr=1,#qp,2 do qq[#qq+1]=string.char(tonumber(qp:sub(qr,qr+1),16))end return table.concat(qq)end local function qs(qt)local qu={}for qv=1,#qt do qu[#qu+1]=string.format('%02x',qt:byte(qv))end return table.concat(qu)end local qw=qe(qo(qn))if not qw then error('bad base point',0)end local qx='edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010'local qy=qo(qx)local function qz(ra,rb)for rc=#ra,1,-1 do local rd,re=ra:byte(rc),rb:byte(rc)if rd~=re then return rd>re end end return true end local function rf(rg)local rh={}for ri=1,16 do rh[ri]=qy:byte(2*ri-1)+qy:byte(2*ri)*256 end local rj=ld()for rk=64,1,-1 do local rl=rg:byte(rk)for rm=7,0,-1 do local rn=math.floor(rl/(2^rm))%2 for ro=1,16 do local rp=rj[ro]*2+rn rj[ro]=rp%65536 rn=math.floor(rp/65536)end local rq=true for rr=16,1,-1 do if rj[rr]~=rh[rr]then rq=rj[rr]>rh[rr];break end end if rq then local rs=0 for rt=1,16 do local ru=rj[rt]-rh[rt]-rs if ru<0 then ru=ru+65536;rs=1 else rs=0 end rj[rt]=ru end end end end return rj end local function rv(rw)return oc(rw)end local function rx(ry,rz,sa)if#sa~=64 or#ry~=32 then return false end local sb=sa:sub(1,32)local sd=sa:sub(33,64)if qz(sd,qy)then return false end local se=qe(sb)if not se then return false end local sf=qe(ry)if not sf then return false end local sg=jt(sb..ry..rz)local sh=rf(sg)local si=pl(sd,qw)local sj=pl(rv(sh),sf)return pi(si,ox(se,sj))end return{sha512=jt,verify=rx,hex_to_bytes=qo,bytes_to_hex=qs,} end)() local function _dkr_json(esb)local esc=1 local function esd()while esc<=#esb and esb:sub(esc,esc):match("%s")do esc=esc+1 end end local ese local function esf()esc=esc+1 local esg={}while true do local esh=esb:sub(esc,esc)if esh=='"'then esc=esc+1 break end if esh=="\\"then local esi=esb:sub(esc+1,esc+1)if esi=="n"then esg[#esg+1]="\n"elseif esi=="t"then esg[#esg+1]="\t"elseif esi=="r"then esg[#esg+1]="\r"elseif esi=='"'then esg[#esg+1]='"'elseif esi=="\\"then esg[#esg+1]="\\"elseif esi=="u"then local esj=tonumber(esb:sub(esc+2,esc+5),16)or 63 if esj<128 then esg[#esg+1]=string.char(esj)else esg[#esg+1]="?"end esc=esc+4 end esc=esc+2 else esg[#esg+1]=esh esc=esc+1 end end return table.concat(esg)end local function esk()local esl=esb:match("^-?%d+%.?%d*[eE]?[+-]?%d*",esc)esc=esc+#esl return tonumber(esl)end local function esm()esc=esc+1 local esn={}local eso=0 esd()if esb:sub(esc,esc)=="]"then esc=esc+1 return esn end while true do eso=eso+1 esn[eso]=ese()esd()local esp=esb:sub(esc,esc)if esp=="]"then esc=esc+1 break end esc=esc+1 end return esn end local function esq()esc=esc+1 local esr={}esd()if esb:sub(esc,esc)=="}"then esc=esc+1 return esr end while true do esd()local ess=esf()esd()esc=esc+1 esr[ess]=ese()esd()local est=esb:sub(esc,esc)if est=="}"then esc=esc+1 break end esc=esc+1 end return esr end ese=function()esd()local esu=esb:sub(esc,esc)if esu=='"'then return esf()end if esu=="{"then return esq()end if esu=="["then return esm()end if esb:sub(esc,esc+3)=="true"then esc=esc+4 return true end if esb:sub(esc,esc+4)=="false"then esc=esc+5 return false end if esb:sub(esc,esc+3)=="null"then esc=esc+4 return nil end return esk()end local esv=ese()return esv end local function _dkr_bxor(a, b) local r, bit = 0, 1 for _ = 1, 8 do local abit, bbit = a % 2, b % 2 if abit ~= bbit then r = r + bit end a = (a - abit) / 2 b = (b - bbit) / 2 bit = bit * 2 end return r end local _dkr_M32 = 4294967296 local function _dkr_mul32(a, b) a = a % _dkr_M32 b = b % _dkr_M32 local a0 = a % 65536 local a1 = (a - a0) / 65536 local b0 = b % 65536 local b1 = (b - b0) / 65536 local p0 = a0 * b0 local p1 = a1 * b0 + a0 * b1 return (p0 + (p1 % 65536) * 65536) % _dkr_M32 end local function _dkr_xor32(a, b) a = a % _dkr_M32 b = b % _dkr_M32 local r, bit = 0, 1 for _ = 1, 32 do local abit = a % 2 local bbit = b % 2 if abit ~= bbit then r = r + bit end a = (a - abit) / 2 b = (b - bbit) / 2 bit = bit * 2 end return r end local function _dkr_fnv(bytes, n) local h = 2166136261 for i = 1, n do h = _dkr_xor32(h, bytes[i]) h = _dkr_mul32(h, 16777619) end return h end local function _dkr_rng(seed) local s = seed % _dkr_M32 if s == 0 then s = 2654435769 end return function() s = _dkr_xor32(s, _dkr_mul32(s, 8192)) s = _dkr_xor32(s, math.floor(s / 131072)) s = _dkr_xor32(s, _dkr_mul32(s, 32)) return s end end local _dkr_b64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" local _dkr_b64map = {} for i = 1, #_dkr_b64chars do _dkr_b64map[_dkr_b64chars:sub(i, i)] = i - 1 end local function _dkr_b64d(s) local out = {} local n = 0 local i = 1 while i <= #s do local c1 = _dkr_b64map[s:sub(i, i)] or 0 local c2 = _dkr_b64map[s:sub(i + 1, i + 1)] or 0 local c3 = _dkr_b64map[s:sub(i + 2, i + 2)] or 0 local c4 = _dkr_b64map[s:sub(i + 3, i + 3)] or 0 local w = c1 * 262144 + c2 * 4096 + c3 * 64 + c4 n = n + 1 out[n] = math.floor(w / 65536) % 256 if s:sub(i + 2, i + 2) ~= "=" then n = n + 1 out[n] = math.floor(w / 256) % 256 end if s:sub(i + 3, i + 3) ~= "=" then n = n + 1 out[n] = w % 256 end i = i + 4 end return out, n end local function _dkr_ckey(keystr) local pre = {} local n = 0 for i = 1, #keystr do n = n + 1 pre[n] = string.byte(keystr, i) end local label = "dkr-const-v1" for i = 1, #label do n = n + 1 pre[n] = string.byte(label, i) end local rng = _dkr_rng(_dkr_fnv(pre, n)) local ck = {} for i = 1, 32 do ck[i] = rng() % 256 end for i = 1, n do pre[i] = 0 end return ck end -- Code-key derivation for incremental instruction decoding. Mirrors -- src/codecrypt.ts deriveCodeKey exactly: FNV-1a(master || "dkr-code-v1") -- seeding xorshift32, low byte per word. Validated standalone under lua5.1 -- alongside _dkr_ckey; any change must re-pass that check. local function _dkr_codekey(keystr) local pre = {} local n = 0 for i = 1, #keystr do n = n + 1 pre[n] = string.byte(keystr, i) end local label = "dkr-code-v1" for i = 1, #label do n = n + 1 pre[n] = string.byte(label, i) end local rng = _dkr_rng(_dkr_fnv(pre, n)) local ck = {} for i = 1, 32 do ck[i] = rng() % 256 end for i = 1, n do pre[i] = 0 end return ck end -- Stone 7: outer-key derivation executed at stub runtime. Deliberately NOT -- the low-byte-only pattern of _dkr_ckey/_dkr_codekey: each key byte is -- lowByte(xorshift()) XOR highByte(next xorshift()), so an attacker reusing -- their existing inner-KDF reimplementation derives the wrong key here. -- Bit-identical mirror of deriveOuterKey in src/constcrypt.ts. local function _dkr_outerkey(seedstr) local pre = {} local n = 0 for i = 1, #seedstr do n = n + 1 pre[n] = string.byte(seedstr, i) end local label = "dkr-outer-v1" for i = 1, #label do n = n + 1 pre[n] = string.byte(label, i) end local rng = _dkr_rng(_dkr_fnv(pre, n)) local ok = {} for i = 1, 32 do local a = rng() local b = rng() ok[i] = _dkr_xor32(a % 256, math.floor(b / 16777216) % 256) end for i = 1, n do pre[i] = 0 end return ok end local function _dkr_stream(ck, pi0, ci0, n) local pre = {} local m = 0 for i = 1, 32 do m = m + 1 pre[m] = ck[i] end local v = pi0 for _ = 1, 4 do m = m + 1 pre[m] = v % 256 v = math.floor(v / 256) end v = ci0 for _ = 1, 4 do m = m + 1 pre[m] = v % 256 v = math.floor(v / 256) end local rng = _dkr_rng(_dkr_fnv(pre, m)) local ks = {} for i = 1, n do ks[i] = rng() % 256 end for i = 1, m do pre[i] = 0 end return ks end local function _dkr_constdec(chunk, ck) for pi = 1, #chunk.p do local cs = chunk.p[pi].consts for ci = 1, #cs do local c = cs[ci] if type(c) == "table" and type(c.e) == "string" then local eb, en = _dkr_b64d(c.e) if en > 0 then local ks = _dkr_stream(ck, pi - 1, ci - 1, en) local db = {} for i = 1, en do db[i] = _dkr_schar(_dkr_bxor(eb[i], ks[i])) end cs[ci] = table.concat(db) for i = 1, en do eb[i] = 0 ks[i] = 0 db[i] = 0 end else cs[ci] = "" end end end end end -- Dakarun ChaCha20 (RFC 8439) — pure Lua 5.1, NO bitwise operators. -- -- All arithmetic uses doubles as exact integers (< 2^53): -- add mod 2^32 : (a + b) % 2^32 (a,b < 2^32, sum < 2^33 — exact) -- xor32 : byte-wise via a 65536-entry lookup table built once -- rotl : (a * 2^n) % 2^32 + floor(a / 2^(32-n)) (a*2^n < 2^48 — exact) -- -- Exposes: -- _dkr_chacha_block(key, nonce, ctr) -> 64-byte keystream table -- key: 32-byte table (1-based), nonce: 12-byte table (1-based) -- _dkr_chacha_xor(key, nonce, ct, n, ctr0) -> n-byte plaintext table -- (symmetric: the same function encrypts) -- -- This file is embedded into the stub via scripts/embed-lua.mjs and is also -- loaded directly by lua_test/chacha_test.lua — keep it self-contained. local _dkr_M32 = 4294967296 -- Byte-xor lookup table: _dkr_x8[a*256+b] = xor(a,b) for bytes a,b. -- Built with the recurrence T[a][b] = T[a>>1][b>>1]*2 + ((a&1)~(b&1)); -- the index floor(a/2)*256+floor(b/2) is always smaller, so entries exist. local _dkr_x8 = { [0] = 0 } for _dkr_a = 0, 255 do for _dkr_b = 0, 255 do if not (_dkr_a == 0 and _dkr_b == 0) then local _dkr_ah = math.floor(_dkr_a / 2) local _dkr_bh = math.floor(_dkr_b / 2) local _dkr_lo = 0 if (_dkr_a % 2) ~= (_dkr_b % 2) then _dkr_lo = 1 end _dkr_x8[_dkr_a * 256 + _dkr_b] = _dkr_x8[_dkr_ah * 256 + _dkr_bh] * 2 + _dkr_lo end end end local function _dkr_xor32(a, b) local a0 = a % 256 local a1 = math.floor(a / 256) % 256 local a2 = math.floor(a / 65536) % 256 local a3 = math.floor(a / 16777216) local b0 = b % 256 local b1 = math.floor(b / 256) % 256 local b2 = math.floor(b / 65536) % 256 local b3 = math.floor(b / 16777216) return _dkr_x8[a0 * 256 + b0] + _dkr_x8[a1 * 256 + b1] * 256 + _dkr_x8[a2 * 256 + b2] * 65536 + _dkr_x8[a3 * 256 + b3] * 16777216 end local function _dkr_add32(a, b) return (a + b) % _dkr_M32 end -- One ChaCha20 quarter round on state table s (1-based indices). local function _dkr_qr(s, a, b, c, d) s[a] = _dkr_add32(s[a], s[b]) s[d] = _dkr_xor32(s[d], s[a]) s[d] = (s[d] * 65536) % _dkr_M32 + math.floor(s[d] / 65536) -- rotl 16 s[c] = _dkr_add32(s[c], s[d]) s[b] = _dkr_xor32(s[b], s[c]) s[b] = (s[b] * 4096) % _dkr_M32 + math.floor(s[b] / 1048576) -- rotl 12 s[a] = _dkr_add32(s[a], s[b]) s[d] = _dkr_xor32(s[d], s[a]) s[d] = (s[d] * 256) % _dkr_M32 + math.floor(s[d] / 16777216) -- rotl 8 s[c] = _dkr_add32(s[c], s[d]) s[b] = _dkr_xor32(s[b], s[c]) s[b] = (s[b] * 128) % _dkr_M32 + math.floor(s[b] / 33554432) -- rotl 7 end local function _dkr_le32(t, i) return t[i] + t[i + 1] * 256 + t[i + 2] * 65536 + t[i + 3] * 16777216 end -- RFC 8439 §2.3.2 block function. Returns a 64-entry byte table. -- Local (never global): the sealed stub keeps these as chunk-locals and hands -- _dkr_chacha_xor to the VM as a parameter. No _dkr_* decryptor global exists -- at runtime, so there is nothing for a hostile environment to hook or proxy. local function _dkr_chacha_block(key, nonce, ctr) local s = { 1634760805, 857760878, 2036477234, 1797285236, -- "expand 32-byte k" _dkr_le32(key, 1), _dkr_le32(key, 5), _dkr_le32(key, 9), _dkr_le32(key, 13), _dkr_le32(key, 17), _dkr_le32(key, 21), _dkr_le32(key, 25), _dkr_le32(key, 29), ctr % _dkr_M32, _dkr_le32(nonce, 1), _dkr_le32(nonce, 5), _dkr_le32(nonce, 9), } local x = {} for i = 1, 16 do x[i] = s[i] end for _ = 1, 10 do _dkr_qr(x, 1, 5, 9, 13) _dkr_qr(x, 2, 6, 10, 14) _dkr_qr(x, 3, 7, 11, 15) _dkr_qr(x, 4, 8, 12, 16) _dkr_qr(x, 1, 6, 11, 16) _dkr_qr(x, 2, 7, 12, 13) _dkr_qr(x, 3, 8, 9, 14) _dkr_qr(x, 4, 5, 10, 15) end local ks = {} local n = 0 for i = 1, 16 do local w = _dkr_add32(x[i], s[i]) n = n + 1 ks[n] = w % 256 n = n + 1 ks[n] = math.floor(w / 256) % 256 n = n + 1 ks[n] = math.floor(w / 65536) % 256 n = n + 1 ks[n] = math.floor(w / 16777216) x[i] = 0 end return ks end -- XOR data (byte table ct[1..n]) with the ChaCha20 keystream. -- Symmetric: decrypt(encrypt(x)) == x. local function _dkr_chacha_xor(key, nonce, ct, n, ctr0) local out = {} local pos = 1 local ctr = ctr0 % _dkr_M32 while pos <= n do local ks = _dkr_chacha_block(key, nonce, ctr) ctr = (ctr + 1) % _dkr_M32 for i = 1, 64 do if pos > n then break end out[pos] = _dkr_x8[ct[pos] * 256 + ks[i]] pos = pos + 1 end for i = 1, 64 do ks[i] = 0 end end return out end local _dkr_gi2 = debug and debug.getinfo if _dkr_gi2 then local _dkr_si = _dkr_gi2(1, "S") local _dkr_ssrc = _dkr_si and _dkr_si.source or "" if #_dkr_ssrc > 10000 and _dkr_ssrc:find("_dkr_selfck", 1, true) then _dkr_ssrc = _dkr_ssrc:gsub("^%s+", ""):gsub("%s+$", "") local _dkr_hsrc = _dkr_ssrc:gsub('_dkr_selfck = "' .. _dkr_selfck .. '"', '_dkr_selfck = "0000000000"', 1) local _dkr_hh = 2166136261 for _dkr_hi = 1, #_dkr_hsrc do _dkr_hh = _dkr_mul32(_dkr_xor32(_dkr_hh, _dkr_hsrc:byte(_dkr_hi)), 16777619) end if _dkr_hh ~= tonumber(_dkr_selfck) then error("Dakarun: loader integrity") end end end _dkr_gi2 = nil local _dkr_p = "\100\175\057\123\225\004\087\066\012\255\121\107\024\229\000\000\037\209\156\192\101\071\055\068\254\120\022\201\245\165\188\033\091\079\092\248\121\074\239\021\253\037\228\038\254\205\042\073\036\247\030\063\067\109\177\225\014\186\234\201\096\038\239\069\245\054\060\174\122\062\202\200\117\169\082\121\131\225\223\200\097\220\180\119\179\240\207\157\046\003\165\017\205\110\056\204\059\199\029\178\086\188\033\032\108\225\116\036\180\117\114\192\172\056\077\026\089\157\013\052\193\085\110\094\056\199\020\069\178\108\225\015\028\071\162\174\199\043\118\124\114\141\186\117\241\233\174\055\161\171\068\167\022\134\141\059\202\031\175\066\205\225\204\100\038\145\210\248\193\008\255\239\244\066\134\168\144\021\199\164\173\091\086\046\235\026\224\137\080\191\242\056\190\096\074\143\213\062\002\043\088\188\110\159\083\051\232\071\190\147\059\031\244\182\032\203\006\224\120\254\076\176\127\171\045\006\026\108\133\109\088\216\108\191\167\100\006\168\238\137\114\198\253\076\070\088\093\165\042\175\141\178\243\115\086\203\096\106\255\002\213\145\197\207\239\126\121\046\139\249\216\234\254\083\149\217\060\255\063\174\207\145\014\067\116\210\016\018\211\095\127\249\081\032\110\120\025\230\106\026\207\219\023\040\134\081\046\159\012\026\225\180\160\073\152\194\197\155\169\009\161\241\061\103\208\058\172\185\253\125\039\015\192\044\160\062\121\118\131\217\096\139\135\163\141\034\239\246\128\111\240\054\221\040\254\137\071\122\217\132\239\224\051\120\061\147\037\016\151\058\028\243\204\023\000\145\042\142\194\050\197\107\195\089\097\206\080\068\095\024\252\072\017\133\155\218\074\085\144\052\043\003\082\241\098\237\044\193\238\162\227\132\126\093\080\183\202\228\195\026\173\124\027\185\138\069\043\127\187\049\214\175\066\150\189\133\164\173\000\218\044\237\030\039\041\131\255\222\108\185\212\134\035\177\046\082\158\105\052\013\220\251\001\140\063\054\073\089\112\013\045\185\190\114\144\083\238\193\177\010\207\052\116\053\138\075\250\126\128\140\165\182\026\014\149\072\182\064\169\130\119\085\072\075\030\065\132\170\224\225\127\250\228\172\195\183\103\145\146\039\065\246\180\169\172\213\075\233\217\231\157\123\208\055\214\185\100\036\218\130\178\173\184\053\123\244\158\011\022\251\172\212\111\131\048\239\187\126\103\204\166\032\247\114\185\192\216\017\006\134\228\205\079\053\224\027\227\091\192\186\115\131\012\216\189\064\185\087\047\131\207\245\149\251\044\171\025\056\124\092\239\191\011\143\123\117\129\085\150\022\068\233\180\156\113\007\025\114\093\102\227\087\030\233\180\136\032\215\117\178\107\160\003\241\173\006\070\035\206\072\199\030\028\249\015\054\087\227\169\063\095\211\142\059\103\000\123\212\189\233\145\163\094\069\201\245\187\158\219\050\131\255\068\193\027\097\158\007\055\105\181\090\148\191\204\110\084\203\004\015\114\083\053\025\047\124\043\193\012\018\075\158\060\214\065\140\029\204\053\046\113\209\196\175\175\055\221\003\179\080\148\250\066\200\004\065\058\240\083\073\047\085\078\040\090\243\132\161\069\197\129\244\082\175\071\083\137\241\168\049\082\068\017\080\250\180\214\071\098\037\117\058\114\063\039\023\155\084\069\210\214\097\065\033\120\159\128\036\082\119\110\041\253\157\154\035\053\014\067\026\229\208\057\001\101\115\127\160\076\185\232\114\162\195\254\065\014\075\045\052\202\054\190\158\135\017\014\104\121\062\041\069\208\237\013\160\252\178\202\247\197\044\180\079\241\033\065\019\000\041\007\002\242\160\171\176\073\004\069\099\244\217\146\178\166\105\236\003\102\152\027\187\146\210\112\038\014\019\222\106\099\215\076\146\150\148\041\147\164\200\054\103\228\195\035\232\128\235\008\169\114\231\139\219\015\151\062\169\134\202\228\002\026\046\241\186\223\113\116\242\252\056\242\153\092\236\062\215\058\015\023\028\137\219\025\218\119\153\205\111\042\098\117\180\047\022\000\120\039\020\206\060\060\197\122\165\183\185\182\079\192\076\188\254\179\197\251\213\174\115\056\068\139\011\252\088\229\091\143\163\176\221\019\032\162\175\073\056\014\227\229\240\194\061\007\080\182\059\178\124\148\085\074\081\050\086\034\172\138\144\163\097\187\226\080\131\105\189\132\240\002\061\002\143\173\242\211\031\240\009\150\114\023\215\095\023\138\051\227\047\248\090\007\246\096\017\056\027\024\034\226\176\227\066\049\065\159\100\237\105\214\063\088\099\010\216\082\010\176\023\122\112\130\254\244\162\253\168\141\233\037\167\241\229\032\081\154\223\196\098\072\093\092\115\070\144\095\151\206\091\208\037\087\092\217\240\062\105\134\044\244\250\244\149\252\044\037\144\142\054\067\204\003\046\109\153\154\238\045\154\214\095\129\084\062\079\034\013\249\222\158\084\126\210\072\063\255\090\135\084\096\001\223\129\236\019\062\228\247\219\122\219\241\152\185\199\050\225\248\044\067\237\225\127\111\053\037\096\004\184\016\206\233\132\206\226\140\132\239\038\026\015\071\175\224\130\134\005\079\170\178\237\030\085\094\012\016\033\102\012\186\159\086\228\010\167\042\221\134\097\126\025\099\153\182\253\060\039\142\175\246\236\174\176\234\173\116\043\060\246\047\003\161\056\124\073\029\090\101\206\092\176\083\240\140\014\172\050\037\103\009\137\031\248\226\075\173\157\199\099\109\092\042\145\155\177\142\126\216\015\064\238\067\206\253\181\145\060\120\138\063\040\156\240\093\129\151\089\188\090\194\191\066\130\059\172\237\119\234\137\207\019\079\004\213\023\243\066\124\171\178\255\088\037\125\234\081\013\034\255\228\219\052\246\027\195\225\174\050\233\165\112\125\041\224\191\036\098\126\197\145\097\189\237\230\206\025\203\080\115\044\042\121\242\056\245\225\136\057\227\083\174\184\016\031\003\194\191\191\008\131\215\016\001\217\028\248\054\016\223\072\158\108\231\121\117\074\068\009\146\221\179\149\187\148\047\222\234\100\242\196\255\143\220\079\252\234\092\215\185\176\111\152\083\028\215\202\090\019\082\036\185\072\009\225\155\252\127\030\193\166\134\214\249\143\045\097\235\147\228\113\156\010\195\201\030\242\142\095\056\159\079\217\221\022\048\205\042\195\178\107\117\015\161\116\228\238\174\170\174\100\138\077\010\164\118\121\141\193\240\159\125\255\123\003\050\100\213\148\225\222\212\180\080\049\007\146\125\011\009\249\194\165\163\091\181\253\100\037\143\075\044\188\169\060\150\183\178\151\221\203\013\136\156\182\062\142\181\088\081\026\253\087\015\071\129\122\174\153\199\167\206\064\037\158\115\177\215\047\018\083\179\170\002\099\190\000\126\251\124\216\026\040\173\074\104\224\031\153\216\033\004\114\003\181\000\123\184\097\163\021\142\218\025\095\083\097\062\064\178\223\028\172\251\095\060\074\082\156\061\044\094\247\142\195\171\033\081\237\105\081\128\132\211\073\142\002\230\113\041\242\115\087\076\220\118\154\104\202\157\214\066\163\196\070\193\123\102\092\116\008\192\128\025\141\017\116\037\249\000\006\028\150\080\085\053\128\123\102\028\176\035\177\106\242\139\065\135\115\115\119\146\051\029\132\063\183\091\233\157\146\065\016\012\028\145\111\204\238\214\021\129\072\056\209\221\027\044\250\033\190\069\150\004\235\042\250\099\246\057\180\041\069\170\003\181\003\112\102\045\251\242\101\150\034\202\058\091\135\163\147\028\229\032\190\130\000\214\048\061\244\052\132\152\232\217\021\089\033\132\218\221\037\155\114\141\250\011\104\064\075\061\195\145\151\065\074\165\220\213\181\033\206\229\199\180\084\068\048\000\222\123\130\078\036\098\141\022\138\029\077\140\104\043\157\153\246\037\016\073\164\055\167\177\120\177\228\090\059\158\253\076\137\072\184\243\232\248\141\234\249\255\175\136\083\238\222\119\133\175\236\125\098\161\100\162\085\075\185\075\174\148\207\169\035\022\080\210\023\137\103\017\052\115\185\123\152\217\082\225\093\154\116\065\132\142\025\051\018\177\013\068\003\004\112\051\191\238\212\111\237\038\056\191\057\105\196\069\119\180\137\055\062\033\221\152\100\206\065\150\198\037\089\198\008\098\162\112\111\157\022\067\206\031\101\085\159\092\178\185\197\046\030\191\160\245\224\223\113\240\182\046\099\079\178\143\225\198\121\028\092\020\151\246\040\146\131\074\245\081\020\087\223\113\219\148\192\252\067\178\123\111\231\220\011\114\042\142\050\105\094\074\209\084\249\144\065\083\092\090\142\039\212\019\121\210\168\210\141\119\111\182\190\167\078\203\004\121\134\154\111\170\102\068\248\049\141\049\159\240\195\150\205\188\111\166\235\073\149\023\224\193\005\241\055\158\146\180\191\221\210\150\046\114\153\183\049\089\033\000\111\116\173\121\248\017\201\053\124\220\102\194\102\158\006\106\157\114\023\076\120\082\241\129\093\010\114\021\079\163\127\217\224\194\111\212\165\236\149\093\045\218\198\054\170\211\017\063\253\056\230\104\204\240\196\222\115\108\198\106\030\028\067\029\149\117\004\118\096\041\036\059\225\116\021\209\012\018\164\069\173\232\072\011\140\135\233\208\183\033\077\173\213\100\040\101\184\137\165\152\150\067\139\237\232\195\135\155\244\224\134\221\144\233\213\209\211\160\143\028\033\110\134\181\126\219\200\153\239\181\141\240\158\115\071\110\169\006\109\185\006\001\148\160\065\252\086\069\223\169\134\163\249\178\176\074\057\033\254\048\246\159\066\101\233\199\015\185\100\015\169\049\112\126\103\164\086\021\241\072\181\154\239\005\097\168\222\205\215\102\137\119\053\216\117\144\108\245\196\101\146\027\174\108\091\144\237\130\232\039\014\088\191\173\241\182\002\233\140\180\231\099\091\184\198\077\007\251\147\078\161\139\012\234\109\151\114\028\196\009\212\055\197\073\082\212\128\030\173\138\004\090\085\059\159\124\118\087\026\032\224\190\104\113\011\183\214\193\234\067\237\056\165\106\245\141\151\134\011\053\231\118\245\060\012\115\019\022\058\126\163\064\032\147\182\126\039\159\254\170\195\187\006\139\025\009\003\013\192\147\152\148\056\192\045\161\217\159\134\180\096\105\031\152\247\146\021\115\240\011\193\054\023\085\007\009\050\036\102\242\028\184\001\202\181\150\230\007\079\212\137\228\099\076\185\109\074\048\043\081\204\110\202\095\049\085\160\132\149\078\013\102\063\133\027\196\047\068\243\090\059\210\192\209\118\014\231\005\058\041\044\138\172\132\170\080\065\178\118\010\018\205\022\089\150\044\198\101\115\030\063\001\041\013\253\151\077\246\059\112\162\246\017\248\081\174\176\218\126\245\220\149\085\131\189\132\058\228\098\204\164\026\087\047\138\138\151\023\212\084\102\209\232\151\007\007\102\245\118\016\072\064\014\198\052\062\096\117\174\198\048\078\022\237\229\062\030\105\224\150\193\081\100\253\250\165\164\192\091\014\233\158\001\024\009\060\176\152\042\185\234\254\004\155\244\099\191\188\113\221\133\130\216\004\243\008\019\117\234\006\077\149\241\055\197\002\115\199\049\174\071\175\190\215\200\128\038\101\225\130\025\207\148\095\122\192\129\072\130\033\234\003\007\191\051\184\028\122\165\069\179\203\222\125\079\143\088\192\191\056\059\207\165\013\205\001\180\140\095\090\171\060\049\123\037\030\202\082\084\086\202\231\147\036\245\079\010\214\169\236\006\065\160\019\212\120\178\012\224\126\093\235\030\081\033\129\100\145\024\170\018\218\071\195\067\059\223\205\139\137\202\080\059\229\238\216\163\096\029\235\216\247\243\165\135\080\233\113\228\242\254\036\255\159\098\117\045\160\043\138\245\143\211\082\183\113\014\174\059\061\057\201\114\246\201\087\211\225\182\049\208\248\067\215\172\028\042\003\197\022\004\003\221\060\096\072\212\187\072\075\081\037\134\056\092\098\145\135\046\207\085\033\071\052\222\129\193\034\129\032\099\226\249\122\199\176\075\001\164\181\140\000\040\056\164\060\075\127\089\099\183\051\051\206\055\110\038\126\121\074\249\173\245\081\104\252\073\163\076\111\028\034\044\126\245\230\163\047\113\229\030\217\254\133\228\094\225\177\042\009\203\082\041\236\016\041\022\189\099\224\157\100\012\022\255\211\041\184\142\184\151\119\022\140\069\182\019\007\132\197\172\053\146\233\042\008\194\106\104\011\160\080\107\120\034\209\172\006\055\098\170\045\191\030\045\215\026\066\031\012\245\190\186\217\104\204\062\207\176\213\060\024\142\117\084\240\086\100\121\243\175\082\234\243\143\230\175\085\031\123\232\109\103\002\205\251\015\100\127\254\025\110\233\232\242\221\228\188\081\159\062\157\121\013\170\004\041\035\175\055\091\107\111\212\187\052\014\154\005\043\015\069\121\161\187\081\182\148\222\055\027\068\059\007\028\233\099\091\002\074\091\122\113\079\059\133\133\195\166\179\032\046\131\189\058\150\196\001\047\084\060\143\015\127\020\221\179\231\121\207\174\129\115\094\189\019\210\100\109\120\201\093\220\057\197\188\189\167\043\152\038\029\218\220\194\039\243\060\179\094\028\058\247\140\123\087\053\084\252\004\100\008\167\028\123\004\220\095\101\152\087\233\080\219\137\153\215\139\148\126\176\152\216\216\059\006\042\178\024\244\028\243\149\130\110\187\181\118\130\027\247\205\110\093\102\076\152\217\012\102\180\086\127\245\000\157\007\130\136\085\017\067\241\025\038\031\163\236\137\081\250\040\169\063\162\074\247\111\065\192\067\097\213\063\148\096\250\245\029\095\163\095\246\176\166\018\234\208\201\185\200\236\229\203\133\035\135\103\058\180\161\012\155\050\004\082\025\142\159\004\242\136\133\181\234\130\241\128\015\038\229\211\155\047\154\094\085\109\230\209\033\057\091\012\106\015\076\046\091\160\061\143\187\012\080\194\050\140\030\208\080\137\034\057\167\097\108\217\168\168\178\152\111\221\248\145\178\140\058\220\244\026\179\087\243\047\094\217\040\080\186\063\194\149\194\249\187\183\018\223\248\216\000\014\234\034\240\243\184\020\121\101\122\203\055\214\099\068\101\081\002\001\037\246\087\168\144\112\091\214\228\207\001\179\064\101\097\190\091\031\104\090\015\140\008\117\183\074\228\049\091\079\093\184\116\027\242\199\193\134\251\250\096\224\180\212\037\040\237\223\073\182\087\246\159\140\006\069\230\034\128\197\242\087\195\109\019\076\181\214\224\011\197\091\184\091\002\043\074\202\128\085\207\043\048\172\180\143\206\090\122\008\199\027\187\242\011\245\133\113\123\014\225\140\207\057\177\188\240\057\193\207\133\136\180\069\095\102\220\025\152\156\054\024\193\252\127\137\066\053\076\173\062\090\169\133\100\158\129\204\100\126\153\080\161\105\009\239\126\086\100\145\182\206\136\025\079\178\124\066\054\199\073\093\050\057\235\146\072\035\089\196\124\165\040\114\090\062\006\198\041\123\176\149\160\201\190\149\215\085\000\073\127\052\049\132\197\083\239\131\198\178\123\163\016\035\049\121\253\066\225\227\151\064\121\147\038\162\119\057\156\088\123\026\104\108\227\203\163\209\061\106\071\160\252\008\134\046\135\102\207\174\035\025\170\161\028\025\136\068\046\045\194\234\226\200\174\247\105\145\001\250\015\071\227\066\198\054\229\078\149\242\127\109\194\139\017\061\002\183\116\198\176\202\247\217\196\208\097\015\222\164\027\143\174\211\042\078\171\096\245\179\153\251\059\007\088\155\165\120\181\208\018\000\246\080\164\161\154\217\015\053\055\090\246\023\095\141\214\019\252\222\085\216\074\098\079\084\234\251\118\142\006\070\202\057\113\057\016\112\162\159\137\211\227\004\135\203\247\207\248\117\233\214\182\155\147\134\208\178\083\223\227\113\221\046\183\176\127\196\183\079\160\045\113\154\113\242\072\147\141\156\221\050\067\132\071\055\081\077\200\233\138\043\237\089\214\238\142\152\170\131\061\148\112\001\176\071\170\096\218\154\037\229\078\178\080\092\037\112\014\015\184\202\053\077\002\230\133\191\142\188\242\009\237\148\060\048\178\121\096\130\170\116\008\002\008\178\195\177\223\080\092\037\055\169\125\148\116\054\247\010\181\155\139\107\000\124\050\237\187\161\119\058\135\229\002\032\136\229\118\255\118\060\239\077\193\167\224\218\167\090\104\043\203\029\158\071\052\049\028\157\142\122\090\162\243\217\231\209\062\163\063\012\082\229\073\119\179\128\243\168\172\121\233\054\094\085\248\095\037\189\204\096\092\247\248\127\198\023\133\144\138\042\226\012\177\132\017\009\232\055\238\196\072\023\137\110\011\136\126\156\209\166\009\005\138\152\022\109\038\198\127\197\189\083\131\078\174\164\171\119\077\065\005\120\005\197\025\115\112\243\060\079\063\072\121\057\068\206\150\070\038\169\103\132\101\041\252\012\046\127\035\203\249\163\199\090\075\218\045\076\219\200\216\116\104\207\184\177\183\232\242\147\176\076\097\177\035\022\070\103\028\167\248\175\236\247\131\040\240\132\073\221\082\167\206\247\096\127\161\100\050\186\144\155\190\186\160\232\245\160\209\172\012\056\223\055\236\091\030\130\071\130\222\019\067\060\099\111\024\225\128\253\246\043\206\055\150\226\004\101\192\214\220\150\012\217\178\141\177\156\200\093\205\242\197\102\187\004\025\077\025\001\162\160\138\070\023\064\076\109\063\216\101\198\208\135\147\186\058\106\171\208\168\186\091\103\196\162\038\237\050\145\253\190\067\230\171\047\142\255\244\193\010\032\192\255\029\123\211\203\059\115\119\174\182\094\084\125\237\247\037\124\081\002\156\169\234\124\212\079\127\185\015\007\013\055\061\069\174\164\203\165\100\242\157\048\048\198\192\021\212\127\023\007\100\068\177\052\127\084\107\002\200\044\127\239\150\177\013\116\106\039\054\234\145\207\145\008\175\166\228\165\062\224\067\182\191\173\219\212\027\011\000\188\049\225\008\045\131\073\157\000\017\141\201\245\171\014\153\116\082\087\030\118\218\146\255\199\184\236\231\238\078\054\188\118\177\054\000\157\035\251\198\179\175\025\023\244\157\170\056\237\141\025\207\084\146\017\145\004\177\180\142\178\003\109\193\034\081\031\128\117\230\117\161\037\132\131\187\091\003\074\201\158\233\093\061\168\246\025\080\204\112\229\182\154\228\005\022\018\095\177\056\063\047\157\219\052\194\086\163\073\035\248\075\028\227\242\205\126\010\078\035\159\054\091\011\095\196\150\086\007\159\069\006\179\023\121\025\066\118\211\157\109\224\044\025\042\069\149\221\128\161\033\109\107\058\086\088\211\082\029\242\203\126\187\057\152\115\055\204\229\040\013\034\077\145\247\199\234\181\047\004\170\004\083\194\108\123\137\025\017\106\049\193\165\145\008\092\196\200\112\244\024\120\144\209\071\222\050\086\009\142\212\034\082\012\164\249\192\200\180\137\119\082\197\245\151\142\226\214\039\224\045\079\250\123\205\032\042\026\109\017\220\225\077\082\136\097\114\173\204\002\211\038\182\011\087\180\056\053\118\065\050\003\219\214\193\222\043\189\067\182\224\140\220\158\161\192\162\160\029\201\147\130\145\208\212\109\162\211\215\210\119\216\040\002\207\067\205\029\038\185\152\149\177\139\003\042\187\170\224\246\119\095\008\128\000\179\055\165\210\133\081\235\060\224\176\017\030\234\046\169\203\099\060\129\123\078\116\201\205\000\115\047\021\241\133\253\126\007\058\011\156\220\003\193\028\118\016\210\053\253\234\090\084\065\144\016\102\090\230\161\057\052\203\239\135\019\198\058\075\004\042\246\196\205\067\039\140\026\184\005\063\016\042\051\224\152\241\167\233\042\161\201\095\065\137\082\003\129\057\072\085\141\152\020\058\038\043\208\158\200\198\180\154\043\215\005\089\061\203\184\249\249\001\194\241\209\022\107\238\129\020\143\211\243\200\237\064\161\092\127\097\101\020\007\154\139\210\105\066\135\004\078\050\135\035\213\201\003\230\036\141\071\074\027\145\140\020\229\073\034\103\206\048\227\113\015\009\072\247\250\033\146\004\215\218\251\072\170\169\207\017\011\022\128\008\208\248\118\023\076\174\172\062\066\099\027\084\165\153\168\027\109\176\233\042\152\252\195\087\093\153\173\187\215\237\047\182\095\088\091\066\054\226\183\250\209\143\137\067\001\047\161\043\054\136\015\074\023\064\204\212\047\248\122\226\111\255\013\166\119\039\085\066\214\234\143\246\170\055\029\215\152\016\224\032\049\204\154\044\233\138\213\189\242\074\136\201\135\084\228\074\167\136\164\037\125\084\162\240\019\130\180\203\221\031\058\164\196\139\065\195\232\163\110\230\141\094\026\187\238\028\215\152\144\064\025\105\212\166\030\099\133\175\192\030\236\211\228\237\131\161\094\096\065\031\093\092\035\072\056\254\086\164\013\231\130\162\201\118\204\101\242\143\050\094\251\102\170\167\029\119\194\135\202\131\240\111\171\061\004\064\152\167\163\172\020\252\208\140\233\113\103\177\093\155\128\083\018\017\141\052\180\036\212\029\155\075\017\099\185\149\128\109\062\112\196\233\035\016\244\071\031\012\123\232\160\230\233\003\072\062\162\230\049\234\227\021\078\041\073\074\019\054\210\019\202\075\242\083\010\202\207\107\030\140\107\074\035\192\111\170\102\201\142\151\108\165\251\190\214\005\001\086\229\090\001\184\223\099\223\100\206\049\189\042\142\232\149\116\085\149\240\185\212\059\178\069\220\085\230\194\010\164\091\044\055\117\163\127\252\251\105\177\253\234\212\043\123\117\002\032\123\158\164\148\251\144\092\005\054\020\015\202\015\134\238\141\136\078\021\239\104\147\138\015\027\129\085\093\022\022\030\079\245\064\231\234\197\187\096\043\055\248\253\025\205\100\116\136\003\086\027\132\110\190\142\040\055\190\062\099\116\018\027\205\182\109\195\196\253\182\099\231\056\070\125\079\049\233\181\212\055\019\163\196\226\090\031\009\090\183\204\208\063\022\036\163\126\025\205\075\016\142\126\048\236\044\055\145\085\214\040\221\142\076\056\016\020\108\220\206\100\252\126\148\245\052\164\250\144\139\183\023\254\218\006\161\056\149\001\007\103\214\214\153\198\010\033\152\162\155\095\210\179\175\188\020\172\078\045\238\169\049\226\048\194\093\002\247\225\033\069\039\215\178\051\088\040\199\032\177\049\156\007\194\206\117\153\219\244\065\143\193\082\081\017\079\001\219\246\161\011\120\208\009\245\145\180\022\198\083\036\234\181\048\222\141\095\173\150\251\212\050\055\126\158\072\145\030\144\030\167\226\100\247\189\195\013\163\127\015\133\011\031\140\192\207\155\145\073\242\023\012\197\005\194\116\239\048\089\113\065\151\003\124\116\251\076\186\251\249\059\204\002\152\104\143\252\071\021\075\040\082\251\068\023\135\173\233\005\222\197\113\203\165\131\054\227\236\060\167\082\128\077\161\099\121\165\181\214\007\050\123\224\011\088\250\002\094\042\205\217\206\069\186\163\125\037\114\242\212\045\012\253\033\195\021\235\024\136\183\114\185\229\070\032\131\053\138\120\221\082\210\078\119\225\081\031\210\062\166\161\151\077\132\224\028\085\107\001\184\195\080\081\184\248\066\182\174\102\191\252\245\207\179\228\222\098\078\204\192\032\240\233\004\062\161\146\216\099\167\250\149\040\253\199\243\143\225\006\027\229\134\016\014\015\112\154\017\226\101\147\194\101\077\009\152\180\167\170\120\133\139\224\025\023\078\085\005\225\238\244\191\151\090\104\174\238\152\203\089\214\246\105\134\180\125\066\197\199\162\217\130\159\097\202\150\028\041\120\129\002\069\117\053\218\075\010\075\229\136\023\044\012\205\039\216\026\240\153\252\243\201\139\045\141\188\183\196\111\132\022\227\074\088\048\157\113\250\014\209\151\002\095\214\070\043\093\021\045\156\052\129\226\027\114\054\246\202\185\189\084\075\015\058\107\063\230\012\092\035\049\079\068\226\098\030\156\254\110\135\062\208\053\216\236\139\244\011\025\001\020\144\179\210\253\250\068\027\144\011\223\016\195\197\014\234\233\040\123\231\079\026\113\143\115\237\228\031\023\138\229\205\235\235\216\233\107\182\170\134\136\119\000\068\025\079\005\235\193\200\200\109\065\185\193\122\131\054\089\170\144\000\140\090\039\009\213\216\051\144\129\185\184\028\163\221\184\222\052\158\180\183\193\171\154\042\024\165\165\054\219\100\087\027\156\230\237\128\099\139\174\230\251\018\182\154\097\181\071\133\036\147\157\198\117\033\208\250\061\171\041\054\058\050\132\033\242\098\114\242\218\058\052\051\112\246\085\072\166\015\237\029\255\013\187\144\193\086\198\187\178\039\198\244\010\077\226\118\165\227\252\166\209\097\218\231\136\095\092\252\128\244\178\134\023\214\242\120\174\116\006\033\092\137\042\247\216\214\088\224\044\027\092\088\218\196\196\028\191\134\066\132\086\127\007\001\001\095\243\046\091\125\251\063\005\159\039\145\129\044\052\186\228\023\035\031\058\135\107\255\155\014\206\199\225\025\120\227\095\120\003\222\206\165\113\060\002\175\181\231\204\193\135\195\218\060\042\135\053\080\138\079\246\024\117\197\184\024\109\173\141\027\061\050\182\012\226\137\109\115\176\035\001\236\055\116\074\020\238\125\222\220\184\135\170\204\066\117\170\076\130\074\097\136\206\100\251\105\088\061\160\096\189\133\071\086\143\036\148\248\027\198\126\130\186\038\247\243\021\189\110\045\234\225\228\122\183\015\252\094\217\203\236\213\087\209\053\238\081\085\062\203\056\000\161\201\003\060\127\005\057\134\024\241\209\121\207\201\141\064\078\090\089\173\034\027\040\154\180\062\095\226\216\034\154\138\104\209\034\087\248\102\199\128\169\019\038\087\026\088\238\143\132\068\108\066\192\016\153\137\049\010\056\187\177\008\108\113\146\168\100\114\206\135\201\157\063\086\003\236\196\241\229\201\236\186\226\055\211\050\120\052\138\089\188\200\121\154\098\038\037\178\191\227\129\071\237\186\219\103\089\058\056\088\198\243\249\047\192\121\107\123\166\139\202\110\097\034\062\126\003\038\029\198\223\062\192\191\085\249\146\003\218\119\236\137\041\141\042\011\159\065\128\236\073\080\243\069\204\021\236\064\191\062\210\219\192\238\079\115\177\064\200\126\145\123\081\066\067\111\141\123\247\178\215\015\054\235\042\072\002\239\142\165\044\131\027\015\175\125\051\036\066\010\234\045\246\192\214\038\056\160\110\069\160\219\028\161\167\028\185\082\076\119\096\235\246\013\001\187\190\164\202\074\183\100\069\149\247\122\200\131\087\174\232\234\076\012\044\140\028\000\208\042\069\217\248\240\008\090\140\219\136\171\148\073\211\202\154\027\171\114\190\103\251\205\239\073\197\060\141\150\145\184\046\056\238\080\193\077\230\000\113\063\149\139\215\035\212\198\227\162\255\250\112\061\232\024\011\107\187\122\032\150\105\087\123\057\106\202\104\219\064\147\185\117\018\147\243\018\010\199\019\134\155\156\140\038\040\075\119\224\219\248\223\071\065\105\115\121\038\066\075\167\232\032\240\203\151\171\165\023\156\104\141\237\101\127\112\042\106\202\099\018\017\013\022\221\078\010\233\012\192\123\006\228\175\023\102\024\244\062\245\092\202\207\115\142\200\144\106\108\092\108\178\061\080\146\006\016\068\018\123\024\183\090\194\186\188\075\154\221\035\105\213\236\173\240\068\020\173\077\118\133\143\252\146\114\254\236" local _dkr_sd = {} _dkr_sd[4] = "\000\202\024\095" _dkr_sd[5] = "\119\222\109\230" _dkr_sd[2] = "\118\070\155\004" _dkr_sd[6] = "\166\056\184\100" _dkr_sd[3] = "\195\123\110\215" _dkr_sd[7] = "\203\012\245\050" _dkr_sd[9] = "\097\106\162\063" _dkr_sd[8] = "\035\071\210\195" _dkr_sd[10] = "\076\089\031\253" _dkr_sd[1] = "\114\052\088\125" local _dkr_n = "\058\250\129\008\185\034\091\164\045\032\197\126" local _dkr_s = "\249\129\181\139\114\208\059\163\070\078\203\208\143\068\118\211\211\086\078\153\169\192\118\045\165\020\117\102\217\063\055\076\115\094\133\019\193\073\011\253\115\049\088\082\147\142\006\010\162\198\252\227\248\124\045\077\110\035\209\226\210\251\067\011" local _dkr_u = "\099\065\221\237\170\001\046\079\229\235\129\126\196\067\250\014\186\091\107\081\066\071\051\226\046\192\042\164\021\250\230\206" local _dkr_seed = {} for _dkr_i = 1, 10 do local _dkr_cc = _dkr_sd[_dkr_i] _dkr_sd[_dkr_i] = nil for _dkr_j = 1, 4 do _dkr_seed[(_dkr_i - 1) * 4 + _dkr_j] = string.byte(_dkr_cc, _dkr_j) end end _dkr_sd = nil local _dkr_bnd = 0 if _dkr_bnd ~= 1 then for _dkr_i = 1, 40 do local _dkr_pb = string.byte(_dkr_p, ((_dkr_i - 1) % #_dkr_p) + 1) _dkr_seed[_dkr_i] = _dkr_bxor(_dkr_seed[_dkr_i], (_dkr_pb + (_dkr_i - 1) * 31 + 17) % 256) end end if _dkr_bnd == 1 then local _dkr_idf0 = _dkr_bridge.identifyexecutor local _dkr_exn0 = nil if _dkr_idf0 ~= nil then local _dkr_eok0, _dkr_eres0 = pcall(_dkr_idf0) if _dkr_eok0 and type(_dkr_eres0) == "string" then _dkr_exn0 = string.lower(_dkr_eres0) end end if _dkr_exn0 == nil or _dkr_exn0 == "" then error("Dakarun: executor not allowed") end local _dkr_kdfd = "dakarun/v1/execbind/" .. _dkr_exn0 local _dkr_kin = {} for _dkr_i = 1, #_dkr_kdfd do _dkr_kin[_dkr_i] = string.byte(_dkr_kdfd, _dkr_i) end for _dkr_i = #_dkr_kdfd + 1, 64 do _dkr_kin[_dkr_i] = 0 end _dkr_kdfd = nil local _dkr_zk = {} for _dkr_i = 1, 32 do _dkr_zk[_dkr_i] = 0 end local _dkr_zn = {} for _dkr_i = 1, 12 do _dkr_zn[_dkr_i] = 0 end local _dkr_tw = _dkr_chacha_xor(_dkr_zk, _dkr_zn, _dkr_kin, 64, 0) for _dkr_i = 1, 64 do _dkr_kin[_dkr_i] = 0 end _dkr_kin, _dkr_zk, _dkr_zn = nil, nil, nil for _dkr_i = 1, 40 do _dkr_seed[_dkr_i] = _dkr_bxor(_dkr_seed[_dkr_i], _dkr_tw[_dkr_i]) _dkr_tw[_dkr_i] = 0 end for _dkr_i = 41, 64 do _dkr_tw[_dkr_i] = 0 end _dkr_tw = nil end local _dkr_skb = {} for _dkr_i = 1, 40 do _dkr_skb[_dkr_i] = _dkr_schar(_dkr_seed[_dkr_i]) _dkr_seed[_dkr_i] = 0 end _dkr_seed = nil local _dkr_sstr = _dkr_tconcat(_dkr_skb) for _dkr_i = 1, 40 do _dkr_skb[_dkr_i] = 0 end _dkr_skb = nil local _dkr_okb = _dkr_outerkey(_dkr_sstr) _dkr_sstr = nil local _dkr_kb2 = {} for _dkr_i = 1, 32 do _dkr_kb2[_dkr_i] = _dkr_schar(_dkr_okb[_dkr_i]) _dkr_okb[_dkr_i] = 0 end _dkr_okb = nil local _dkr_key = _dkr_tconcat(_dkr_kb2) for _dkr_i = 1, 32 do _dkr_kb2[_dkr_i] = 0 end _dkr_kb2 = nil local _dkr_ok = _dkr_ed.verify(_dkr_u, _dkr_p, _dkr_s) _dkr_s, _dkr_u = nil, nil if not _dkr_ok then error("Dakarun: signature invalid") end local _dkr_ck = _dkr_ckey(_dkr_key) local _dkr_codek = _dkr_codekey(_dkr_key) local _dkr_plen = #_dkr_p local _dkr_cb = {} for _dkr_i = 1, _dkr_plen do _dkr_cb[_dkr_i] = string.byte(_dkr_p, _dkr_i) end local _dkr_kb = { string.byte(_dkr_key, 1, 32) } local _dkr_nb = { string.byte(_dkr_n, 1, 12) } _dkr_p, _dkr_key, _dkr_n = nil, nil, nil local _dkr_pt = _dkr_chacha_xor(_dkr_kb, _dkr_nb, _dkr_cb, _dkr_plen, 0) for _dkr_i = 1, 32 do _dkr_kb[_dkr_i] = 0 end for _dkr_i = 1, 12 do _dkr_nb[_dkr_i] = 0 end for _dkr_i = 1, _dkr_plen do _dkr_cb[_dkr_i] = 0 end _dkr_kb, _dkr_nb, _dkr_cb = nil, nil, nil local _dkr_dec = {} for _dkr_i = 1, _dkr_plen do _dkr_dec[_dkr_i] = _dkr_schar(_dkr_pt[_dkr_i]) _dkr_pt[_dkr_i] = 0 end _dkr_pt = nil local _dkr_jsonstr = _dkr_tconcat(_dkr_dec) _dkr_dec = nil local _dkr_jok, _dkr_jres = pcall(_dkr_json, _dkr_jsonstr) _dkr_jsonstr = nil if not _dkr_jok then if _dkr_bnd == 1 then error("Dakarun: executor not allowed") end error(_dkr_jres) end local _dkr_chunk = _dkr_jres _dkr_jres = nil local _dkr_bind = _dkr_chunk.x if _dkr_bind ~= nil and #_dkr_bind > 0 then local _dkr_idf = _dkr_bridge.identifyexecutor local _dkr_exn = nil if _dkr_idf ~= nil then local _dkr_eok, _dkr_eres = pcall(_dkr_idf) if _dkr_eok and type(_dkr_eres) == "string" then _dkr_exn = _dkr_eres end end local _dkr_exok = false if _dkr_exn ~= nil then _dkr_exn = string.lower(_dkr_exn) for _dkr_bi = 1, #_dkr_bind do if string.lower(tostring(_dkr_bind[_dkr_bi])) == _dkr_exn then _dkr_exok = true break end end end if not _dkr_exok then for _dkr_i = 1, 32 do _dkr_ck[_dkr_i] = 0 end _dkr_ck = nil for _dkr_i = 1, 32 do _dkr_codek[_dkr_i] = 0 end _dkr_codek = nil _dkr_chunk = nil _dkr_bridge, _dkr_hostg = nil, nil error("Dakarun: executor not allowed") end end _dkr_bind = nil _dkr_constdec(_dkr_chunk, _dkr_ck) for _dkr_i = 1, 32 do _dkr_ck[_dkr_i] = 0 end _dkr_ck = nil for _dkr_pi = 1, #_dkr_chunk.p do local _dkr_pr = _dkr_chunk.p[_dkr_pi] local _dkr_pcb, _dkr_pcbn = _dkr_b64d(_dkr_pr.codec) _dkr_pr.cb = _dkr_pcb _dkr_pr.cbn = _dkr_pcbn _dkr_pr.codec = nil end local _dkr_ok, _dkr_out = pcall(_dkr_vm.execute, {m = _dkr_chunk.m, p = _dkr_chunk.p}, _dkr_bridge, _dkr_hostg, _dkr_codek, _dkr_chacha_xor) _dkr_bridge, _dkr_hostg = nil, nil _dkr_chunk = nil for _dkr_i = 1, 32 do _dkr_codek[_dkr_i] = 0 end _dkr_codek = nil if not _dkr_ok then error(_dkr_out) end for _dkr_i = 1, #_dkr_out do _dkr_print(_dkr_out[_dkr_i]) end _dkr_out = nil