Skip to content
Agentmart
Submit a tool

office-addin-reverse-analysis

逆向分析 Office JS加载项(Excel TaskPaneApp + SharedRuntime)。

Skill by wang-zi-tao

IndexedMIT
Write a review

Chalk Labs

Need help deploying office-addin-reverse-analysis?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

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-office-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.

We use your email only for this newsletter. Privacy

About

逆向分析 Office JS加载项(Excel TaskPaneApp + SharedRuntime)。

Use cases: spreadsheets

No 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/office-addin-reverse-analysis

What's inside

Skill name
office-addin-reverse-analysis
Description
逆向分析 Office JS加载项(Excel TaskPaneApp + SharedRuntime)。
License
MIT
Instructions
168 lines in SKILL.md · view on GitHub

Before installing

  • Instructions call the network

Files (3)

  • SKILL.md
  • example-office-layout.md · references/
  • office-sharedruntime-notes.md · references/

SKILL.md (first lines)

# Office 加载项(Excel)逆向分析

逆向分析 Excel Office 加载项(TaskPaneApp + CustomFunctions + SharedRuntime)。适用于从清单 URL 开始,下载、格式化、理解并沉淀加载项的全部代码与交互机制。

## 适用场景

- 用户给出 Office 加载项 manifest.xml URL,要求分析加载项实现
- 需要分析 `CustomFunctions.associate` 自定义函数的执行流程
- 需要分析 Excel.js(`Excel.run` / `getRangeByIndexes` / `setDirty` / `notes`)异步批处理
- 需要分析 SharedRuntime 架构(自定义函数与任务窗格共享运行时)
- 需要与 WPS 版加载项做对比分析
- 需要将分析结果沉淀为文档并 git 提交

## 前置约定(强制)

- **分析全程用 git 记录**:每个阶段(下载、格式化、定位注册、流程追踪、报告)完成后立即 `git add` + `git commit`
- **所有下载的 JS 必须格式化**:统一用 `npx --yes prettier@3.3.3 --parser babel --print-width 200 <input> > <input>.formatted.js`
- 下载文件放入 `excel/` 目录(保持 URL 相对结构:`js/`、`css/` 子目录)
- 分析报告写入 repo 的 `docs/` 或 Obsidian 笔记库
- 本仓库无需编译/测试/lint

## 标准工作流

### Step 1: 下载 manifest.xml

用户提供的 URL 通常是 manifest.xml:

```bash
curl -s "<URL>/manifest.xml" -o excel/manifest.xml
```

### Step 2: 解析清单提取资源 URL

提取关键节点(Office Add-in 标准):

```bash
findstr /n "SourceLocation\|Script.Url\|Metadata.Url\|Taskpane.Url\|bt:Url" excel/manifest.xml
```

必提字段:
- `Id` / `Version` / `ProviderName` / `DisplayName`
- `Requirements > Sets`(如 SharedRuntime 1.1)
- `DefaultSettings > SourceLocation`(任务窗格页面入口)
- `VersionOverrides > CustomFunctions`:`Functions.Script.Url`(函数脚本)、`Functions.Metadata.Url`(函数元数据)、`Taskpane.Url`
- `Hosts` / `ExtensionPoint xsi:type="PrimaryCommandSurface"`(Ribbon 按钮 ExecuteFunction 动作名)

### Step 3: 下载函数元数据 + 页面入口

```bash
curl -s "<Functions.Metadata.Url>" -o excel/functions.json
curl -s "<Taskpane.Url>" -o excel/taskpane.html
```

**注意**:manifest 中 Script/Metadata URL 可能 404(部署路径漂移)。从 taskpane.html 的 `<script src>` 推断真实 CDN 路径(通常在 `s.thsi.cn/cd/<container>/xlsslug-excel/` 下),逐 URL 探测。

### Step 4: 解析 taskpane.html 提取 bundle

```bash
findstr /n "script src\|href=" excel/taskpane.html
```

典型产物:`js/chunk-vendors.<hash>.js`(2MB 级)、`js/chunk-common.<hash>.js`(175KB 级)、`js/taskpane.<hash>.js`(160KB 级)+ CSS。

### Step 5: 下载全部 JS 并格式化

```bash
curl -s "<url>" -o excel/<file>.js
npx --yes prettier@3.3.3 --parser babel --print-width 200 "excel/<file>.js" > "excel/<file>.formatted.js"
```

minified 单行文件 grep 无法给出上下文,**必须格式化**。原始文件保留(grep 精确定位字符偏移用)。

### Step 6: 定位懒加载 chunk(动态 import)

主 bundle 中 `n.e(<chunkId>)` 表示懒加载。chunk 文件名映射在 webpack runtime:

```
搜索 "n.u=function" → 如 "js/"+e+".84f0cfe0.js"(共享 hash)
→ 下载 js/<chunkId>.<hash>.js
```

示例:`n.e(170).then(n.bind(n, 39170))` → 下载 `js/170.84f0cfe0.js`。**懒加载 chunk 常含自定义函数实现副本或核心请求队列(SharedRuntime 共享)**。

### Step 7: 定位自定义函数注册

在格式化后的 bundle 中搜索:

```
grep -n "CustomFunctions.associate\|Office.actions.associate" *.formatted.js
```

两种注册并存:
- `CustomFunctions.associate("HXIFIND", handler)` — 工作表自定义函数(ID 全大写)
- `Office.actions.associate("OpenTaskpane", handler)` — Ribbon 命令(manifest ExecuteFunction 动作名)

对照 `functions.json` 建立注册表(注意 `dimensionality: "matrix"`、`stream`、`result.type` 等 Office 标准字段)。

### Step 8: 追踪函数执行流程

每个函数入口共享模式(Office 版):

```js
function Oe(e, t, ..., m) {                       // handler
    return me(this, void 0, void 0, function* () {
        try {
            if (yield (0, de.RI)(), !(0, r["do"])()) return null;  // ① 鉴权 ② 环境检测
            const y = yield fe.l(e, t, ..., m);                     // ③ 核心逻辑
            return y;
        } catch (y) { return y }
    })
}
```

- `RI()` = 鉴权/登录检查;`do()` = 环境检测(常检查 `jgbsessid`/`userid`/`User-Agent`)
- 核心逻辑可能在独立模块(如 50764)或懒加载 chunk

**批量机制**(hxiFinD 类,重点,与 WPS 版同构):
- `reqMap`(paramKey 去重)+ 分类队列(基金/债券/普通)
- 100ms `setInterval` 稳定检测(500ms 或 >1000 条或 ≥3000 分片)

From wang-zi-tao/dotfiles, MIT.

More from wang-zi-tao/dotfiles

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
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wang-zi-tao

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get office-addin-reverse-analysis running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying office-addin-reverse-analysis?

CallGet help
Cite this page

office-addin-reverse-analysis skill. Agent Mart. https://agentmart.dev/skills/wang-zi-tao-office-addin-reverse-analysis (last updated 2026-10-24)