Yichen Wecom Local Vault logo

Yichen Wecom Local Vault

CommunityPopular
mcncarl
yichen-wecom-local-vault

Read, decrypt, query, search, and export local WeCom/企业微信 5.x desktop databases on macOS into a private read-only vault. Use when the user asks to parse 企业微信本地数据、企微聊天记录、WeCom/WXWork contacts, sessions, groups, customers, message history, local database backup, structured export, or a Mac enterprise-WeChat data analysis workflow.

Overview

Publishermcncarl
Repositoryyichen-skills
Skill nameyichen-wecom-local-vault
Stars
3.3K
Forks
1.4K
Bundled files
8
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by mcncarl on GitHub. Read the source before you install it.

Installation

Install the Yichen Wecom Local Vault AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mcncarl/yichen-skills.git /tmp/yichen-skills
mkdir -p .claude/skills
cp -r /tmp/yichen-skills/yichen-wecom-local-vault .claude/skills/yichen-wecom-local-vault
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Yichen Wecom Local Vault in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Yichen Wecom Local Vault on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Yichen Wecom Local Vault is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

yichen-wecom-local-vault:企业微信本地数据 Vault

只读取 Mac 企业微信5.x本地数据库,生成新的私密明文快照,再从快照查询联系人、会话和消息。把它与个人微信 yichen-wechat-local-vault 分开使用;两者的容器、加密算法和表结构不兼容。

强制边界

  • 绝不点击、退出、重启、重签原始 /Applications/企业微信.app,也绝不发送企业微信消息。
  • 允许在用户明确要求“修改边界 / 用重签副本抓企微 key / 继续完整解密”时,复制一份企业微信到私密 Vault,对副本做 ad-hoc 重签,并通过 Frida 启动这个副本捕获 key。
  • 重签副本只能用于本机 owner 授权的数据解析;默认不复用旧副本、不覆盖已有副本、不写进项目或云盘。
  • 默认不附加企业微信进程。只有用户明确要求“抓企微 key / 捕获密钥 / 继续解密”时,才可运行带 --confirm-attach 的捕获命令;系统拒绝 attach 时优先改用签名副本路线。
  • 只读源数据库和 WAL;不写回企业微信容器。
  • 不删除或覆盖任何文件。每次解密建立新的时间戳快照;每次导出建立新文件。
  • 不在回复或日志中显示 raw key、完整账号目录、联系人内部 ID 或整段私聊原文。
  • 明文快照、密钥和导出文件都属于敏感数据;不要放进项目、桌面、云盘或 Git。

入口

bash
SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/yichen-wecom-local-vault"
python3 "$SKILL_DIR/scripts/vault_cli.py" status

依赖:日常发现与查询只需要 Python 3;解密需要 pycryptodome;Mac 被动捕获 key 另外需要 frida。不要自动安装依赖,先报告缺项。

自动选择工作流

  1. 第一次使用或用户问“能不能解析”:运行 status,只检查数据库,不附加进程。
  2. 已有私密 key 文件:运行 decrypt 创建新快照;默认合并已提交的 WAL 帧。
  3. 缺少 key:先说明需要明确授权捕获;可选只读 attach,若 macOS 拒绝 task_for_pid,再使用重签副本捕获。
  4. 已有快照:直接用 sessionscontactshistorysearchexport,不要重新解密。
  5. 用户指定会话或时间范围:只查询该范围;消息较多时先落 Markdown/JSON 文件。

数据库发现与检查

bash
python3 "$SKILL_DIR/scripts/vault_cli.py" discover
python3 "$SKILL_DIR/scripts/vault_cli.py" status
python3 "$SKILL_DIR/scripts/vault_cli.py" status --show-paths
python3 "$SKILL_DIR/scripts/capture_key_macos.py" list
python3 "$SKILL_DIR/scripts/capture_key_macos.py" doctor
python3 "$SKILL_DIR/scripts/scan_dbkey_manager_macos.py" scan

只有用户明确需要看真实路径时才使用 --show-paths。多账号时用 --data-dir 指定包含 message.dbsession.dbuser.db 的数据集。

捕获 Mac 企业微信 key

此步骤只被动附加已经运行的进程,不启动或操作客户端。必须获得用户当轮明确授权:

bash
python3 "$SKILL_DIR/scripts/capture_key_macos.py" capture \
  --confirm-attach \
  --duration 60

捕获器监听 CommonCrypto AES/MD5 调用,将候选16字节 key 与本地加密库第一页逐一验证;只有验证成功才以 0600 写入私密 Vault,终端不显示 key。若超时,报告“未捕获”,不要让用户在客户端里进行点击操作,也不要自行重签应用。

doctor 只读检查 Python、Frida、Developer Tools、SIP 和数据库格式。若 macOS 拒绝 task_for_pid,停止捕获并报告权限边界;不要自动关闭 SIP、放宽系统 taskport 或重签企业微信。参考 Frida macOS 官方说明官方故障排查

重签副本捕获路线

当原始企业微信 attach 被 macOS 拒绝,且用户明确允许修改边界时,可以复制并 ad-hoc 重签企业微信副本。脚本会通过 Frida 启动副本并等待 key;如果副本要求登录,只提示用户手动登录,不点击 UI、不发送消息、不关闭原始企业微信。若原始企业微信仍在运行导致副本被单实例机制拉起后退出,必须让用户自己退出原始客户端后再重试。

