Kaynağa Gözat

v0.9.5.0 Release!
1.修复查询微信时,可能出现假死的问题。
2.修复导出HTML时,Emoji异常导致导出线程退出的问题。
3.更换了图片解密算法,修复部分情况下不能正常导出图片的问题
4.新增公钥头推断Key

Suxue 1 yıl önce
ebeveyn
işleme
db79e51305

+ 89 - 89
Helpers/DecryptionHelper.cs

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Reflection.PortableExecutable;
 using System.Security.Cryptography;
 using System.Text;
 using System.Text.Json.Serialization;
@@ -25,7 +26,7 @@ namespace WechatBakTool.Helpers
         const int DEFAULT_ITER = 64000;
         const int DEFAULT_PAGESIZE = 4096; //4048数据 + 16IV + 20 HMAC + 12
         const string SQLITE_HEADER = "SQLite format 3";
-        public static byte[]? GetWechatKey(string pid, bool mem_find_key, string account)
+        public static byte[]? GetWechatKey(string pid, int find_key_type, string account)
         {
             Process process = Process.GetProcessById(int.Parse(pid));
             ProcessModule? module = ProcessHelper.FindProcessModule(process.Id, "WeChatWin.dll");
@@ -39,9 +40,7 @@ namespace WechatBakTool.Helpers
                 return null;
             }
 
-
-
-            if (!mem_find_key)
+            if (find_key_type == 1)
             {
                 List<VersionInfo>? info = null;
                 string json = File.ReadAllText("version.json");
@@ -68,29 +67,79 @@ namespace WechatBakTool.Helpers
                     }
                 }
             }
