From c84fcb2cf98be8f76fea84deba53dfc77736c41c Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Wed, 3 Jan 2024 21:34:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=9A=84=E5=AE=B9=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/wx_info/decryption.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pywxdump/wx_info/decryption.py b/pywxdump/wx_info/decryption.py index b9ef967..d4436c0 100644 --- a/pywxdump/wx_info/decryption.py +++ b/pywxdump/wx_info/decryption.py @@ -45,8 +45,12 @@ def decrypt(key: str, db_path, out_path): return False, f"[-] key:'{key}' Len Error!" password = bytes.fromhex(key.strip()) - with open(db_path, "rb") as file: - blist = file.read() + + try: + with open(db_path, "rb") as file: + blist = file.read() + except Exception as e: + return False, f"[-] db_path:'{db_path}' {e}!" salt = blist[:16] byteKey = hashlib.pbkdf2_hmac("sha1", password, salt, DEFAULT_ITER, KEY_SIZE)