Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- By lurquhar1221
- Why I created this:
- Because I needed a program that checked disks,
- So people could apply to RedBlueInk.
- This program checks the disk and if it has anything malicious,
- It spits it back out.
- ]]
- local malicous = {
- "getfenv",
- "setfenv",
- "os.shutdown",
- "os.reboot",
- "shell.exit",
- "loadstring",
- }
- local diskPath = "drive_54"
- local inverted = true
- local rsSide = "top"
- rs.setOutput(rsSide,inverted)
- while true do
- sleep(0)
- if fs.exists('disk') then
- for n,v in pairs(fs.list('disk')) do
- if endProg then
- break
- end
- local file = fs.open('disk/'..v,'r')
- local data = file.readAll()
- file.close()
- sleep(0)
- for i,k in pairs(malicous) do
- if data:match(k) then
- disk.eject(drivePath)
- endProg = true
- break
- end
- end
- end
- if not endProg then
- rs.setOutput(rsSide, not inverted)
- sleep(2)
- rs.setOutput(rsSide, inverted)
- end
- sleep(0.1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment