Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("disk") and fs.isDir("disk") then
- local diskFiles = {}
- local file = ""
- local fileContents = ""
- local fileName = ""
- for i,v in pairs(fs.list("disk")) do diskFiles[i] end
- for i=1, #diskFiles do
- if fs.isDir("disk/"..diskFiles[i]) then diskFiles[i].fType = 1 -- 1 for directory 0 for file
- else diskFiles[i].ftype = 0 end
- end
- for i=1, #diskFiles do
- if diskFiles[i].fType = 1 then
- file = io.open("disk/"..diskFiles[i], "r")
- fileName = tostring("disk/"..diskFiles[i])
- fileContents = file:read("*a")
- file:close()
- if contains(fileContents, "os.shutdown()" then
- fs.delete("disk/"..diskFiles[i])
- fs.open("disk/"..fileName, "w")
- file = io.open("disk/"..fileName, "w")
- file:write('print("N-Virus Detection: os.shutdown() virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:write(fileContents)
- file:close()
- elseif contains(fileContents, 'fs.delete("startup")') then
- fs.delete("disk/"..diskFiles[i])
- fs.open("disk/"..fileName, "w")
- file = io.open("disk/"..fileName, "w")
- file:write('print("N-Virus Detection: Startup deletion virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:write(fileContents)
- file:close()
- elseif contains(fileContents, 'os.reboot()') then
- fs.delete("disk/"..diskFiles[i])
- fs.open("disk/"..fileName, "w")
- file = io.open("disk/"..fileName, "w")
- file:write('print("N-Virus Detection: os.reboot() virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:write(fileContents)
- file:close()
- elseif contains(fileContents, 'shell.run(') then
- if contains(fileContents, ') -- N-Virus Protected') == false then
- fs.delete("disk/"..diskFiles[i])
- fs.open("disk/"..fileName, "w")
- file = io.open("disk/"..fileName, "w")
- file:write('print("N-Virus Detection: shell.run() virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:write(fileContents)
- file:close()
- end
- else print("All clean! - N-Virus by PaymentOption and theobjop\n\n")
- end
- if fs.exists("disk/startup") then
- file = io.open("disk/startup", "r")
- fileContents = file:read("*a")
- file:close()
- if contains(fileContents, "os.shutdown()") then
- fs.delete("startup")
- fs.open("startup", "w")
- file = io.open("startup", "w")
- file:write('print("\nN-Virus Detection: os.shutdown() virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:close()
- os.reboot()
- elseif contains(fileContents, 'fs.delete("startup")') then
- fs.delete("startup")
- fs.open("startup", "w")
- file = io.open("startup", "w")
- file:write('print("\nN-Virus Detection: os.shutdown() virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:close()
- os.reboot()
- elseif contains(fileContents, 'shell.run(') then
- if contains(fileContents, ') -- N-Virus Protected') == false then
- fs.delete("startup")
- fs.open("startup", "w")
- file = io.open("startup", "w")
- file:write('print("\nN-Virus Detection: os.shutdown() virus. To remove this warning, edit your startup file and delete this line.")\n')
- file:close()
- os.reboot()
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement