Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/wang-zi-tao-wps-addin-reverse-analysis
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/wps-addin-reverse-analysis
What's inside
- Skill name
wps-addin-reverse-analysis- Description
- 逆向分析 WPS 加载项(JsPlugin)
- License
- MIT
- Instructions
- 147 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (3)
- SKILL.md
- example-wps-layout.md · references/
- wps-analysis-notes.md · references/
SKILL.md (first lines)
# WPS 表格加载项逆向分析
逆向分析 WPS 表格组件(ET)的 JsPlugin 加载项。适用于从页面 URL 开始,下载、格式化、理解并沉淀加载项的全部代码与交互机制。
## 适用场景
- 用户给出 WPS 加载项页面 URL(`index.html`),要求分析加载项实现
- 需要分析 `wps.AddCustomFunction` 自定义函数的执行流程
- 需要分析 jsapi 调用(`api.js` 传输层、`window.Application` COM API、apievent)
- 需要分析 hxiFinD 类批量请求机制、RTD 流式刷新机制
- 需要将分析结果沉淀为文档并 git 提交
## 前置约定(强制)
- **分析全程用 git 记录**:每个阶段(下载、格式化、定位注册、流程追踪、报告)完成后立即 `git add` + `git commit`,commit message 用中文描述该阶段产物
- **所有下载的 JS 必须格式化**:统一用 `npx --yes prettier@3.3.3 --parser babel --print-width 200 <input> > <input>.formatted.js`
- 下载文件按原始 URL 的相对路径组织(静态资源在 `js/`、`css/` 子目录;核心文件放仓库根或 `assets/`)
- 分析报告写入 repo 的 `docs/` 或 Obsidian 笔记库
- 本仓库无需编译/测试/lint
## 标准工作流
### Step 1: 下载页面入口
从用户提供的 URL 下载 `index.html`:
```bash
curl -s "<URL>/index.html" -o index.html
```
### Step 2: 解析资源清单
从 `index.html` 提取全部 `<script src>` 与 `<link href>`:
```bash
findstr /n "script src\|href=" index.html
```
典型产物:
- `manifest.xml`(JsPlugin 清单,226B 级)→ 函数注册指向 `/functions.json`
- `ribbon.xml`(Ribbon UI 定义)
- `functions.json`(自定义函数元数据,含 WPS 专有 `stream` / `requiresAddress` 选项)
- `api.js`(**未混淆的 jsapi 传输层**,核心分析对象)
- `functions-<hash>.js`(自定义函数实现,`wps.AddCustomFunction` 注册)
- `index-<hash>.js`(主 bundle:Vue app + 批量机制 + UI 交互)
- 其余:`chameleon*.js`(主题)、`ta.min.js`(埋点)、CSS、`xlsEDBItem-*.js`(经济数据库模块)
### Step 3: 批量下载
逐个 `curl -s <URL> -o <本地路径>`,保持子目录结构。对 minified 单行 JS,先下载原文件,再格式化生成 `.formatted.js`(原始文件保留,方便 diff 与 grep 精确字符定位)。
### Step 4: js 格式化
```bash
npx --yes prettier@3.3.3 --parser babel --print-width 200 "xxx.js" > "xxx.formatted.js"
```
minified 文件是单行,`grep` 无法给出行级上下文,**必须格式化后才能高效分析**。格式化后行数暴涨,用 grep 定位后按行号 Read。
### Step 5: 定位自定义函数注册
在格式化后的函数 bundle 中搜索注册 API:
```
grep -n "AddCustomFunction" xxx.formatted.js
```
典型输出(13 个函数,id 驼峰小写):
```js
wps.AddCustomFunction("", "hxRTD", (u,t,e,r,i,a,s)=>Mt(u, t, e, r, i, a, s));
wps.AddCustomFunction("", "hxiFinD", (u,t,e,r,i,a,s,n,l,h,c,f,o,m)=>Gt(u, t, e, r, i, a, s, n, l, h, c, f, o, m));
...
```
对照 `functions.json` 中的 options(`stream`、`requiresAddress`)建立注册表。
### Step 6: 追踪函数执行流程
每个函数入口共享模式(在格式化文件中搜索对应 handler):
```js
async function Gt(u, t, ..., m) {
try {
return await O(), // ① 鉴权/登录检查(main bundle)
T() ? it(u, t, ..., m) : null // ② 表格环境检测 → 桥接核心逻辑
} catch (g) { return g }
}
```
- `O()` = 登录/鉴权 check;`T()` = 是否在 WPS 表格环境内检测(均在 main bundle)
- 核心逻辑可能跨 bundle(桥接 main bundle 的 `it()` 等)
**批量机制**(hxiFinD 类函数,重点):
- `reqMap`(paramKey 去重)+ 分类队列(基金/债券/普通)
- 100ms `setInterval` 稳定检测(500ms 或 >1000 条或 ≥3000 分片)
- `paramExcel=` + 分号拼接 → 1 个 HTTP POST 批量请求
- 结果回写:`Range.Dirty()` / `Range.Calculate()` + 手动计算模式切换
**RTD 流式**(stream 函数):
- `invocation.setResult(data)` 推送 + `setInterval`(refreshRate 默认 3s)
- LCD 码转换(GetTHSCodes API)
- `onCanceled` 清理
### Step 7: 分析 jsapi 传输层(api.js)
优先级三模式(未混淆,直接读):
1. `window.cefQuery` — CEF 环境,异步
2. `window.external[method]()` — COM,同步(按参数个数 switch)
3. `window.app.sendMessage` — 异步消息
API 方法名列表见 `api.js` 末尾 `h` 变量(逗号分隔字符串,~120+ 方法)。
### Step 8: 分析表格访问(COM jsapi)
WPS 版通过 COM 同步 API 访问表格:
```js
window.Application.ActiveWorkbook.Worksheets.Item(name)From wang-zi-tao/dotfiles, MIT.
More from wang-zi-tao/dotfiles
- 0.526score
kdocs
wang-zi-tao
操作金山文档(WPS 云文档 / Kdocs / 365.kdocs.cn / www.kdocs.cn)云文档的官方 Skill。核心能力覆盖云端新建、读取、编辑、搜索、分享、整理在线文档(智能文档、Word、Excel、PDF、PPT、演示文稿、智能表格、多维表格)及个人知识库。当用户的任务涉及云文档操作时使用,…
SkillBFreshness: BClaude Code +9 - 0.522score
research-to-vault
wang-zi-tao
将研究和考察结果按分类规则存入 Obsidian 笔记库。当用户要求记录研究发现、保存分析结果、把调研结论写入笔记库、或任何需要将技术发现持久化到 ~/Documents/Obsidian-work/ 时使用此 skill。触发词:记笔记、存入笔记库、记录研究、保存分析、write to…
SkillBFreshness: BClaude Code +9 - 0.520score
office-addin-reverse-analysis
wang-zi-tao
逆向分析 Office JS加载项(Excel TaskPaneApp + SharedRuntime)。
SkillBFreshness: BClaude Code +9 - 0.518score
dotfiles
wang-zi-tao
关于此操作系统的一切服务, 软件和配置文件的集中式管理, 配置脚本.
SkillBFreshness: BClaude Code +9 - 0.518score
kcontext-skill
wang-zi-tao
使用 kso-context MCP 工具查询公司内部代码库文档与 API 上下文。触发词(满足其一):use kctx、kskillhub-kcontext、kcontext。用户消息包含任一则必须使用本 skill。
SkillBFreshness: BClaude Code +9 - 0.518score
wps-cmake-module-analyzer
wang-zi-tao
分析 wpsmain 仓库中代码,提取 C++ 类型依赖、生命周期与模块能力, 并创建或更新对应模块笔记。 分析代码后, 使用本skill来更新笔记库, 以便长期沉淀模块知识.
SkillBFreshness: BClaude Code +9 - 0.514score
hermes-cli-from-other-agents
wang-zi-tao
当其他 agent(如 OpenCode, Cursor, Claude Code)需要调用 Hermes CLI 来管理系统配置、Kanban 看板或定时任务时的参考指南。涵盖 profiles 职能、调用模式和常见陷阱。
SkillBFreshness: BClaude Code +9 - 0.511score
note-search
wang-zi-tao
在 Obsidian 笔记库中查找笔记。根据关键词、标签、文件路径或概念查询笔记内容。
SkillBFreshness: BClaude Code +9 - 0.404score
nixpkgs-hash
wang-zi-tao
Generate the sha256 hash of nix package or source code repo.
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Aug 21, 2026 (2 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/wang-zi-tao/dotfiles
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from wang-zi-tao
- 0.526score
kdocs
wang-zi-tao
操作金山文档(WPS 云文档 / Kdocs / 365.kdocs.cn / www.kdocs.cn)云文档的官方 Skill。核心能力覆盖云端新建、读取、编辑、搜索、分享、整理在线文档(智能文档、Word、Excel、PDF、PPT、演示文稿、智能表格、多维表格)及个人知识库。当用户的任务涉及云文档操作时使用,…
SkillBFreshness: BClaude Code +9 - 0.522score
research-to-vault
wang-zi-tao
将研究和考察结果按分类规则存入 Obsidian 笔记库。当用户要求记录研究发现、保存分析结果、把调研结论写入笔记库、或任何需要将技术发现持久化到 ~/Documents/Obsidian-work/ 时使用此 skill。触发词:记笔记、存入笔记库、记录研究、保存分析、write to…
SkillBFreshness: BClaude Code +9 - 0.520score
office-addin-reverse-analysis
wang-zi-tao
逆向分析 Office JS加载项(Excel TaskPaneApp + SharedRuntime)。
SkillBFreshness: BClaude Code +9 - 0.518score
dotfiles
wang-zi-tao
关于此操作系统的一切服务, 软件和配置文件的集中式管理, 配置脚本.
SkillBFreshness: BClaude Code +9 - 0.518score
kcontext-skill
wang-zi-tao
使用 kso-context MCP 工具查询公司内部代码库文档与 API 上下文。触发词(满足其一):use kctx、kskillhub-kcontext、kcontext。用户消息包含任一则必须使用本 skill。
SkillBFreshness: BClaude Code +9 - 0.518score
wps-cmake-module-analyzer
wang-zi-tao
分析 wpsmain 仓库中代码,提取 C++ 类型依赖、生命周期与模块能力, 并创建或更新对应模块笔记。 分析代码后, 使用本skill来更新笔记库, 以便长期沉淀模块知识.
SkillBFreshness: BClaude Code +9
Cite this page
wps-addin-reverse-analysis skill. Agent Mart. https://agentmart.dev/skills/wang-zi-tao-wps-addin-reverse-analysis (last updated 2026-10-24)