更新v2.3.0

This commit is contained in:
xaoyaoo 2023-12-06 13:21:16 +08:00
parent 1b8a7c7f8e
commit d01aa57633
4 changed files with 21 additions and 7 deletions

View File

@ -71,7 +71,7 @@ def load_base64_img_data(start_time, end_time, username_md5, FileStorage_path):
# 获取CreateTime的最大值日期 # 获取CreateTime的最大值日期
min_time = time.strftime("%Y-%m", time.localtime(start_time)) min_time = time.strftime("%Y-%m", time.localtime(start_time))
max_time = time.strftime("%Y-%m", time.localtime(end_time)) max_time = time.strftime("%Y-%m", time.localtime(end_time))
img_path = os.path.join(FileStorage_path, "MsgAttach", username_md5, "Image") img_path = os.path.join(FileStorage_path, "MsgAttach", username_md5, "Image") if FileStorage_path else ""
if not os.path.exists(img_path): if not os.path.exists(img_path):
return {} return {}
# print(min_time, max_time, img_path) # print(min_time, max_time, img_path)

View File

@ -99,7 +99,7 @@ class BiasAddr:
self.mobile = mobile.encode("utf-8") self.mobile = mobile.encode("utf-8")
self.name = name.encode("utf-8") self.name = name.encode("utf-8")
self.key = bytes.fromhex(key) if key else b"" self.key = bytes.fromhex(key) if key else b""
self.db_path = db_path if os.path.exists(db_path) else "" self.db_path = db_path if db_path and os.path.exists(db_path) else ""
self.process_name = "WeChat.exe" self.process_name = "WeChat.exe"
self.module_name = "WeChatWin.dll" self.module_name = "WeChatWin.dll"
@ -280,8 +280,8 @@ class BiasAddr:
key_bias = self.get_key_bias2(self.db_path, account_bias) if key_bias <= 0 and self.db_path else key_bias key_bias = self.get_key_bias2(self.db_path, account_bias) if key_bias <= 0 and self.db_path else key_bias
rdata = {self.version: [name_bias, account_bias, mobile_bias, 0, key_bias]} rdata = {self.version: [name_bias, account_bias, mobile_bias, 0, key_bias]}
print(rdata) # print(rdata)
self.test() # self.test()
if version_list_path and os.path.exists(version_list_path): if version_list_path and os.path.exists(version_list_path):
with open(version_list_path, "r", encoding="utf-8") as f: with open(version_list_path, "r", encoding="utf-8") as f:
data = json.load(f) data = json.load(f)

View File

@ -8,6 +8,7 @@
import json import json
import ctypes import ctypes
import os import os
import re
import winreg import winreg
import pymem import pymem
from win32com.client import Dispatch from win32com.client import Dispatch
@ -75,6 +76,7 @@ def get_info_filePath(wxid="all"):
value, _ = winreg.QueryValueEx(key, "FileSavePath") value, _ = winreg.QueryValueEx(key, "FileSavePath")
winreg.CloseKey(key) winreg.CloseKey(key)
w_dir = value w_dir = value
print(0, w_dir)
except Exception as e: except Exception as e:
# 获取文档实际目录 # 获取文档实际目录
try: try:
@ -87,13 +89,19 @@ def get_info_filePath(wxid="all"):
if "%" in documents_paths[0]: if "%" in documents_paths[0]:
w_dir = os.environ.get(documents_paths[0].replace("%", "")) w_dir = os.environ.get(documents_paths[0].replace("%", ""))
w_dir = os.path.join(w_dir, os.path.join(*documents_paths[1:])) w_dir = os.path.join(w_dir, os.path.join(*documents_paths[1:]))
print(1, w_dir)
else: else:
w_dir = documents_path w_dir = documents_path
print(2, w_dir)
except Exception as e: except Exception as e:
profile = os.path.expanduser("~") profile = os.environ.get("USERPROFILE") # 获取用户目录
w_dir = os.path.join(profile, "Documents") w_dir = os.path.join(profile, "Documents")
print(3, w_dir)
if w_dir == "MyDocument:":
profile = os.environ.get("USERPROFILE")
w_dir = os.path.join(profile, "Documents")
msg_dir = os.path.join(w_dir, "WeChat Files") msg_dir = os.path.join(w_dir, "WeChat Files")
print(msg_dir)
if wxid == "all" and os.path.exists(msg_dir): if wxid == "all" and os.path.exists(msg_dir):
return msg_dir return msg_dir
@ -241,3 +249,9 @@ def get_wechat_db(require_list: Union[List[str], str] = "all", msg_dir: str = No
print(f"[+] 共 {len(user_dirs)} 个微信账号") print(f"[+] 共 {len(user_dirs)} 个微信账号")
return user_dirs return user_dirs
if __name__ == '__main__':
with open("version_list.json", "r", encoding="utf-8") as f:
version_list = json.load(f)
read_info(version_list, is_logging=True)

View File

@ -47,7 +47,7 @@ setup(
install_requires=install_requires, install_requires=install_requires,
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'wxdump = pywxdump.command:console_run', 'wxdump = pywxdump.cli:console_run',
], ],
}, },
setup_requires=['wheel'] setup_requires=['wheel']