Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if #args < 4 then
- print("DriveCrypter - a drive encrypting tool")
- print("Usage: " .. fs.getName(shell.getRunningProgram()) .. " <encrypt | decrypt> <key> <init. vector> <path>")
- print("Uses AES to encrypt the given files.")
- return
- end
- local func = args[1] or ""
- local key = args[2] or ""
- local iv = args[3] or ""
- local path = args[4] or ""
- if not fs.isDir(path) then
- error("Invalid path",0)
- end
- if not fs.exists("filehidercli") then
- local webHandle = http.get("http://pastebin.com/raw.php?i=wQ1aUnpU")
- if webHandle then
- local apiData = webHandle.readAll()
- webHandle.close()
- local apiHandle = fs.open("filehidercli",'w')
- apiHandle.write(apiData)
- apiHandle.close()
- else
- if not http then
- error("File Hider CLI is not present and the HTTP API is disabled.\nPlease either aquire File Hider CLI manually (from Pastebin wQ1aUnpU, must be saved as filehidercli in /) or enable the HTTP API.")
- else
- error("File Hider CLI is not present and you either you don't have Internet or Pastebin's servers are down.\nFile Hider CLI is a required dependecy and the program can't continue.")
- end
- end
- end
- local function listAll(_path,_files)
- local path = _path or ""
- local files = _files or {}
- if #path > 1 then table.insert(files,path) end
- for _,file in ipairs(fs.list(path)) do
- local path = fs.combine(path,file)
- if fs.isDir(path) then
- listAll(path,files)
- else
- table.insert(files,path)
- end
- end
- return files
- end
- for _,filename in ipairs(listAll(path)) do
- shell.run("filehidercli",filename,func,key,iv,filename)
- end
Advertisement
Add Comment
Please, Sign In to add comment