From 705b4937701ca89c4baa7814c1575cb5d7b98187 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 16 Jul 2024 08:46:22 +0800 Subject: [PATCH] =?UTF-8?q?fix=20real=20time=20msg=20=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/wx_info/merge_db.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pywxdump/wx_info/merge_db.py b/pywxdump/wx_info/merge_db.py index a6095a1..dde92ce 100644 --- a/pywxdump/wx_info/merge_db.py +++ b/pywxdump/wx_info/merge_db.py @@ -301,7 +301,7 @@ def merge_db(db_paths, save_path="merge.db", CreateTime: int = 0, endCreateTime: def decrypt_merge(wx_path, key, outpath="", CreateTime: int = 0, endCreateTime: int = 0, db_type: List[str] = []) -> ( -bool, str): + bool, str): """ 解密合并数据库 msg.db, microMsg.db, media.db,注意:会删除原数据库 :param wx_path: 微信路径 eg: C:\*******\WeChat Files\wxid_********* @@ -395,7 +395,9 @@ def merge_real_time_db(key, db_path: str, merge_path: str, CreateTime: int = 0, out_path = "tmp_" + ''.join( random.choices('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=6)) + ".db" merge_path_base = os.path.dirname(merge_path) # 合并后的数据库路径 - out_path = os.path.join(merge_path_base, out_path) + # 设置工作目录 + os.chdir(merge_path_base) + # out_path = os.path.join(merge_path_base, out_path) if os.path.exists(out_path): os.remove(out_path) @@ -411,7 +413,7 @@ def merge_real_time_db(key, db_path: str, merge_path: str, CreateTime: int = 0, # 调用cmd命令 cmd = f"{real_time_exe_path} \"{key}\" \"{db_path}\" \"{out_path}\" {CreateTime} {endCreateTime}" # os.system(cmd) - p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=merge_path_base, creationflags=subprocess.CREATE_NO_WINDOW) p.communicate()