local credential=... local type,pcall,error,tostring,tonumber=type,pcall,error,tostring,tonumber local rawset,getfenv=rawset,getfenv local globals,host=_G,game local byte,gsub,find=string.byte,string.gsub,string.find local wait=type(task)=="table"and task.wait local clock=os.clock local compile=loadstring local function member(value,key) local ok,result=pcall(function()return value[key]end) if ok then return result end end local keyless=false if keyless then credential="" elseif type(credential)~="string"then for lv=2,4 do local f,sc=pcall(getfenv,lv) local v=f and type(sc)=="table"and member(sc,"script_key") if type(v)=="string"then credential=v;pcall(rawset,sc,"script_key",nil);break end end end local spawn=member(task,"spawn") local fetch=member(host,"HttpGet") local ok,senv=pcall(function()return getfenv()end) if not ok or type(senv)~="table"then senv=globals end local ok,environment=pcall(function()return getgenv()end) if not ok or type(environment)~="table"then environment=senv end local function global(key)return member(environment,key)or member(senv,key)or member(globals,key)end local sample=20 local platform="?" pcall(function() local input=host:GetService("UserInputService") platform=input.TouchEnabled and not input.KeyboardEnabled and"m"or"d" end) local function ms(x)return math.floor(x*1000+.5)end local reqs,seen={},{} local function add(fn,name) if type(fn)=="function"and not seen[fn]then seen[fn]=true;reqs[#reqs+1]={fn,name}end end add(global("request"),"request") add(global("http_request"),"http_request") add(global("httpRequest"),"httpRequest") add(global("httprequest"),"httprequest") add(member(global("http"),"request"),"http.request") add(member(global("syn"),"request"),"syn.request") local bt=member(global("buffer"),"tostring") local url="\104\116\116\112\115\58\47\47\102\108\111\119\97\117\116\104\46\110\101\116\47\97\115\115\101\116\115\47\102\108\111\119\97\117\116\104\47\115\104\97\50\53\54\47\56\99\98\48\49\100\50\100\99\53\55\98\56\55\54\55\100\50\49\101\53\101\50\50\49\51\57\102\102\100\55\50\101\101\50\48\100\99\48\101\51\48\99\101\49\52\48\49\101\49\53\102\98\49\100\102\57\55\98\57\51\99\100\100\47\118\52\95\98\111\111\116\115\116\114\97\112\112\101\114\95\109\97\114\98\101\103\46\108\117\97" local fallback="\104\116\116\112\115\58\47\47\51\55\46\49\56\55\46\49\51\54\46\49\56\55\47\97\115\115\101\116\115\47\102\108\111\119\97\117\116\104\47\115\104\97\50\53\54\47\56\99\98\48\49\100\50\100\99\53\55\98\56\55\54\55\100\50\49\101\53\101\50\50\49\51\57\102\102\100\55\50\101\101\50\48\100\99\48\101\51\48\99\101\49\52\48\49\101\49\53\102\98\49\100\102\57\55\98\57\51\99\100\100\47\118\52\95\98\111\111\116\115\116\114\97\112\112\101\114\95\109\97\114\98\101\103\46\108\117\97" local fresh=url.."?retry=2e8c8b03b860d99d" local retry=gsub(url,"/sha256/[a-f0-9]+/","/").."?retry=2e8c8b03b860d99d" local expected=627508 local runtime,reason,issue,pr=nil,nil,"timed out",0 local transport,issueTransport="HttpGet","HttpGet" local function problem(message,rank) if rank>=pr then issue,pr,issueTransport=message,rank,transport end end local arrived,ck,cm=0,0,0 local function accept(value) local began=clock() if type(value)=="buffer"then local ok,text=pcall(bt,value);value=ok and text or nil end if type(value)~="string"then problem("unsupported response body",1);return end if #value~=expected then if #value<1024 and find(value,"Failed to send HTTP request.",1,true)then problem(find(value,"timed out",1,true)and"HTTP request timed out"or"HTTP request failed",2) else problem("received "..#value.." bytes; expected "..expected,2)end return end local s1,s2,i=1.0,0.0,1 while i+7<=#value do local a,b,c,d,e,f,g,h=byte(value,i,i+7) s2=(s2+8*s1+8*a+7*b+6*c+5*d+4*e+3*f+2*g+h)%65521 s1=(s1+a+b+c+d+e+f+g+h)%65521;i=i+8 end while i<=#value do s1=(s1+byte(value,i))%65521;s2=(s2+s1)%65521;i=i+1 end if s2*65536.0+s1~=368677546 then problem("runtime checksum mismatch",3);return end local t=clock();ck=t-began local ok,compiled,detail=pcall(compile,value,"=FlowAuthRuntime") local text=not(ok and type(compiled)=="function")and tostring(ok and detail or compiled) if text and not(find(text,"FlowAuthRuntime:")or find(text,"xpected")or find(text,"syntax"))then if wait then pcall(wait,1.5)end ok,compiled,detail=pcall(compile,value,"=FlowAuthRuntime") end cm=clock()-t if ok and type(compiled)=="function"then runtime=compiled;return true end reason=(ok and detail or compiled)or"compiler returned no function";issueTransport=transport return false end local cs={{fetch,"HttpGet",url}} if fallback~=""then cs[#cs+1]={fetch,"HttpGet",fallback,true}end for i=1,#reqs do local candidate=reqs[i] if fallback~=""then cs[#cs+1]={candidate[1],candidate[2],fallback,true}end cs[#cs+1]={candidate[1],candidate[2],fresh} end cs[#cs+1]={fetch,"HttpGet",retry} local started,ni,ls,idle=clock(),1,0,0 local js,shut,alternate={},false,false local asynchronous=type(spawn)=="function"and type(wait)=="function" local function launch() local candidate=cs[ni];ni=ni+1;ls=clock() local job={name=candidate[2],alternate=candidate[4]};js[#js+1]=job local function run() if shut or job.started then return end job.started=true local ok,response if job.name=="HttpGet"then ok,response=pcall(candidate[1],host,candidate[3]) else ok,response=pcall(candidate[1],{Url=candidate[3],Method="GET"})end if not shut then job.ok,job.response,job.done=ok,response,true end end if asynchronous then local ok,thread=pcall(spawn,run);job.thread=ok and thread or nil if not job.started and type(job.thread)~="thread"then asynchronous=false;run()end else run()end end launch() for poll=1,4000 do local active,completed=0,false for i=1,#js do local job=js[i] if not job.done then active=active+1 elseif not job.read then job.read=true;completed=true;transport=job.name;arrived=clock()-started local response=job.response;job.response=nil if not job.ok then problem("request failed",1) elseif type(response)=="table"then local status=tonumber(member(response,"StatusCode")or member(response,"status_code")or member(response,"Status")or member(response,"status"))or 0 local success=member(response,"Success");if success==nil then success=member(response,"success")end if status==0 and success==true then status=200 end if success==false and status<400 then status=500 end if status>=200 and status<300 then accept(member(response,"Body")or member(response,"body")or member(response,"ResponseBody")or member(response,"response_body")) else problem("HTTP "..status,2)end else accept(response)end if runtime or reason then alternate=job.alternate;break end end end if runtime or reason or(active==0 and ni>#cs)then break end local t=clock() if t-started-idle>=40 then problem("HTTP download timed out after 40 seconds",4);break end if ni<=#cs and(active==0 or(active<2 and(completed or t-ls>=8)))then launch() elseif not pcall(wait,.03)then problem("HTTP download wait unavailable",4);break else idle=idle+math.max(clock()-t-1,0)end end shut=true for i=1,#js do js[i].response=nil end local function send(base,path,body,delay) local query="?p="..gsub('{"protocol":3,"loader_hash":"\100\102\49\98\50\98\57\102\98\48\54\97\101\49\100\101\102\101\48\55\57\53\97\102\57\52\53\53\51\51\56\56","\108\97\117\110\99\104\95\116\105\99\107\101\116":"\118\50\58\106\103\79\85\113\57\106\81\72\104\83\106\120\95\65\99\58\49\51\110\104\53\55\51\66\102\120\71\75\117\84\108\77\119\112\76\65\74\65\58\70\102\111\104\100\85\84\100\72\110\108\50\49\109\57\53\82\115\105\76\65\57\75\120\90\112\45\105\51\81\76\52\108\71\72\107\112\69\45\57\79\83\56\102\54\104\101\77\84\72\88\116\100\122\71\54\119\122\77\113\83\118\98\90\67\116\122\117\53\112\74\85\86\49\70\73\100\95\66\95\105\100\87\68\87\51\90\52\75\82\114\49\117\82\72\100\70\75\104\65\121\113\98\65\101\53\68\83\116\88\52\117\80\95\74\85\70\114\52\82\87\98\115\99\74\104\52\113\57\89\98\101\110\112\79\69\101\110\75\97\122\57\85\121\98\51\53\85\75\117\119\80\66\82\99\114\108\77\111\56\81\99\76\67\113\52\45\72\106\112\113\103\104\67\85\109\86\110\83\122\113\49\56\100\110\80\83\114\85\75\88\53\103\115\56\78\90\118\119\80","stage":"'..body,"[^%w]",function(c)return string.format("%%%02X",byte(c))end) pcall(spawn,function() if delay then pcall(wait,delay)end local target=gsub(base,"/assets/.*",path)..query if not pcall(fetch,host,target)and reqs[1]then pcall(reqs[1][1],{Url=target,Method="GET"})end end) end if not runtime then pcall(function() local text=gsub(issueTransport..": "..tostring(reason or issue),"[^%w .:;,()=/_-]","?") local body=(reason and"launcher_load"or"launcher_download")..'","executor":"launcher","diag":["pf='..platform..'"],"error":"'..string.sub(text,1,160)..'"}' for _,base in ipairs{url,fallback}do if base~=""then send(base,"/v1/telemetry/executor",body)end end end) if reason then error("FlowAuth runtime compilation failed: "..tostring(reason),0)end error("FlowAuth runtime download failed ("..issueTransport.."): "..tostring(issue)..". Please run the loader again.",0) end if sample>0 and spawn and math.random(sample)==1 then pcall(send,alternate and fallback or url,"/v1/telemetry/load",'load","pf":"'..platform..'","tp":"'..transport..'","fb":'..(alternate and 1 or 0)..',"tr":'..#js..',"dl":'..ms(arrived)..',"ck":'..ms(ck)..',"cm":'..ms(cm)..',"w":'..sample..'}',2) end if asynchronous then pcall(wait)end local handoff=alternate and {"\253\116\154\125\30\193\14\115\234\197\18\177\93\206\136\50\131\151\124\95\168\46\61\10\103\22\159\236\163\61\44\223\211\87\81\232\228\225\215\245\27\9\22\211\27\181\107\215\197\5\192\180\82\162\84\39\111\87\18\186\102\27\151\120\72\65\16\233\247\161\64\161\246\35\107\6\20\117\130\181\247\240\34\166\76\227\67\29\1\224\19\136\152\142\240\95\243\245\183\202\77\66\57\21\177\144\182\30\19\147\239\77\81\3\82\85\160\251\87\248\226\84\65\125\177\139\77\81\144\8\187\98\200\41\105\22\192\190\93\44\209\25\202\11\92\57\228\117\178\46\2\108\156\32\150\31\226\94\190\26\255\94\218\223\132\39\16\199\21\110\242\245\151\80\101\70\53\149\98\116\185\181\136\36\86\165\218\142\133\3\209\29\9\230\79\23\167\254\119\209\79\11\200\149\3\133\199\101\47\16\217\0\123\124\197\249\3\7\36\112\109\177\249\105\46\223\195\220\96\163\147\216\17\49\228\162\15\203\107\233\43\170\42\178\94\253\216\84\179\204\110\22\208\32\23\92\142\192\91\139\230\82\139\144\68\241\229\201\131\14\60\167\234\163\220\242\35\195\129\82\64\189\76\183\73\99\88\108\103\173\11\253\242\88\77\109\80\72\140\149\185\81\109\178\89\195\216",1837833769,4175782675} or {"\113\241\182\148\201\227\185\61\141\126\79\102\216\157\224\26\174\61\79\133\62\114\22\71\200\81\134\85\212\112\251\168\154\204\60\165\4\167\2\141\5\6\119\181\110\198\50\221\122\210\42\253\16\187\168\198\100\36\41\178\125\82\31\239\187\53\60\153\227\191\112\184\20\191\180\69\44\102\111\198\190\204\22\7\19\193\242\207\250\161\97\14\212\87\159\105\213\70\139\228\151\242\181\246\155\52\87\247\168\245\136\68\65\58\240\94\20\225\161\146\223\67\142\53\50\106\5\245\169\116\65\156\242\176\121\119\184\25\17\110\18\113\129\244\245\180\62\253\127\16\206\111\219\177\111\59\227\206\216\181\203\16\128\99\236\22\252\180\217\197\86\236\99\147\38\248\225\9\153\107\21\75\35\119\210\131\87\138\113\126\182\172\136\84\65\140\172\156\179\99\191\21\37\247\199\165\234\13\150\14\46\223\83\76\193\99\80\159\151\81\255\58\72\139\123\148\228\251\208\208\54\38\94\83\217\235\0\232\49\44\165\126\76\186\72\209\194\186\105\2\87\149\181\246\70\187\37\58\238\91\219\230\204\31\160\47\128\36\36\243\171\91\19\101\5\142\142\53\170\115\215\95\197\232\24\178\150\204\54\127\204\201\17\233\234\132\74\144\206\180\194\155\54\164\112",544186072,3861013794} local function publish(target) if type(target)=="table"then pcall(rawset,target,"_bsdata0",handoff)end end publish(environment) publish(globals) _bsdata0=handoff pcall(function()publish(getfenv(runtime))end) handoff=nil return runtime(credential)