5 Commits

Author SHA1 Message Date
xincheng
5c3e6adfcd Add Windows GUI and WXWork export support 2026-05-17 07:07:07 +08:00
Belugary
acd44376ba fix: find_image_key 三个 fallback 入口路径展开 + 方案2 hint (#71)
* fix: find_image_key 三个 fallback CLI 入口对齐 config.load_config 路径展开

PR #63 给 config.load_config() 加了 expanduser + expandvars, 但 find_image_key.py
/ find_image_key_macos.py / find_image_key_monitor.py 三个 CLI 入口的 main()
为了让单测注入隔离 config (find_image_key_macos.py docstring 明文写着), 走 raw
json.load(config_path), 绕开了 load_config 那层路径展开.

用户 config.json 里写 "db_dir": "~/Documents/..." 或 "$HOME/Documents/..."
时, 下游拼出的 attach_dir 仍带 ~ / $HOME 字面字符, glob *_t.dat 扫不到 →
find_image_key.py / monitor.py 报 "No V2 .dat files found", macOS 文件
dispatcher 还会误报"请先在微信中查看 1-2 张图片让微信生成 V2 .dat 文件",
但磁盘上 attach 已经塞满了 .dat.

三个文件各加 1 行 expanduser(expandvars(...)), 与 PR #63 / config.py:213
对齐, 不动 main() 既有的 raw json.load(为保留单测注入口子).

* fix(find_image_key_macos): 方案2 V2 _t.dat 样本不足时补一行下一步指引

dispatcher 层 (找不到 V2 模板分支) 已有"请先在微信中查看 1-2 张图片让微信
生成 V2 .dat 文件"指引, 但 _find_via_bruteforce 子路径在 V2 _t.dat 样本 < 3
时只 print "样本不足 (需 >= 3 个), 无法投票反推 xor_key", 用户不知该做什么.
加一行等价 hint, 与 dispatcher 层 UX 风格保持一致.
2026-05-05 22:47:51 +08:00
xincheng
b9f3161f84 Add SNS/image export and GUI contact export
Introduce SNS (朋友圈) and batch image tooling and enhance the GUI export workflow. Added new scripts: decrypt_sns.py (decrypt WeChat SNS cache) and batch_decrypt_images.py (bulk .dat image decrypt). Update build scripts and PyInstaller spec to include the new files. app_gui.py: add contact discovery, contact selection/export options dialog, new buttons (find image key, SNS), orchestrate combined export/voice/SNS tasks via subprocesses and env flags, and auto-run export after decryption. config.py: add output_base_dir, auto-detect WeChat Files path, and expose msgattach/xwechat cache dirs. export_messages.py: switch to output_base_dir, add image resource lookup and .dat locating/decryption helpers, and support environment-driven contact/format/image filters. Misc: update build.bat and packaging datas to include the new modules.

Co-Authored-By: Copilot <198982749+Copilot@users.noreply.github.com>
2026-04-06 23:57:51 +08:00
ylytdeng
944546beb1 fix: 统一所有 JSON 文件读写为 UTF-8 编码
Windows 中文环境默认编码为 GBK,未指定 encoding 会导致
config.json/all_keys.json 解析失败。修复 9 个文件共 17 处。

Closes #32

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:32:37 +08:00
ylytdeng
da7525db95 Add image decryption and inline preview for WeChat V2 format
Support all three .dat encryption formats:
- Old XOR format: single-byte XOR, auto-detect key from magic bytes
- V1 format: AES-ECB with fixed key (md5("0")[:16]) + XOR tail
- V2 format (2025-08+): AES-128-ECB + raw middle + XOR tail

New files:
- decode_image.py: unified image decryption module (XOR/V1/V2)
- find_image_key.py: extract AES key from WeChat process memory
- find_image_key_monitor.py: continuous monitoring version for key capture

monitor_web.py changes:
- Inline image preview in Web UI with async decryption
- MonitorDBCache for mtime-based DB decryption caching
- username-to-DB mapping for image resolution chain
- /img/ endpoint for serving decoded images
- SSE image_update events for real-time preview updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 00:30:01 +08:00