diff --git a/find_image_key.py b/find_image_key.py index afb9ad1..f163c7e 100644 --- a/find_image_key.py +++ b/find_image_key.py @@ -337,7 +337,7 @@ def main(): with open(config_path, encoding="utf-8") as f: config = json.load(f) - db_dir = config['db_dir'] + db_dir = os.path.expanduser(os.path.expandvars(config['db_dir'])) base_dir = os.path.dirname(db_dir) attach_dir = os.path.join(base_dir, 'msg', 'attach') diff --git a/find_image_key_macos.py b/find_image_key_macos.py index 3779f7f..b1b1703 100644 --- a/find_image_key_macos.py +++ b/find_image_key_macos.py @@ -494,6 +494,8 @@ def _find_via_bruteforce(db_dir, attach_dir, templates): if not xres: print("[!] 方案2: V2 .dat 样本不足 (需 >= 3 个), 无法投票反推 xor_key", flush=True) + print(" 请先在微信中再看 1-2 张图片,让微信生成更多 V2 .dat 文件", + flush=True) return None xor_key, votes, total = xres if votes == total: @@ -607,6 +609,7 @@ def main(config_path=None): if not db_dir: print("[!] config.json 中未配置 db_dir", file=sys.stderr, flush=True) sys.exit(1) + db_dir = os.path.expanduser(os.path.expandvars(db_dir)) print(f"[*] db_dir = {db_dir}", flush=True) # 短路:如果已有 image_aes_key 且仍能在所有模板上验证通过,直接退出 diff --git a/find_image_key_monitor.py b/find_image_key_monitor.py index 437a47f..fa1b6f4 100644 --- a/find_image_key_monitor.py +++ b/find_image_key_monitor.py @@ -230,7 +230,7 @@ def main(): with open(config_path, encoding="utf-8") as f: config = json.load(f) - db_dir = config['db_dir'] + db_dir = os.path.expanduser(os.path.expandvars(config['db_dir'])) base_dir = os.path.dirname(db_dir) attach_dir = os.path.join(base_dir, 'msg', 'attach')