-            else
+            else if(find_key_type == 2)
             {
                 List<int> read = ProcessHelper.FindProcessMemory(process.Handle, module, account);
                 if (read.Count >= 2)
                 {
                     byte[] buffer = new byte[8];
                     int key_offset = read[1] - 64;
-                    if (ProcessHelper.ReadProcessMemory(process.Handle, module.BaseAddress + key_offset, buffer, buffer.Length, out _))
+                    if (NativeAPI.ReadProcessMemory(process.Handle, module.BaseAddress + key_offset, buffer, buffer.Length, out _))
                     {
                         ulong addr = BitConverter.ToUInt64(buffer, 0);
 
                         byte[] key_bytes = new byte[32];
-                        if (ProcessHelper.ReadProcessMemory(process.Handle, (IntPtr)addr, key_bytes, key_bytes.Length, out _))
+                        if (NativeAPI.ReadProcessMemory(process.Handle, (IntPtr)addr, key_bytes, key_bytes.Length, out _))
                         {
                             return key_bytes;
                         }
                     }
                 }
+            }
+            else if (find_key_type == 3)
+            {
+                string searchString = "-----BEGIN PUBLIC KEY-----";
+                List<long> addr = NativeAPIHelper.SearchProcessAllMemory(process, searchString);
+                if (addr.Count > 0)
+                {
+                    foreach (long a in addr)
+                    {
+                        byte[] buffer = new byte[module.ModuleMemorySize];
+                        byte[] search = BitConverter.GetBytes(a);
+                        Array.Resize(ref search, 8);
+                        int read = 0;
+
+                        List<int> offset = new List<int>();
+                        if (NativeAPI.ReadProcessMemory(process.Handle, module.BaseAddress, buffer, buffer.Length, out read))
+                        {
+                            for (int i = 0; i < buffer.Length - 8; i++)
+                            {
+                                if (buffer[i] == search[0])
+                                {
+                                    for (int s = 1; s < search.Length; s++)
+                                    {
+                                        if (buffer[i + s] != search[s])
+                                            break;
+                                        if (s == search.Length - 1)
+                                        {
+                                            long iii = (long)module.BaseAddress + i - 0xd8;
+
+                                            byte[] key = new byte[8];
+                                            if (NativeAPI.ReadProcessMemory(process.Handle, new IntPtr(iii), key, key.Length, out _))
+                                            {
+                                                ulong key_addr = BitConverter.ToUInt64(key, 0);
+
+                                                byte[] key_bytes = new byte[32];
+                                                NativeAPI.ReadProcessMemory(process.Handle, (IntPtr)key_addr, key_bytes, key_bytes.Length, out _);
+                                                string key1 = BitConverter.ToString(key_bytes, 0);
+                                                return key_bytes;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
                 else
                 {
                     throw new Exception("搜索不到微信账号,请确认用户名是否正确,如错误请重新新建工作区,务必确认账号是否正确");
                 }
             }
+            else if (find_key_type == 3)
+            {
+                string searchString = "-----BEGIN PUBLIC KEY-----";
+            }
             return null;
         }
 
@@ -179,99 +228,50 @@ namespace WechatBakTool.Helpers
         {
             return BitConverter.ToString(bytes, 0).Replace("-", string.Empty).ToLower().ToUpper();
         }
+
+        private static List<byte[]> ImgHeader = new List<byte[]>()
+        {
+            new byte[] { 0xFF, 0xD8 },//JPG
+            new byte[] { 0x89, 0x50 },//PNG
+            new byte[] { 0x42, 0x4D },//BMP
+            new byte[] { 0x47, 0x49 },//GIF
+            new byte[] { 0x49, 0x49 },//TIF
+            new byte[] { 0x4D, 0x4D },//TIF
+        };
         public static byte[] DecImage(string source)
         {
             //读取数据
             byte[] fileBytes = File.ReadAllBytes(source);
             //算差异转换
-            byte key = GetImgKey(fileBytes);
-            fileBytes = ConvertData(fileBytes, key);
-            return fileBytes;
-        }
-        public static string CheckFileType(byte[] data)
-        {
-            switch (data[0])
-            {
-                case 0XFF:  //byte[] jpg = new byte[] { 0xFF, 0xD8, 0xFF };
-                    {
-                        if (data[1] == 0xD8 && data[2] == 0xFF)
-                        {
-                            return ".jpg";
-                        }
-                        break;
-                    }
-                case 0x89:  //byte[] png = new byte[] { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A };
-                    {
-                        if (data[1] == 0x50 && data[2] == 0x4E && data[7] == 0x0A)
-                        {
-                            return ".png";
-                        }
-                        break;
-                    }
-                case 0x42:  //byte[] bmp = new byte[] { 0x42, 0x4D };
-                    {
-                        if (data[1] == 0X4D)
-                        {
-                            return ".bmp";
-                        }
-                        break;
-                    }
-                case 0x47:  //byte[] gif = new byte[] { 0x47, 0x49, 0x46, 0x38, 0x39(0x37), 0x61 };
-                    {
-                        if (data[1] == 0x49 && data[2] == 0x46 && data[3] == 0x38 && data[5] == 0x61)
-                        {
-                            return ".gif";
-                        }
-                        break;
-                    }
-                case 0x49:  // byte[] tif = new byte[] { 0x49, 0x49, 0x2A, 0x00 };
-                    {
-                        if (data[1] == 0x49 && data[2] == 0x2A && data[3] == 0x00)
-                        {
-                            return ".tif";
-                        }
-                        break;
-                    }
-                case 0x4D:  //byte[] tif = new byte[] { 0x4D, 0x4D, 0x2A, 0x00 };
-                    {
-                        if (data[1] == 0x4D && data[2] == 0x2A && data[3] == 0x00)
-                        {
-                            return ".tif";
-                        }
-                        break;
-                    }
-            }
-
-            return ".dat";
-        }
-        private static byte GetImgKey(byte[] fileRaw)
-        {
-            byte[] raw = new byte[8];
-            for (int i = 0; i < 8; i++)
-            {
-                raw[i] = fileRaw[i];
-            }
-
-            for (byte key = 0x01; key < 0xFF; key++)
+            foreach (byte[] b in ImgHeader)
             {
-                byte[] buf = new byte[8];
-                raw.CopyTo(buf, 0);
-
-                if (CheckFileType(ConvertData(buf, key)) != ".dat")
+                byte t = (byte)(fileBytes[0] ^ b[0]);
+                byte[] decData = fileBytes.Select(b => (byte)(b ^ t)).ToArray();
+                if (b[1] != decData[1])
+                    continue;
+                else
                 {
-                    return key;
+                    return decData;
                 }
             }
-            return 0x00;
+            return new byte[0];
         }
-        private static byte[] ConvertData(byte[] data, byte key)
+        public static string CheckFileType(byte[] data)
         {
-            for (int i = 0; i < data.Length; i++)
-            {
-                data[i] ^= key;
-            }
-
-            return data;
+            if (data[0] == 0xFF && data[1] == 0xD8)
+                return ".jpg";
+            else if (data[0] == 0x89 && data[1] == 0x50)
+                return ".png";
+            else if (data[0] == 0x42 && data[1] == 0X4D)
+                return ".bmp";
+            else if (data[0] == 0x47 && data[1] == 0x49)
+                return ".gif";
+            else if (data[0] == 0x49 && data[1] == 0x49)
+                return ".tif";
+            else if (data[0] == 0x4D && data[1] == 0x4D)
+                return ".tif";
+            else
+                return ".dat";
         }
         public static string SaveDecImage(byte[] fileRaw,string source,string to_dir,string type)
         {

+ 27 - 0
Helpers/NativeAPI.cs

@@ -12,6 +12,12 @@ namespace WechatBakTool.Helpers
         internal static uint NTSTATUS_STATUS_INFO_LENGTH_MISMATCH = 0xC0000004;
         internal static uint NTSTATUS_STATUS_ACCESS_DENIED = 0xC0000022;
 
+        internal static uint MEM_COMMIT = 0x1000;
+        internal static uint PAGE_READONLY = 0x02;
+        internal static uint PAGE_READWRITE = 0x04;
+        internal static uint PAGE_EXECUTE = 0x10;
+        internal static uint PAGE_EXECUTE_READ = 0x20;
+
         // API Constants
         internal static uint SystemExtendedHandleInformation = 0x40;
         internal static uint DUPLICATE_SAME_ACCESS = 0x2;
@@ -115,6 +121,20 @@ namespace WechatBakTool.Helpers
             public uint Reserved;
         }
 
+
+        public struct MEMORY_BASIC_INFORMATION64
+        {
+            public IntPtr BaseAddress;
+            public IntPtr AllocationBase;
+            public uint AllocationProtect;
+            public uint __alignment1;
+            public ulong RegionSize;
+            public uint State;
+            public uint Protect;
+            public uint Type;
+            public uint __alignment2;
+        }
+
         // Enums
         //=================================================
 
@@ -208,5 +228,12 @@ namespace WechatBakTool.Helpers
 
         [DllImport("kernel32.dll")]
         internal static extern IntPtr GetCurrentProcess();
+
+        [DllImport("kernel32.dll")]
+        internal static extern int VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress, out MEMORY_BASIC_INFORMATION64 lpBuffer, uint dwLength);
+
+        [DllImport("kernel32.dll", SetLastError = true)]
+        internal static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int nSize, out int lpNumberOfBytesRead);
+
     }
 }

+ 57 - 8
Helpers/NativeAPIHelper.cs

@@ -48,17 +48,19 @@ namespace WechatBakTool.Helpers
                 uint nLength = 0;
                 hObjectName = AllocManagedMemory(256 * 1024);
 
-                // 查询句柄名称
-                while (NtQueryObject(ipHandle, OBJECT_INFORMATION_CLASS.ObjectNameInformation, hObjectName, nLength, ref nLength) == NTSTATUS_STATUS_INFO_LENGTH_MISMATCH)
+                Task.Run(() =>
                 {
-                    FreeManagedMemory(hObjectName);
-                    if (nLength == 0)
+                    // 查询句柄名称
+                    while (NtQueryObject(ipHandle, OBJECT_INFORMATION_CLASS.ObjectNameInformation, hObjectName, nLength, ref nLength) == NTSTATUS_STATUS_INFO_LENGTH_MISMATCH)
                     {
-                        Console.WriteLine("Length returned at zero!");
-                        return "";
+                        FreeManagedMemory(hObjectName);
+                        if (nLength == 0)
+                        {
+                            Console.WriteLine("Length returned at zero!");
+                        }
+                        hObjectName = AllocManagedMemory(nLength);
                     }
-                    hObjectName = AllocManagedMemory(nLength);
-                }
+                }).Wait(100);
                 OBJECT_NAME_INFORMATION? objObjectName = new OBJECT_NAME_INFORMATION();
                 objObjectName = Marshal.PtrToStructure(hObjectName, objObjectName.GetType()) as OBJECT_NAME_INFORMATION?;
                 if (objObjectName == null)
@@ -147,5 +149,52 @@ namespace WechatBakTool.Helpers
             // Return list
             return ltei;
         }
+
+        public static List<long> SearchProcessAllMemory(Process process, string searchString)
+        {
+            IntPtr minAddress = IntPtr.Zero;
+            IntPtr maxAddress = IntPtr.MaxValue;
+            List<long> addrList = new List<long>();
+
+            while (minAddress.ToInt64() < maxAddress.ToInt64())
+            {
+                MEMORY_BASIC_INFORMATION64 memInfo;
+                int result = VirtualQueryEx(process.Handle, minAddress, out memInfo, (uint)Marshal.SizeOf(typeof(MEMORY_BASIC_INFORMATION64)));
+
+                if (result == 0)
+                {
+                    break;
+                }
+
+                if (memInfo.State == MEM_COMMIT && (memInfo.Protect == PAGE_EXECUTE || memInfo.Protect == PAGE_EXECUTE_READ || memInfo.Protect == PAGE_EXECUTE_READ || memInfo.Protect == PAGE_READWRITE || memInfo.Protect == PAGE_READONLY))
+                {
+                    byte[] buffer = new byte[(long)memInfo.RegionSize];
+                    bool success = ReadProcessMemory(process.Handle, memInfo.BaseAddress, buffer, buffer.Length, out _);
+
+                    if (success)
+                    {
+                        byte[] search = Encoding.ASCII.GetBytes(searchString);
+                        for (int i = 0; i < buffer.Length - 8; i++)
+                        {
+                            if (buffer[i] == search[0])
+                            {
+                                for (int s = 1; s < search.Length; s++)
+                                {
+                                    if (buffer[i + s] != search[s])
+                                        break;
+                                    if (s == search.Length - 1)
+                                    {
+                                        addrList.Add((long)memInfo.BaseAddress + i);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                minAddress = new IntPtr(memInfo.BaseAddress.ToInt64() + (long)memInfo.RegionSize);
+            }
+            return addrList;
+        }
+
     }
 }

+ 2 - 4
Helpers/ProcessHelper.cs

@@ -32,7 +32,7 @@ namespace WechatBakTool.Helpers
 
             List<int> offset = new List<int>();
             int readBytes;
-            bool success = ReadProcessMemory(processHandle, module.BaseAddress, buffer, buffer.Length,out readBytes);
+            bool success = NativeAPI.ReadProcessMemory(processHandle, module.BaseAddress, buffer, buffer.Length,out readBytes);
 
             if (!success || readBytes == 0)
             {
@@ -64,14 +64,12 @@ namespace WechatBakTool.Helpers
         {
             byte[] array = new byte[nSize];
             int readByte;
-            if (!ReadProcessMemory(hProcess, lpBaseAddress, array, nSize, out readByte))
+            if (!NativeAPI.ReadProcessMemory(hProcess, lpBaseAddress, array, nSize, out readByte))
                 return null;
             else
                 return array;
         }
 
-        [DllImport("kernel32.dll", SetLastError = true)]
-        public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int nSize, out int lpNumberOfBytesRead);
         
     }
 

+ 3 - 2
Pages/CreateWork.xaml

@@ -26,8 +26,9 @@
         <TextBox IsEnabled="{Binding IsEnable}" x:Name="txt_username" Margin="35,300,0,0" Width="280" HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="0,0,0,1" Text="{Binding UserName}" />
 
         <Label Margin="30,350,0,0" Content="请选择解密方式:" FontWeight="Bold" HorizontalAlignment="Left" VerticalAlignment="Top"/>
-        <RadioButton Margin="35,380,0,0" Content="固定地址查找" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="rb_find_key" HorizontalContentAlignment="Center" IsEnabled="{Binding IsEnable}" VerticalContentAlignment="Center" IsChecked="{Binding KeyType, Converter={StaticResource ResourceKey=getKeyConverterKey}, ConverterParameter=1}" />
-        <RadioButton Margin="35,405,0,0" Content="用户名推断查找" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="rb_find_key" HorizontalContentAlignment="Center" IsEnabled="{Binding IsEnable}" VerticalContentAlignment="Center" IsChecked="{Binding KeyType, Converter={StaticResource ResourceKey=getKeyConverterKey}, ConverterParameter=2}"/>
+        <RadioButton Margin="35,380,0,0" Content="固定地址查找【保底】" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="rb_find_key" HorizontalContentAlignment="Center" IsEnabled="{Binding IsEnable}" VerticalContentAlignment="Center" IsChecked="{Binding KeyType, Converter={StaticResource ResourceKey=getKeyConverterKey}, ConverterParameter=1}" />
+        <RadioButton Margin="35,405,0,0" Content="用户名推断查找【不稳定】" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="rb_find_key" HorizontalContentAlignment="Center" IsEnabled="{Binding IsEnable}" VerticalContentAlignment="Center" IsChecked="{Binding KeyType, Converter={StaticResource ResourceKey=getKeyConverterKey}, ConverterParameter=2}"/>
+        <RadioButton Margin="35,430,0,0" Content="公钥头推断查找【推荐】" HorizontalAlignment="Left" VerticalAlignment="Top" GroupName="rb_find_key" HorizontalContentAlignment="Center" IsEnabled="{Binding IsEnable}" VerticalContentAlignment="Center" IsChecked="{Binding KeyType, Converter={StaticResource ResourceKey=getKeyConverterKey}, ConverterParameter=3}"/>
 
         <Button Name="btn_create_worksapce" Margin="0,0,35,50" Height="60" Width="100" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="创建工作区" BorderThickness="0" IsEnabled="{Binding IsEnable}" Background="#2775b6" Foreground="White" Click="btn_create_worksapce_Click">
             <Button.Resources>

+ 15 - 6
Pages/Workspace.xaml.cs

@@ -17,6 +17,7 @@ using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using WechatBakTool.Export;
+using WechatBakTool.Helpers;
 using WechatBakTool.Model;
 using WechatBakTool.ViewModel;
 
@@ -100,12 +101,20 @@ namespace WechatBakTool.Pages
                 MessageBox.Show("请选择联系人", "错误");
                 return;
             }
-            string path = Path.Combine(Main2.CurrentUserBakConfig!.UserWorkspacePath, ViewModel.WXContact.UserName + ".txt");
-            IExport export = new TXTExport();
-            export.InitTemplate(ViewModel.WXContact, path);
-            export.SetMsg(UserReader, ViewModel.WXContact, ViewModel);
-            export.SetEnd();
-            export.Save(path);
+            try
+            {
+                string path = Path.Combine(Main2.CurrentUserBakConfig!.UserWorkspacePath, ViewModel.WXContact.UserName + ".txt");
+                IExport export = new TXTExport();
+                export.InitTemplate(ViewModel.WXContact, path);
+                export.SetMsg(UserReader, ViewModel.WXContact, ViewModel);
+                export.SetEnd();
+                export.Save(path);
+            }catch(Exception ex)
+            {
+                File.AppendAllText("1.log", ex.Message);
+                MessageBox.Show(ex.Message);
+            }
+            
             MessageBox.Show("导出完成");
         }
 

+ 9 - 7
README.md

@@ -2,7 +2,7 @@
 # WechatBakTool
 基于C#开发的微信聊天记录备份分析工具,努力做最好用的微信备份工具。
 
-- 理论支持64位版本所有微信[1]
+- 理论支持64位版本所有微信,支持两种方式非直接地址获取Key[1]
 - 工作区概念,支持多微信切换操作。
 - 支持导出Html文件,TXT文件,支持批量导出
 - 支持聊天频率分析,全消息库内容搜索
@@ -13,8 +13,8 @@
 - [x] 分享链接
 - [x] 群聊
 - [x] 系统消息
-- [ ] 文件
-- [ ] 表情
+- [x] 文件
+- [x] 表情(需要预下载)
 
 如果有什么好的建议或意见,或者遇到什么问题,欢迎提issue,看到会回。
 
@@ -27,19 +27,21 @@
 **本项目仅供学习使用,严禁商业使用**<br/>
 **本项目完全免费,问你要钱的都是骗子**<br/>
 **使用本项目初衷是作者研究微信数据库的运行使用,您使用本软件导致的后果,包含但不限于数据损坏,记录丢失等问题,作者不承担相关责任。**<br/>
-**因软件特殊性质,请在使用时获得微信账号所有人授权。**
+**因软件特殊性质,请在使用时获得微信账号所有人授权。**<br/>
 <br/>
 
 ### 隐私声明
 **本项目不会上传任何你的数据至任何第三方系统**<br/>
 **如果发生任何回传行为,请检查是否为第三方修改版本**<br/>
+<br/>
 
 ### 近期开发规划
 本项目技术栈为:
-C# + .NET6.0 + WPF MVVM(目前MVVM不是特别完全!莫喷!) <br/>
+C# + .NET6.0 + WPF <br/>
 - [x] ~~新版本UI界面开发~~
-- [ ] 完善各类消息支持
+- [x] 完善各类消息支持(已经初步完成)
 - [ ] 性能优化
+- [ ] 词云
 - [ ] 打包资源文件夹
 - [ ] 手动模式(合适离线分析)
 <br/>
@@ -74,4 +76,4 @@ A:工作区->右键->管理,就见了。<br/>
 6. 参考了句柄获取 [FuzzySecurity/Sharp-Suite](https://github.com/FuzzySecurity/Sharp-Suite)
 
 ### 其他声明
-[1] 理论支持所有64位版本指用户名推断获取Key模式,地址直接获取方式需要version.json支持,更新不是很及时。
+[1] 理论支持所有64位版本指用户名推断和公钥头推断,地址直接获取方式需要version.json支持,更新不是很及时。

+ 19 - 9
WXUserReader.cs

@@ -544,21 +544,29 @@ namespace WechatBakTool
             }
             else if (type == WXMsgType.Emoji)
             {
-                XmlDocument xmlDocument = new XmlDocument();
-                xmlDocument.LoadXml(msg.StrContent);
-                XmlNode? node = xmlDocument.SelectSingleNode("/msg/emoji");
-                if (node != null)
+                try
                 {
-                    if (node.Attributes != null)
+                    XmlDocument xmlDocument = new XmlDocument();
+                    xmlDocument.LoadXml(msg.StrContent);
+                    XmlNode? node = xmlDocument.SelectSingleNode("/msg/emoji");
+                    if (node != null)
                     {
-                        XmlNode? item = node.Attributes.GetNamedItem("md5");
-                        string md5 = item != null ? item.InnerText : "";
-                        if (EmojiCache.ContainsKey(md5))
+                        if (node.Attributes != null)
                         {
-                            path = string.Format("Emoji\\{0}.gif", md5);
+                            XmlNode? item = node.Attributes.GetNamedItem("md5");
+                            string md5 = item != null ? item.InnerText : "";
+                            if (EmojiCache.ContainsKey(md5))
+                            {
+                                path = string.Format("Emoji\\{0}.gif", md5);
+                            }
                         }
                     }
                 }
+                catch
+                {
+                    return null;
+                }
+                
             }
 
             if (path == null)
@@ -622,6 +630,8 @@ namespace WechatBakTool
                     // 图片的路径是相对路径,需要加上资源目录
                     path = Path.Combine(UserBakConfig.UserResPath, path);
                     byte[] decFileByte = DecryptionHelper.DecImage(path);
+                    if (decFileByte.Length < 2)
+                        new Exception("解密失败,可能是未支持的格式");
                     string decFiletype = DecryptionHelper.CheckFileType(decFileByte);
                     file_path = DecryptionHelper.SaveDecImage(decFileByte, path, img_dir, decFiletype);
                     break;

+ 3 - 2
WXWorkspace.cs

@@ -38,12 +38,13 @@ namespace WechatBakTool
             if (!UserBakConfig.Decrypt)
             {
                 byte[]? key = null;
-                key = DecryptionHelper.GetWechatKey(pid, type == 2, UserBakConfig.Account);
+                viewModel.LabelStatus = "正在获取秘钥,需要1 - 10秒左右";
+                key = DecryptionHelper.GetWechatKey(pid, type, UserBakConfig.Account);
                 if (key == null)
                 {
                     throw new Exception("获取到的密钥为空,获取失败");
                 }
-                string key_string = BitConverter.ToString(key, 0).Replace("-", string.Empty).ToLower().ToUpper();
+
                 string source = Path.Combine(UserBakConfig.UserWorkspacePath, "OriginalDB");
                 string to = Path.Combine(UserBakConfig.UserWorkspacePath, "DecDB");
 

+ 3 - 3
WechatBakTool.csproj

@@ -6,9 +6,9 @@
     <Nullable>enable</Nullable>
     <UseWPF>true</UseWPF>
     <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
-    <AssemblyVersion>0.9.4.0</AssemblyVersion>
-    <FileVersion>0.9.4.0</FileVersion>
-    <Version>0.9.4.0</Version>
+    <AssemblyVersion>0.9.5.0</AssemblyVersion>
+    <FileVersion>0.9.5.0</FileVersion>
+    <Version>0.9.5.0</Version>
   </PropertyGroup>
 
   <ItemGroup>