Guest User

Untitled

a guest
Apr 27th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. function getData() --获取数据
  2. local getList = function(path)
  3. local a = io.popen("ls "..path)
  4. local f = {};
  5. for l in a:lines() do
  6. table.insert(f,l)
  7. end
  8. return f
  9. end
  10. local Wildcard = getList("/var/mobile/Containers/Data/Application")
  11. for var = 1,#Wildcard do
  12. local file = io.open("/var/mobile/Containers/Data/Application/"..Wildcard[var].."/Library/WechatPrivate/wx.dat","rb")
  13. if file then
  14. local str = file:read("*a")
  15. file:close()
  16. --[[
  17. require"sz"
  18. local str = string.tohex(str) --16进制编码
  19. ]]
  20. return str
  21. end
  22. end
  23. end
  24.  
  25.  
  26. function writeData(data) --写入数据(62数据)
  27. local getList = function(path)
  28. local a = io.popen("ls "..path)
  29. local f = {};
  30. for l in a:lines() do
  31. table.insert(f,l)
  32. end
  33. return f
  34. end
  35. local Wildcard = getList("/var/mobile/Containers/Data/Application")
  36. for var = 1,#Wildcard do
  37. local file = io.open("/var/mobile/Containers/Data/Application/"..Wildcard[var].."/Library/WechatPrivate/wx.dat","w+")
  38. if file then
  39. file:write(data)
  40. file:close()
  41. return true
  42. end
  43. end
  44. end
Add Comment
Please, Sign In to add comment