Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = { ... }
- path = args[1]
- special = {}
- special[40] = true
- special[41] = true
- special[46] = true
- special[37] = true
- special[43] = true
- special[45] = true
- special[42] = true
- special[63] = true
- special[91] = true
- special[94] = true
- special[36] = true
- from = 33
- to = 126
- nTbl = {}
- oTbl = {}
- for i=1,to-from+1,1 do
- nTbl[#nTbl+1] = (from+i)-1
- oTbl[#oTbl+1] = (from+i)-1
- end
- sTbl = {}
- for i=1,#oTbl,1 do
- sNum = math.random(1,#oTbl)
- sTbl[#sTbl+1] = tonumber(oTbl[sNum])
- table.remove(oTbl,sNum)
- end
- file = fs.open(path,"r")
- fileCont = file.readAll()
- file.close()
- for i=1,#sTbl,1 do
- replaceChar = nTbl[i]
- withChar = sTbl[i]
- print(i .. ": " .. string.char(replaceChar) .. " => " .. string.char(withChar) .. "(" .. sTbl[i] .. ")")
- if special[nTbl[i]] == true then
- if sTbl[i] == 37 then
- fileCont = string.gsub(fileCont,"%" .. string.char(replaceChar),"%" .. string.char(withChar))
- else
- fileCont = string.gsub(fileCont,"%" .. string.char(replaceChar),string.char(withChar))
- end
- else
- if sTbl[i] == 37 then
- fileCont = string.gsub(fileCont,string.char(replaceChar),"%" .. string.char(withChar))
- else
- fileCont = string.gsub(fileCont,string.char(replaceChar),string.char(withChar))
- end
- end
- end
- str = ""
- for i,k in pairs(nTbl) do
- str = str .. k
- end
- print("Key: " .. str)
- fileWr = fs.open(path .. ".key","w")
- fileWr.write(str)
- fileWr.close()
- fileWr = fs.open(path,"w")
- fileWr.write(fileCont)
- fileWr.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement