rename core_db_type
This commit is contained in:
parent
9f1a7d3899
commit
0c56e20c9d
@ -15,7 +15,7 @@ from typing import List
|
||||
|
||||
from .decryption import batch_decrypt
|
||||
from .wx_info import get_core_db
|
||||
from .utils import wx_core_loger, wx_core_error, DB_TYPE_CORE
|
||||
from .utils import wx_core_loger, wx_core_error, CORE_DB_TYPE
|
||||
|
||||
|
||||
@wx_core_error
|
||||
@ -467,7 +467,7 @@ def all_merge_real_time_db(key, wx_path, merge_path: str, real_time_exe_path: st
|
||||
from pywxdump import get_core_db
|
||||
except ImportError:
|
||||
return False, "未找到模块 pywxdump"
|
||||
db_paths = get_core_db(wx_path, DB_TYPE_CORE)
|
||||
db_paths = get_core_db(wx_path, CORE_DB_TYPE)
|
||||
if not db_paths[0]:
|
||||
return False, db_paths[1]
|
||||
db_paths = db_paths[1]
|
||||
|
@ -12,5 +12,5 @@ from .ctypes_utils import get_process_list, get_memory_maps, get_process_exe_pat
|
||||
from .memory_search import search_memory
|
||||
from ._loger import wx_core_loger
|
||||
|
||||
DB_TYPE_CORE = ["MicroMsg", "MSG", "MediaMSG", "OpenIMContact", "OpenIMMsg", "PublicMsg", "OpenIMMedia",
|
||||
CORE_DB_TYPE = ["MicroMsg", "MSG", "MediaMSG", "OpenIMContact", "OpenIMMsg", "PublicMsg", "OpenIMMedia",
|
||||
"Favorite", "Sns"]
|
||||
|
@ -14,7 +14,7 @@ from typing import List, Union
|
||||
from .utils import verify_key, get_exe_bit, wx_core_error
|
||||
from .utils import get_process_list, get_memory_maps, get_process_exe_path, get_file_version_info
|
||||
from .utils import search_memory
|
||||
from .utils import wx_core_loger, DB_TYPE_CORE
|
||||
from .utils import wx_core_loger, CORE_DB_TYPE
|
||||
import ctypes.wintypes as wintypes
|
||||
|
||||
# 定义常量
|
||||
@ -415,15 +415,15 @@ def get_core_db(wx_path: str, db_types: list = None) -> [dict]:
|
||||
"""
|
||||
获取聊天消息核心数据库路径
|
||||
:param wx_path: 微信文件夹路径 eg:C:\*****\WeChat Files\wxid*******
|
||||
:param db_types: 数据库类型 eg: DB_TYPE_CORE,中选择一个或多个
|
||||
:param db_types: 数据库类型 eg: CORE_DB_TYPE,中选择一个或多个
|
||||
:return: 返回数据库路径 eg: [{"wxid": wxid, "db_type": db_type, "db_path": db_path, "wxid_dir": wxid_dir}, ...]
|
||||
"""
|
||||
if not os.path.exists(wx_path):
|
||||
return False, f"[-] 目录不存在: {wx_path}"
|
||||
|
||||
if not db_types:
|
||||
db_types = DB_TYPE_CORE
|
||||
db_types = [dt for dt in db_types if dt in DB_TYPE_CORE]
|
||||
db_types = CORE_DB_TYPE
|
||||
db_types = [dt for dt in db_types if dt in CORE_DB_TYPE]
|
||||
msg_dir = os.path.dirname(wx_path)
|
||||
my_wxid = os.path.basename(wx_path)
|
||||
wxdbpaths = get_wx_db(msg_dir=msg_dir, db_types=db_types, wxids=my_wxid)
|
||||
|
Loading…
Reference in New Issue
Block a user