From affafe324f17c64e674e6c7aca86911d7d0b8933 Mon Sep 17 00:00:00 2001 From: Suxue <446484369@qq.com> Date: Tue, 9 Jan 2024 20:49:30 +0800 Subject: [PATCH] fix bug --- Helpers/DecryptionHelper.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Helpers/DecryptionHelper.cs b/Helpers/DecryptionHelper.cs index 505f701..287c0ec 100644 --- a/Helpers/DecryptionHelper.cs +++ b/Helpers/DecryptionHelper.cs @@ -136,10 +136,6 @@ public class DecryptionHelper throw new Exception("搜索不到微信账号,请确认用户名是否正确,如错误请重新新建工作区,务必确认账号是否正确"); } } - else if (find_key_type == 3) - { - string searchString = "-----BEGIN PUBLIC KEY-----"; - } return null; } @@ -192,6 +188,7 @@ public static void DecryptDB(string file, string to_file, byte[] password_bytes) // 分页标志 var page_bytes = BitConverter.GetBytes(page_no + 1); + page_bytes = page_bytes.Take(4).ToArray(); page_bytes.CopyTo(going_to_hashed, DEFAULT_PAGESIZE - reserved - offset + IV_SIZE); var hash_mac_compute = hmac_sha1.ComputeHash(going_to_hashed, 0, going_to_hashed.Length); @@ -230,7 +227,7 @@ public static void DecryptDB(string file, string to_file, byte[] password_bytes) byte[] reserved_byte = new byte[reserved]; fileStream.Seek((page_no * DEFAULT_PAGESIZE) + DEFAULT_PAGESIZE - reserved, SeekOrigin.Begin); fileStream.Read(reserved_byte, 0, Convert.ToInt32(reserved)); - reserved_byte.CopyTo(decryped_page_bytes, DEFAULT_PAGESIZE - reserved); + reserved_byte.CopyTo(decryped_page_bytes, Convert.ToInt32(DEFAULT_PAGESIZE - reserved)); tofileStream.Write(decryped_page_bytes, 0, decryped_page_bytes.Length);