每人的加密字段不一样,我的是0x9D;
使用十六进制文档阅读器打开,与jpg格式的图片做异或得到自己的加密值;
import os
out_path=r"D:/image"
index = 1
def imageDecode(f,fn):
global index
dat_read = open(f, "rb")
# out='P:\\'+fn+".png"
out="d:/image/"+str(index)+".png"
png_write = open(out, "wb")
print (index, f)
index += 1
for now in dat_read:
for nowByte in now:
newByte = nowByte ^ 0x9D
png_write.write(bytes([newByte]))
dat_read.close()
png_write.close()
def findFile(f):
fsinfo = os.listdir(f)
# print(len(fsinfo))
# print(f)
for fn in fsinfo:
temp_path = os.path.join(f, fn)
if not os.path.isdir(temp_path):
imageDecode(temp_path,fn)
else:
pass
# path = r'C:\Users\输入自己微信存储路径\Data'
# findFile(path)
path = r'C:\Users\user\Documents\WeChat Files\wxid_1lydoi6o3hwv22\FileStorage\Image\2019-0{}'
for i in range(2,6):
findFile(path.format(str(i)))