Advertisement
thegreatstudio

orange anti

May 2nd, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.21 KB | None | 0 0
  1. function main()
  2. if fs.exists("//.orange/kernel/kernel.kern") then
  3. restore()
  4. else
  5. start()
  6. end
  7. end
  8.  
  9. function scantrue()
  10.  
  11. print("Scanning your System..")
  12. print(fs.getName("//.CC"))
  13. print(fs.getName("//.CC/Users"))
  14. print(fs.getName("//.CC/Kernels"))
  15. print(fs.delete("/trojan"))
  16. print(fs.delete("/autorun.inf"))
  17. print(fs.delete("/ILOVEYOU.virus"))
  18. sleep(2)
  19. if fs.exists("/startup") then
  20. print("Backing up the kernel!!")
  21. backup()
  22. else
  23. createnewkernel()
  24. end
  25. end
  26.  
  27.  
  28. function start()
  29. print("Welcome to Orange Antivirus!!")
  30. print("Created By: thegreatstudio")
  31. print("Options:")
  32. print("Scan")
  33. print("Update")
  34. write("Choose: ")
  35. local choose = read()
  36.  
  37. if choose == "scan" then
  38. scantrue()
  39. else
  40. update()
  41. end
  42. end
  43.  
  44. function update()
  45. term.clear()
  46. resp = http.get("http://pastebin.com/raw.php?i=JwSsbUSm")
  47. if resp then
  48. local fileHandle=fs.open("/orange", "w")
  49. fileHandle.write(resp.readAll())
  50. fileHandle.close()
  51. print("Updated!")
  52. sleep(1)
  53. start()
  54. else
  55. print("Cant reach the server!")
  56. end
  57. end
  58.  
  59. function backup()
  60. if fs.exists("//.orange/kernel/kernel.kern") then
  61. print("The kernel has been already backedup!!")
  62. else
  63. print("Do you want to Backup your kernel??")
  64. print("Type in yes or no")
  65. write("Choose: ")
  66. choose = read()
  67. if choose == "yes" then
  68. fs.copy("/startup", "//.orange/kernel/kernel.kern")
  69. sleep(1)
  70. print("Done!!")
  71. sleep(0.9)
  72. protect()
  73. else
  74. print("Somethings blocking for copying the kernel. Try it again later!")
  75. end
  76. end
  77. end
  78.  
  79. function protect()
  80. if fs.exists("//.orange/startup/startup.kern") then
  81. print("Its already protected!")
  82. else
  83. local fileContent = fs.open("/startup", "r")
  84. local fileHandler = fs.open("//.orange/startup/startup.kern", "w")
  85. fileHandler.write(fileContent.readAll())
  86. fileContent.close()
  87. fileHandler.close()
  88. end
  89. end
  90.  
  91. function createnewkernel()
  92. local file = fs.open("/startup", "w")
  93. write("Put your Code to this Kernel!: ")
  94. local input = read()
  95. file.write(input)
  96. file.close()
  97. end
  98.  
  99. function restore()
  100. print("Do you want to restore your kernel??")
  101. print("Type yes or no")
  102. write("Choose: ")
  103. local choose = read()
  104. if choose == "yes" then
  105. fs.copy("//.orange/kernel/kernel.kern", "/startup")
  106. else
  107. print("Aborting!")
  108. sleep(1)
  109. start()
  110. end
  111. end
  112.  
  113. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement