From 52aab2b8a07d94757424298654dccc3ccbb6e9b7 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Wed, 29 Nov 2023 21:05:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BC=82=E6=80=A7wxid?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B7=AF=E5=BE=84=E8=87=AA=E5=8A=A8=E8=8E=B7?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/wx_info/get_wx_info.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pywxdump/wx_info/get_wx_info.py b/pywxdump/wx_info/get_wx_info.py index 4430979..4c982a8 100644 --- a/pywxdump/wx_info/get_wx_info.py +++ b/pywxdump/wx_info/get_wx_info.py @@ -8,9 +8,7 @@ import json import ctypes import os -import re import winreg - import pymem from win32com.client import Dispatch import psutil @@ -71,7 +69,7 @@ def get_info_wxid(h_process): return wxid -def get_info_filePath(wxid): +def get_info_filePath(wxid="all"): if not wxid: return "None" try: @@ -88,10 +86,11 @@ def get_info_filePath(wxid): else: msg_dir = os.path.join(w_dir, "WeChat Files") + if wxid == "all" and os.path.exists(msg_dir): + return msg_dir + filePath = os.path.join(msg_dir, wxid) - if not os.path.exists(filePath): - return "None" - return filePath + return filePath if os.path.exists(filePath) else "None" # 读取内存中的key