From 029403e8ae0cf52589e193d99699c1ad2314379d Mon Sep 17 00:00:00 2001 From: Suxue Date: Sat, 23 Dec 2023 00:07:43 +0800 Subject: [PATCH] =?UTF-8?q?v0.9.6.3=20Release=EF=BC=81=201.=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=BC=95=E7=94=A8=E6=B6=88=E6=81=AF=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E3=80=82=202.=E8=AF=8D=E4=BA=91=E5=88=86=E8=AF=8D=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E6=97=B6=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Export/HtmlExport.cs | 54 +++++++++++++++++++++++++++++++++++++++++ Pages/Workspace.xaml.cs | 26 ++++++++++++++------ README.md | 11 ++++++--- WechatBakTool.csproj | 6 ++--- 4 files changed, 82 insertions(+), 15 deletions(-) diff --git a/Export/HtmlExport.cs b/Export/HtmlExport.cs index c1b755b..16a21f2 100644 --- a/Export/HtmlExport.cs +++ b/Export/HtmlExport.cs @@ -186,6 +186,60 @@ public void SetMsg(WXUserReader reader, WXContact contact,WorkspaceViewModel vie } } } + else if (msg.SubType == 57) + { + using (var decoder = LZ4Decoder.Create(true, 64)) + { + byte[] target = new byte[10240]; + int res = 0; + if (msg.CompressContent != null) + res = LZ4Codec.Decode(msg.CompressContent, 0, msg.CompressContent.Length, target, 0, target.Length); + + byte[] data = target.Skip(0).Take(res).ToArray(); + string xml = Encoding.UTF8.GetString(data); + if (!string.IsNullOrEmpty(xml)) + { + xml = xml.Replace("\n", ""); + XmlDocument xmlObj = new XmlDocument(); + xmlObj.LoadXml(xml); + if (xmlObj.DocumentElement != null) + { + string title = ""; + XmlNodeList? findNode = xmlObj.DocumentElement.SelectNodes("/msg/appmsg/title"); + if (findNode != null) + { + if (findNode.Count > 0) + { + title = findNode[0]!.InnerText; + } + } + + HtmlBody += string.Format("

{0}

", title); + + XmlNode? type = xmlObj.DocumentElement.SelectSingleNode("/msg/appmsg/refermsg/type"); + if(type != null) + { + XmlNode? source = xmlObj.DocumentElement.SelectSingleNode("/msg/appmsg/refermsg/displayname"); + XmlNode? text = xmlObj.DocumentElement.SelectSingleNode("/msg/appmsg/refermsg/content"); + if(type.InnerText == "1" && source != null && text != null) + { + HtmlBody += string.Format("

[引用]{0}:{1}

", source.InnerText, text.InnerText); + } + else if(type.InnerText != "1" && source != null && text != null) + { + HtmlBody += string.Format("

[引用]{0}:非文本消息类型-{1}

", source.InnerText, type); + } + else + { + HtmlBody += string.Format("

未知的引用消息

"); + } + } + + + } + } + } + } else { using (var decoder = LZ4Decoder.Create(true, 64)) diff --git a/Pages/Workspace.xaml.cs b/Pages/Workspace.xaml.cs index 29f7585..d9f006b 100644 --- a/Pages/Workspace.xaml.cs +++ b/Pages/Workspace.xaml.cs @@ -164,20 +164,30 @@ private void Export_Click(object sender, RoutedEventArgs e) var jieba = new JiebaSegmenter(); Counter counter = new Counter(); - ViewModel.ExportCount = "词频统计ing..."; - List? msgs = UserReader.GetWXMsgs(ViewModel.WXContact.UserName); - if(msgs!= null) + try { - foreach(WXMsg msg in msgs) + ViewModel.ExportCount = "词频统计ing..."; + List? msgs = UserReader.GetWXMsgs(ViewModel.WXContact.UserName); + if (msgs != null) { - if(msg.Type == 1) + foreach (WXMsg msg in msgs) { - List list = jieba.Cut(msg.StrContent).ToList(); - counter.Add(list); + if (msg.Type == 1) + { + List list = jieba.Cut(msg.StrContent).ToList(); + counter.Add(list); + } + } - } } + catch + { + ViewModel.ExportCount = "异常"; + MessageBox.Show("词频统计发生异常,请检查字典文件是否存在", "错误"); + return; + } + var orderBy = counter.MostCommon(); ViewModel.ExportCount = "移除部分词语..."; string[] remove_string_list = setting.RemoveKey.Split(","); diff --git a/README.md b/README.md index f18b1de..b3b39d2 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ - [x] 群聊 - [x] 系统消息 - [x] 文件 +- [x] 引用/转发消息 - [x] 表情(需要预下载) 如果有什么好的建议或意见,或者遇到什么问题,欢迎提issue,看到会回。 @@ -24,10 +25,11 @@
### 免责声明 -**本项目仅供学习使用,严禁商业使用**
+**本项目仅供学习、研究使用,严禁商业使用**
+**用于网络安全用途的,请确保在国家法律法规下使用**
**本项目完全免费,问你要钱的都是骗子**
**使用本项目初衷是作者研究微信数据库的运行使用,您使用本软件导致的后果,包含但不限于数据损坏,记录丢失等问题,作者不承担相关责任。**
-**因软件特殊性质,请在使用时获得微信账号所有人授权。**
+**因软件特殊性质,请在使用时获得微信账号所有人授权,你应当确保不侵犯他人个人隐私权,后果自行承担**

### 隐私声明 @@ -44,6 +46,7 @@ C# + .NET6.0 + WPF
- [ ] 性能优化 - [ ] 打包资源文件夹 - [ ] 手动模式(合适离线分析) +- [ ] 年度报告类分析(等美术资源中,没有资源不做)
### 部分问题 @@ -58,8 +61,7 @@ A:基本上都是因为刚迁移完,缓存没写入到数据库导致的,
### 使用说明 -**本说明为新版本说明,即将发版**
-0.安装.NET Desktop Runtime(如已经安装忽略)
+0.安装.NET Desktop Runtime(注意是6.0版本的Desktop Runtime,如已经安装忽略)
1.打开微信,并登录。
2.在软件左侧下方点击**新建工作区**,
3.在**新建工作区界面**,选择要创建工作区的微信进程,并**确认下方微信号是否正确**
@@ -77,6 +79,7 @@ A:基本上都是因为刚迁移完,缓存没写入到数据库导致的, 4. 解密微信图片 [吾爱破解chenhahacjl/微信 DAT 图片解密 (C#)](https://www.52pojie.cn/forum.php?mod=viewthread&tid=1507922) 5. 参考了句柄名称实现,注意获取句柄别看这里,#10 这个issue就是血泪 [huiyadanli/RevokeMsgPatcher](https://github.com/huiyadanli/RevokeMsgPatcher) 6. 参考了句柄获取 [FuzzySecurity/Sharp-Suite](https://github.com/FuzzySecurity/Sharp-Suite) +7. 这个获取秘钥更通用一些 [SnowMeteors/GetWeChatKey](https://github.com/SnowMeteors/GetWeChatKey) ,用户名不是很稳定 ### 其他声明 [1] 理论支持所有64位版本指用户名推断和公钥头推断,地址直接获取方式需要version.json支持,更新不是很及时。 diff --git a/WechatBakTool.csproj b/WechatBakTool.csproj index 1bf7674..36a7b29 100644 --- a/WechatBakTool.csproj +++ b/WechatBakTool.csproj @@ -6,9 +6,9 @@ enable true True - 0.9.6.2 - 0.9.6.2 - 0.9.6.2 + 0.9.6.3 + 0.9.6.3 + 0.9.6.3