1、定位pc微信图片的保存路径。

2、打开文件夹。

3、编写程序查看dat加密图片。(通用函数,感谢编写其中一些函数的网友)

usesWinapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,Vcl.StdCtrls,system.strutils, Vcl.ExtCtrls,system.contnrs,vcl.imaging.jpeg;

function CalcMagicCode(const AHeadCode: Word; var AMagicCode: Word; var AFileExt: string): Boolean;// 计算xor的差值以及图片类型
constC_TypeCodeArr: array of Word = [$4D42, $D8FF, $4947, $5089];C_TypeExtArr: array of string = ['.bmp', '.jpeg', '.gif', '.png'];
varI: Integer;LByte1, LByte2: Byte;LMagicCode: Word;
beginResult := False;LByte1 := Byte(AHeadCode);LByte2 := HiByte(AHeadCode);for I := Low(C_TypeCodeArr) to High(C_TypeCodeArr) dobeginLMagicCode := Byte(C_TypeCodeArr[I]) xor LByte1;if LMagicCode = (HiByte(C_TypeCodeArr[I]) xor LByte2) thenbeginAMagicCode := LMagicCode;AFileExt := C_TypeExtArr[I];Result := True;end;end;
end;procedure MakeFileList(const Path, FileExt: string; AFileList: TStrings);
varsch: TSearchRec;tmpPath: string;
beginif RightStr(Trim(Path), 1) <> '\' thentmpPath := Trim(Path) + '\'elsetmpPath := Trim(Path);if not DirectoryExists(tmpPath) thenExit;if FindFirst(tmpPath + '*', faAnyFile, sch) = 0 thenbeginrepeatif ((sch.Name = '.') or (sch.Name = '..')) thenContinue;if (UpperCase(ExtractFileExt(tmpPath + sch.Name)) = UpperCase(FileExt)) or (FileExt = '.*') thenAFileList.Add(tmpPath + sch.Name);until FindNext(sch) <> 0;System.SysUtils.FindClose(sch);end;
end;
procedure DecryptWXImgFile(const ASrcFile, ASavePath: string);//位异或流文件保存为jpg文件
varLSrcStream: TMemoryStream;LDesStream: TFileStream;LFilesize, LPos: Integer;LBuffer: Word;LSrcByte, LDesByte: Byte;LMagicCode: Word;LFileExt, LFileName: string;
beginLSrcStream := TMemoryStream.Create;tryLSrcStream.LoadFromFile(ASrcFile);LSrcStream.Position := 0;LSrcStream.ReadBuffer(LBuffer, 2);if CalcMagicCode(LBuffer, LMagicCode, LFileExt) thenbeginLFileName := ASavePath + ChangeFileExt(ExtractFileName(ASrcFile), LFileExt);LDesStream := TFileStream.Create(LFileName, fmCreate);tryLPos := 0;LFilesize := LSrcStream.Size;while LPos < LFilesize dobeginLSrcStream.Position := LPos;LSrcStream.ReadBuffer(LSrcByte, 1);LDesByte := LSrcByte xor LMagicCode;LDesStream.WriteBuffer(LDesByte, 1);Inc(LPos);end;finallyLDesStream.Free;end;end;finallyLSrcStream.Free;end;
end;
Function ExtractFileNameNoExt(FileString: String): String;//从完整路径中获得不含后缀名的文件名
VarFileWithExtString: String;FileExtString: String;LenExt: Integer;LenNameWithExt: Integer;
BeginFileWithExtString := ExtractFileName(FileString);LenNameWithExt    := Length(FileWithExtString);  FileExtString     := ExtractFileExt(FileString);   LenExt            := Length(FileExtString);If LenExt = 0 ThenBeginResult := FileWithExtString;EndElseBeginResult := Copy(FileWithExtString,1,(LenNameWithExt-LenExt));End;End;
procedure TForm1.SearchFile(path: PChar; fileExt: string; fileList: TStringList);//遍历指定文件夹文件
varsearchRec: TSearchRec;found: Integer;tmpStr: string;curDir: string;dirs: TQueue;pszDir: PChar;
begindirs := TQueue.Create; //创建目录队列dirs.Push(path); //将起始搜索路径入队pszDir := dirs.Pop;curDir := StrPas(pszDir); //出队{开始遍历,直至队列为空(即没有目录需要遍历)}while (True) dobegin//加上搜索后缀,得到类似'c:\*.*' 、'c:\windows\*.*'的搜索路径tmpStr := curDir + '\*.*';//在当前目录查找第一个文件、子目录found := FindFirst(tmpStr, faAnyFile, searchRec);while found = 0 do //找到了一个文件或目录后begin//如果找到的是个目录if (searchRec.Attr and faDirectory) <> 0 thenbegin{在搜索非根目录(C:\、D:\)下的子目录时会出现'.','..'的"虚拟目录"大概是表示上层目录和下层目录吧。。。要过滤掉才可以}if (searchRec.Name <> '.') and (searchRec.Name <> '..') thenbegin{由于查找到的子目录只有个目录名,所以要添上上层目录的路径searchRec.Name = 'Windows';tmpStr:='c:\Windows';加个断点就一清二楚了}tmpStr := curDir + '\' + searchRec.Name;{将搜索到的目录入队。让它先晾着。因为TQueue里面的数据只能是指针,所以要把string转换为PChar同时使用StrNew函数重新申请一个空间存入数据,否则会使已经进入队列的指针指向不存在或不正确的数据(tmpStr是局部变量)。}dirs.Push(StrNew(PChar(tmpStr)));end;endelse //如果找到的是个文件begin{Result记录着搜索到的文件数。可是我是用CreateThread创建线程来调用函数的,不知道怎么得到这个返回值。。。我不想用全局变量}//把找到的文件加到Memo控件if fileExt = '.*' thenfileList.Add(curDir + '\' + searchRec.Name)elsebeginif SameText(RightStr(curDir + '\' + searchRec.Name, Length(fileExt)), fileExt) thenfileList.Add(curDir + '\' + searchRec.Name);end;end;//查找下一个文件或目录found := FindNext(searchRec);end;{当前目录找到后,如果队列中没有数据,则表示全部找到了;否则就是还有子目录未查找,取一个出来继续查找。}if dirs.Count > 0 thenbeginpszDir := dirs.Pop;curDir := StrPas(pszDir);StrDispose(pszDir);endelsebreak;end;//释放资源dirs.Free;FindClose(searchRec);
end;

