Community研究與資料分析github.com

grahama1970/analyze-elf

從 ELF 二進位檔中逆向工程萃取功能特徵。擷取 CLI 指令、狀態機、協定、Zod 結構與資料模型,並自動產生含 Mermaid 圖表的起訴摘要文件。

analyze-elf 是什麼?

analyze-elf 是一個專業的 AI 代理技能,專注於從已編譯的 ELF 二執行檔中逆向工程出「功能」而非僅是反組譯。它回答「這個二進位檔做了什麼?」這一核心問題,特別適用於理解 Bun SEA、Go、Rust 或 C/C++ 等編譯後的 CLI 工具。該技能支援 Claude Code、Cursor 等開發者平台,並透過一站式指令萃取出 CLI 指令、旗標、說明文字、狀態機、協定結構、事件類型、JSON-RPC 方法、Zod 資料模型、npm 套件以及 API 路由。其核心命令 `features` 會自動觸發 `/create-walkthrough` 生成一份完整的起訴摘要,內含 Mermaid 指令樹、狀態機圖、事件類型分類與風險評估表。若加上 `--ast` 旗標,還會透過 `/treesitter` 對內嵌的 JS/TS 原始碼進行 AST 分析,進一步提取類別、函數與方法簽章。此外,`elf` 命令可輸出 DOT 格式的模組相依圖,供 `/create-figure` 視覺化呈現。此技能極大提升了安全研究員、逆向工程師與開發者對未知二進位檔的理解效率,將靜態分析與結構化報告生成自動化。

相容平台✓Claude Code~Codex CLI~Cursor✓Antigravity
npx skills add https://github.com/grahama1970/agent-skills/tree/main/skills/analyze-elf

Installed? Explore more 研究與資料分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

停止。在呼叫任何端點前,請先完整閱讀本 SKILL.MD。

analyze-elf 是做什麼的?

從已編譯的 ELF 二進位檔中逆向工程萃取功能特徵。這不是一個反組譯工具,而是一個特徵萃取器,回答「這個二進位檔做了什麼?」

使用時機

  • 了解編譯型 CLI 工具的功能(Bun SEA、Go、Rust、C/C++)
  • 萃取 CLI 指令、旗標與說明文字
  • 還原狀態機、協定結構與事件類型
  • 映射 JSON-RPC 方法與 Zod 資料模型
  • 產出含 Mermaid 圖表的起訴摘要文件

快速入門

# 主要指令 — 萃取特徵,產生摘要
.pi/skills/analyze-elf/run.sh features /path/to/binary --goal "了解任務系統"

# 搭配 /treesitter 進行 AST 分析(較慢,但更深入)
.pi/skills/analyze-elf/run.sh features /path/to/binary --ast --goal "找出所有 RPC 方法"

# 輸出 JSON 格式供程式化使用
.pi/skills/analyze-elf/run.sh features /path/to/binary --output-format json

# 低階 ELF 資訊(標頭、符號表、執行環境檢測)
.pi/skills/analyze-elf/run.sh elf /path/to/binary

# 透過正規表達式萃取字串
.pi/skills/analyze-elf/run.sh strings /path/to/binary --pattern "mission|worker"

指令

指令說明
features主要指令。 萃取特徵 → 產生含 Mermaid 圖表的摘要
elf低階:標頭、區段、符號表、執行環境檢測
strings正規表達式過濾的字串萃取

features 會萃取哪些內容

類別方法範例
CLI 指令說明文字模式比對exec, daemon, mcp
狀態機列舉賦值模式(M.State="value")orchestrator_turn, paused
事件類型KH.literal("type_name") 模式mission_accepted, worker_completed
JSON-RPC 方法method: KH.literal("name") 模式droid.session_notification
Zod 結構KH.object({...}) 欄位萃取Feature, WorkerHandoff, State
npm 套件捆綁 package.json 中的 "name": "pkg"@grpc/grpc-js
API 路由/api/ 與 /v1/ 路徑字串常量/api/auth/login
類別/函數透過 /treesitter 進行 AST 分析(需 --ast 旗標)MissionRunner, spawnWorker

組合

/treesitter(AST 分析)

當傳入 --ast 參數時,此技能會:

  1. 從 .rodata 區段中切割出 JS 原始碼字串
  2. 過濾出包含 JS 特徵的行(函數、類別、import、Zod 模式)
  3. 將區塊傳送至 /treesitter parse --language javascript 進行解析
  4. 萃取類別、函數與方法簽章

/create-walkthrough(自動產生)

features 指令會產出一份起訴摘要,包含:

  • Mermaid CLI 指令樹
  • Mermaid 狀態機圖
  • Mermaid 事件類型分類圖
  • 含欄位型別的結構表
  • 風險評估(「可能出錯的地方」)

/create-figure

透過 elf 指令可產生 DOT 格式的相依性與模組圖, 再透過 /create-figure 進行視覺化呈現。

相依套件

  • pyelftools — 結構化 ELF 解析
  • httpx — /scillm API 呼叫
  • typer — CLI 框架
  • loguru — 日誌記錄
  • 系統工具:binutils(readelf, nm, strings)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

grahama1970/acceptance-contract

