wechat-data-decode.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2019/08/13 11:21:00
  6. @Version : 1.0
  7. @License : (C)Copyright 2019 liuyuqi
  8. @Desc : 微信data数据解析
  9. '''
  10. import os
  11. out_path=r"D:/photo/"
  12. path = r'C:/Users/xx/AppData/Local/Packages/TencentWeChatLimited.forWindows10_sdtnhv12zgd7a/LocalCache/Roaming/Tencent/WeChatAppStore/WeChatAppStore Files/ab3255/Data/'
  13. def imageDecode(f,fn):
  14. dat_read = open(f, "rb")
  15. out=out_path+fn+".png"
  16. png_write = open(out, "wb")
  17. for now in dat_read:
  18. for nowByte in now:
  19. newByte = nowByte ^ 0xAB
  20. png_write.write(bytes([newByte]))
  21. dat_read.close()
  22. png_write.close()
  23. def findFile(f):
  24. fsinfo = os.listdir(f)
  25. for fn in fsinfo:
  26. temp_path = os.path.join(f, fn)
  27. if not os.path.isdir(temp_path):
  28. print('文件路径: {}' .format(temp_path))
  29. print(fn)
  30. imageDecode(temp_path,fn)
  31. else:
  32. ...
  33. if __name__ == "__main__":
  34. findFile(path)