|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 huangchi 于 2019-7-31 00:04 编辑
# -*- coding: utf-8 -*-
# @Time : 3/27/2019 21:54
# @Author : MARX·CBR
# @File : 微信Dat文件转图片.py
import os
import os
out_path = r"D:\\"
def imageDecode(f, fn):
dat_read = open(f, "rb")
# out='P:\\'+fn+".png"
out = out_path + fn + ".png"
png_write = open(out, "wb")
for now in dat_read:
for nowByte in now:
newByte = nowByte ^ 0x33
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:
...
# path = r'C:\Users\输入自己微信存储路径\Data'
# findFile(path)
path = r'C:\Users\chi\Desktop'
findFile(path) |
|