bash
python3 "$SKILL_DIR/scripts/capture_key_macos.py" capture \
  --mode spawn-signed-copy \
  --confirm-signed-copy \
  --duration 240

副本默认写入:

text
~/Library/Application Support/wecom-local-vault/apps/WeComSigned-<timestamp>.app

该路线会额外 hook DbKeyManager::UpdateKeyGetAllLocalEncryptKey 回调和内部 wxSQLite3 页加解密函数。当前 5.0.x macOS 客户端里,内部页加解密函数会复制 args[3][0..15],再拼接页码和 sAlT 派生每页 AES key;捕获器将这个 16 字节 raw key 候选与当前本地数据库第一页逐一验证,只有验证成功才会保存。

Frida 被系统拒绝时,可改用只读 Mach VM 扫描 DbKeyManager;它不注入代码、不重启或重签客户端、不操作 UI,但需要用户在本机终端输入管理员密码:

bash
python3 "$SKILL_DIR/scripts/scan_dbkey_manager_macos.py" scan --confirm-sudo

该扫描器根据当前进程 load address 定位 DbKeyManager vtable,并只读取 this+0x68 的 Apple libc++ std::string 候选 key;候选通过数据库第一页验证后才写入私密 Vault,终端不显示 raw key。

创建明文快照

bash
python3 "$SKILL_DIR/scripts/vault_cli.py" decrypt
python3 "$SKILL_DIR/scripts/vault_cli.py" decrypt --key-file "/private/path/keys-时间戳.json"

快照默认写入:

text
~/Library/Application Support/wecom-local-vault/snapshots/<timestamp>-<dataset_id>/

每个快照包含 manifest.json,并标记 contains_plaintext_wecom_data: true。脚本把 WAL 中 header salt 匹配、且在最后一次已提交事务以前的页面解密并合并到新快照,不改源 WAL。

查询和导出

bash
python3 "$SKILL_DIR/scripts/vault_cli.py" sessions --limit 50
python3 "$SKILL_DIR/scripts/vault_cli.py" contacts --query "关键词"
python3 "$SKILL_DIR/scripts/vault_cli.py" history "群名或conversation_id" \
  --start "2026-07-01" --end "2026-07-13" --limit 500
python3 "$SKILL_DIR/scripts/vault_cli.py" search "关键词" \
  --chat "群名" --start "2026-07-01" --limit 200
python3 "$SKILL_DIR/scripts/vault_cli.py" export "群名" \
  --start "2026-07-01" --format markdown

默认读取最新快照;需要固定证据版本时传 --snapshot。导出默认写入私密 Vault 的 exports/,文件权限为 0600,已有目标文件一律拒绝覆盖。

已知限制

  • Mac key 捕获依赖企业微信实际打开/读写加密数据库;如果捕获期间没有触发 wxSQLite3 页加解密调用,可能抓不到 key。
  • 消息二进制内容采用通用 UTF-8/Protobuf 文本提取;图片、语音、文件正文目前只输出类型占位,不解密媒体。
  • 会话方向需要可靠的本人内部 ID;未确认时不要把发送者武断标记为“我”。
  • 企业微信版本升级可能改变密钥调用或表结构;先运行离线测试和 status 再处理真实数据。

数据库格式、表结构和 WAL 说明见 references/database-notes.md

验证

bash
cd "$SKILL_DIR/scripts"
python3 test_wecom_local_vault.py
python3 -m py_compile *.py
python3 "$HOME/.codex/skills/.system/skill-creator/scripts/quick_validate.py" "$SKILL_DIR"

快照读取与排错

  • 查询使用静止的明文快照,以 mode=ro&immutable=1 打开;不把 immutable 用于运行中的源库。
  • 先用 python3 -c "import Crypto" 检查解释器依赖;缺少时报告,不自动安装。
  • --data-dir 接受数据库目录路径,不接受发现结果中的 dataset_id。多个数据集时明确选择,不能猜测账号。
  • 快照只包含创建时已有数据;最新消息查询前检查快照时间。会话摘要时间可能滞后,以消息表的实际时间为准。
  • 文件消息与媒体正文不同;该查询器不解密媒体。
  • 兼容性必须区分客户端版本/构建号、操作系统、已有密钥解密和重新捕获密钥,不能由“5.x”推断全版本支持。

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Yichen Wecom Local Vault AI skill do?

Read, decrypt, query, search, and export local WeCom/企业微信 5.x desktop databases on macOS into a private read-only vault. Use when the user asks to parse 企业微信本地数据、企微聊天记录、WeCom/WXWork contacts, sessions, groups, customers, message history, local database backup, structured export, or a Mac enterprise-WeChat data analysis workflow.

Why use Yichen Wecom Local Vault on TypingMind?

Because you install it once and use it with any model. Yichen Wecom Local Vault is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Yichen Wecom Local Vault in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mcncarl/yichen-skills/tree/main/yichen-wecom-local-vault. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Yichen Wecom Local Vault?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Yichen Wecom Local Vault?

As many as you like. As long as a model supports skills, you can use Yichen Wecom Local Vault with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Yichen Wecom Local Vault AI skill free?

It is published on GitHub by mcncarl. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