macOS arm64 微信 4.1 数据库解密,只在最新的微信 4.1.2.241 测试过,不支持4.0 以下版本
Find a file
Thearas 8c59e22786
Merge pull request #4 from jalen0x/main
feat: enhance MCP server with auto-sync, date filtering, and multi-db query
2026-03-09 16:09:04 +08:00
微信 mac 数据库解密 init 2026-03-05 13:18:37 +08:00
.gitignore chore: improve .gitignore 2026-03-05 20:11:39 +08:00
decrypt_db.py feat: add decrypt_db.py and export_messages.py 2026-03-05 19:44:44 +08:00
export_messages.py feat: use display names for exported filenames 2026-03-05 21:13:03 +08:00
find_key.py init 2026-03-05 13:18:37 +08:00
find_key_memscan.py feat: add find_key_memscan.py for brute-force memory scanning 2026-03-05 19:44:51 +08:00
image-1.png init 2026-03-05 13:18:37 +08:00
image.png init 2026-03-05 13:18:37 +08:00
LICENSE init 2026-03-05 13:18:37 +08:00
mcp_server.py fix: query all msg databases to avoid missing chat history 2026-03-08 11:06:33 +08:00
README.md docs: simplify README, add MCP server docs 2026-03-05 20:08:17 +08:00
verify_keys.py feat: add verify_keys.py for one-click key verification 2026-03-05 19:44:38 +08:00
微信数据库解密.md init 2026-03-05 13:18:37 +08:00

macOS 微信数据库解密

提取微信 (WeChat) 数据库密钥,解密 SQLCipher 加密的本地数据库,导出聊天记录。支持 MCP Server让 AI 直接查询微信数据。

快速开始

1. 前置条件

  • macOS arm64微信 4.x
  • 禁用 SIPcsrutil disable
  • 安装依赖:brew install llvm sqlcipher

2. 提取密钥

确保微信已登录并正在运行:

PYTHONPATH=$(lldb -P) python3 find_key_memscan.py

密钥保存到 wechat_keys.json

3. 解密数据库

python3 decrypt_db.py

4. 导出聊天记录

# 列出所有会话
python3 export_messages.py

# 导出指定会话(支持模糊匹配联系人名)
python3 export_messages.py -c "卡比"
python3 export_messages.py -c wxid_xxx
python3 export_messages.py -c 12345@chatroom

# 导出最近 N 条
python3 export_messages.py -c "卡比" -n 50

# 搜索关键词
python3 export_messages.py -s "关键词"

# 导出所有会话
python3 export_messages.py --all

5. MCP Server让 AI 直接查询)

安装依赖并注册到 Claude Code

pip3 install fastmcp
claude mcp add wechat -- python3 $(pwd)/mcp_server.py

注册后 AI 可以直接调用以下能力:

Tool 功能
get_recent_sessions 获取最近会话列表
get_chat_history 查看聊天记录(支持模糊匹配)
search_messages 跨会话搜索关键词
get_contacts 搜索联系人

Thanks