1234567891011121314151617181920212223242526272829303132333435363738 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- '''
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2019/08/13 11:21:00
- @Version : 1.0
- @License : (C)Copyright 2019 liuyuqi
- @Desc : 微信data数据解析
- '''
- import os
- out_path=r"D:/photo/"
- path = r'C:/Users/xx/AppData/Local/Packages/TencentWeChatLimited.forWindows10_sdtnhv12zgd7a/LocalCache/Roaming/Tencent/WeChatAppStore/WeChatAppStore Files/ab3255/Data/'
- def imageDecode(f,fn):
- dat_read = open(f, "rb")
- out=out_path+fn+".png"
- png_write = open(out, "wb")
- for now in dat_read:
- for nowByte in now:
- newByte = nowByte ^ 0xAB
- png_write.write(bytes([newByte]))
- dat_read.close()
- png_write.close()
-
- def findFile(f):
- fsinfo = os.listdir(f)
- for fn in fsinfo:
- temp_path = os.path.join(f, fn)
- if not os.path.isdir(temp_path):
- print('文件路径: {}' .format(temp_path))
- print(fn)
- imageDecode(temp_path,fn)
- else:
- ...
- if __name__ == "__main__":
- findFile(path)
|