遍历指定文件夹。

procedure TForm1.Button2Click(Sender: TObject);
vartmpstr: TStringList;icount: integer;
begintrytmpstr := tstringlist.Create;SearchFile(PChar(Edit1.Text), edtext.Text, tmpstr);for icount := 0 to tmpstr.Count - 1 dobeginlistbox1.items.Add(tmpstr.Strings[icount])end;finallytmpstr.Free;end;end;

点击选中的 dat解码。

procedure TForm1.ListBox1Click(Sender: TObject);
vartmpstr:string;
begintmpstr:= self.ListBox1.Items[Self.ListBox1.ItemIndex];DecryptWXImgFile(tmpstr,'D:\weixinchehuizhaopian\output\images\');Sleep(2000);if FileExists('D:\weixinchehuizhaopian\output\images\'+ExtractFileNameNoExt(self.ListBox1.Items[Self.ListBox1.ItemIndex])+'.jpg') thenImage1.Picture.LoadFromFile( 'D:\weixinchehuizhaopian\output\images\'+ExtractFileNameNoExt(self.ListBox1.Items[Self.ListBox1.ItemIndex])+'.jpg');end;

结果。

查看微信中撤回的图片(RIO)相关推荐

  1. python中怎么撤回_python如何查看微信消息撤回

    本文为大家分享了python查看微信消息撤回的具体代码,供大家参考,具体内容如下 1.安装itchat itchat是一个开源的python微信库,支持发送消息.图片.视频.地图.名片.文件等,还可以 ...

  2. python查看微信撤回消息_python如何查看微信消息撤回

    本文为大家分享了python查看微信消息撤回的具体代码,供大家参考,具体内容如下 1.安装itchat itchat是一个开源的python微信库,支持发送消息.图片.视频.地图.名片.文件等,还可以 ...

  3. python如何撤销_python如何查看微信消息撤回

    本文为大家分享了python查看微信消息撤回的具体代码,供大家参考,具体内容如下 1.安装itchat itchat是一个开源的python微信库,支持发送消息.图片.视频.地图.名片.文件等,还可以 ...

  4. python如何撤回_python如何查看微信消息撤回

    本文为大家分享了python查看微信消息撤回的具体代码,供大家参考,具体内容如下 1.安装itchat itchat是一个开源的python微信库,支持发送消息.图片.视频.地图.名片.文件等,还可以 ...

  5. 利用Python查看微信好友撤回的消息

    效果图如下: 不仅可以查看微信好友撤回的文字消息,如位置.视频.音频.图片等等都可以查看. 直接上源代码: # Python查看微信撤回消息 import re import os import ti ...

  6. python查看微信撤回消息_想查看微信好友撤回的消息?Python帮你搞定

    要说微信最让人恶心的发明,消息撤回绝对能上榜. 比如你现在正和女朋友用微信聊着天,或者跟自己喜欢的女孩子聊着天,一个不留神,你没注意到对方发的消息就被她及时撤回了,这时你很好奇,好奇她到底发了什么?于 ...

  7. python查看微信消息撤回

    准备环境 python语言环境 python解释器-pycharm itchat介绍 itchat是一个开源的微信个人号接口,通过itchat可以实现微信(好友或微信群)的信息处理,包括文本.图片.小 ...

  8. python实现查看微信消息撤回

    娱乐(windows系统) 1.安装itchat itchat是一个开源的python微信库,支持发送消息.图片.视频.地图.名片.文件等,还可以实现自动回复等多种功能. 看到的一个文档还不错 htt ...

  9. 如何用Python查看微信好友撤回的消息?

    首先声明,本文主要就是在试图复现这篇文档中所说的: https://cloud.tencent.com/developer/article/1701130 因此要是下文中有什么讲的不清楚的地方,大家也 ...

最新文章

  1. 【手撸RPC框架】SpringBoot+Netty4实现RPC框架
  2. python web开发环境_Flask_Web 开发环境搭建
  3. python括号的区别_Python中类-带括号与不带括号的区别
  4. Blazor带我重玩前端(一)
  5. 英语作业(general version an narrow version about sth)
  6. python安装mysqldb模块,如何使用pip安装Python MySQLdb模块?
  7. osx mount nfs/smb
  8. 输入n个学生的成绩c语言,c语言帮忙改错!输入n个学生的成绩信息,按照每个学生的个人平均成绩从高到低输出他们的信息...
  9. 【洛谷题解】P1042 [NOIP2003 普及组] 乒乓球
  10. 电脑“开始-运行”的常用命令及用法!很有用!
  11. http域名跳转到https域名
  12. 如何判断和删除Orphaned site collections?
  13. 中国大陆开源(Linux)镜像站汇总
  14. 程序员生存定律-打造属于自己的稀缺性
  15. Windows10系统错误码0xc0000142怎么修复?
  16. IOS版aplayer使用教程_享声数播APP使用指南【ios版】
  17. jmeter之请求数据参数化
  18. linux BC命令行计算器
  19. 计算机应用基础试题及参考答案
  20. Express Invoice Plus for Mac是什么软件?Mac发票管理软件推荐!

热门文章

  1. 博途TIA Portal V15 下载与安装教程
  2. 学渣的刷题之旅 leetcode刷题 66. 加一
  3. 转:Cookie MappingRTB,SSP,DSP,Ad Exchange
  4. 更新升级windows11提示“该电脑必须支持安全启动
  5. 市面上微型计算机的主频,目前市面上最大屏幕的手机,你知道是哪款吗?
  6. 垃圾分类机器人、无线电子皮肤、孟加拉转基因金稻...| 技术前沿洞察
  7. oracle 10g 新特性中文笔记(第五章)
  8. java自动发图文微博_使用node搭建自动发图文微博机器人的方法
  9. mysql partition 语法,MySQL与瀚高数据库的范围分区的语法及实例(APP)
  10. 【Hexo】记录NexT主题美化及域名配置(图示详解)