Turn a client brief, zip bundle, directory, or single requirements file into a typed acceptance-contract bundle with extracted requirements, acceptance checks, open questions, an immutable-goal draft, and a create-report-backed decision report. Use when users say acceptance contract, brief to requirements, freeze the goal, create immutable goal, amend immutable goal, build a Battle requirements bundle, or extract requirements from this bundle.

grahama1970/agent-ecosystem

Canonical map and shared contracts for the agent-governance ecosystem: the pi.receipt_envelope.v1 boundary envelope, the component graph, and the rules for which component owns which schema. Use when wiring a skill or extension into the shared receipt world, when asking how shame, triage-error, tau, ask, project-watchdog, ops-herdr, ponytail, and Memory fit together, or when validating an envelope.

grahama1970/agentic-evals

Agentic evaluation of skills using multi-trial fixtures, deterministic command assertions, trajectory checks, safety constraints, and evidence-backed readiness scoring. Use when users ask for agentic evals, multi-trial skill evaluation, skill trajectory validation, or readiness scoring for a skill workflow.

grahama1970/agent-inbox

File-based inter-agent messaging with headless dispatch. Check inbox, send bugs/requests to other projects, automatically spawn headless agents to fix bugs, and track progress via task-monitor.

grahama1970/agents-registry

Generate and query the centralized agent identity registry. Scans .pi/agents/*/AGENTS.md, parses frontmatter, outputs agents-registry.json and optionally syncs to /memory for semantic search.

grahama1970/agent-status

Artifact-driven status surfaces for long-running project-agent work. Maintains status.json, events.jsonl, proof manifests, and a stale-aware STATUS.html so humans can tell where the agent is, what passed, what is still unproven, and what decision or action is next — without dashboard theater.

grahama1970/align

Round-based context alignment before execution. Use when the human, project agent, WebGPT, scillm, ask, dogpile, memory, or project-knowledge may each hold different facts about a task; especially before ambiguous design, infographic, product workflow, high-stakes implementation, plan-iterate, project-infographic, or multi-review work.

grahama1970/analytics

Flexible data science analytics for any dataset. Auto-discovers schema, recommends charts, exports to create-figure. Works with JSONL, JSON, CSV from any source.

grahama1970/analyze-chatterbox-emotions

Evaluate generated Chatterbox voice files as voice-quality artifacts: affect match, arousal/valence proxies, pause placement, intelligibility inputs, clipping, loudness, and discontinuity flags. Use when reviewing Chatterbox emotional tags, pauses, Turbo/base affect delivery, Persona Dream utterance renders, or whether generated speech matches an intended product-facing affect.

grahama1970/animation-vocabulary

Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing when a popover opens" → Pop in; "the iOS rubber-band scroll" → Rubber-banding). Use when the user asks "what's it called when…", or describes a motion effect without knowing its name and wants the right word to prompt an AI or designer with. For naming an effect, not designing or building one.

grahama1970/anonymize-data

Anonymize supported CSV, JSON, UTF-8 text, and SQLite files using an explicit policy through the oai-trial project. Use for anonymize data, pseudonymize exports, redact policy literals, or discover and explicitly approve fuzzy name aliases. The skill is a thin CLI/Docker interface, not another engine.

grahama1970/anvil

Heavy-duty "No-Vibes" debugging and hardening orchestrator. Use this for complex, stubborn bugs where `review-code` has failed, or for "Red Teaming" (hardening) a codebase. Runs multiple agents in parallel (Thunderdome) using git worktree isolation.

grahama1970/apple-design

Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing gesture-driven UI, spring animations, drag/swipe/sheet interactions, momentum and interruptible transitions, translucent materials and depth, typography (optical sizing, tracking, leading), reduced-motion, or the design foundations (feedback, spatial consistency, restraint) behind Apple-style interfaces.

grahama1970/argue

Multi-persona structured debate orchestrator. Personas research via /dogpile, consult colleagues via /ask, and argue toward nuanced synthesis on complex questions.

grahama1970/arxiv

Search arXiv for papers and extract knowledge into memory. Use `search` to find papers, `learn` to extract knowledge.

grahama1970/ask

Use when the user asks to query project memory, ask an oracle, use supported browser-backed reviewers, run Tau roundtable/single-handler workflows, ask Pi-native subagents from within Pi, run persona/deep-review workflows, generate image prompts, check OS/project health through composed skills, or run an ask DAG. This skill is the executable /ask runtime; do not replace it with an informal subagent, plain web search, or hand-written review; inside Pi, explicit Pi-native subagent targets are routed through the pi-subagents tool as an Ask target type.

grahama1970/assess

Step back and critically reassess project state. Use when asked to "assess", "step back", "fresh eyes", "check alignment", "sanity check", "health check", "prune documentation", or "evaluate what's working". Offers documentation pruning and doc-code alignment analysis. Offer to run after major changes (don't auto-run).

grahama1970/assistant

Shared GPT + classifier inference gateway for persona monitor tasks. Routes validation and classification through a 4-tier cascade: heuristic → classifier → local GPT → scillm.

grahama1970/assistant-lab

Self-improvement workbench for /assistant. All the tools needed to diagnose, train, evaluate, and promote models in a continuous loop. The "warm pond" where /assistant evolves its own inference stack.

grahama1970/batch-quality

Pre-flight validation and quality gates for batch LLM operations. ACTUALLY tests samples through LLM before burning tokens. Uses SPARTA contracts for DuckDB validation queries. Integrates with task-monitor for enforced quality gates.

相關技能