Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ak-suite",
"description": "AlgoKiller suite — ARM64 trace evidence analysis & cipher algorithm recovery. Claude Desktop plugin packaging the AlgoKiller methodology as skills + a local MCP server driving the native ak_search engine (15 subcommands) over GB-scale trace files.",
"description": "AlgoKiller suite — ARM64 trace evidence analysis & cipher algorithm recovery. Claude plugin (loadable from both Claude Code and Claude Desktop) packaging the AlgoKiller methodology as skills + a local MCP server driving the native ak_search engine (15 subcommands) over GB-scale trace files.",
"owner": {
"name": "cloudza",
"url": "https://github.com/icloudza"
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Thanks for taking the time to look. Quick rules first, rationale below.

```
algokiller-plugin/
├── .claude-plugin/plugin.json # Claude Desktop plugin manifest
├── .claude-plugin/plugin.json # Claude plugin manifest (Code + Desktop)
├── .mcp.json # MCP server declaration (stdio)
├── server/ # Python MCP server (stdlib only)
│ ├── algokiller_mcp.py # JSON-RPC 2.0 router + tool handlers
Expand Down
14 changes: 8 additions & 6 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

**Language**: [中文](README.md) | **English**

Claude Desktop plugin for ARM64 trace evidence analysis and cipher/algorithm recovery. Bundles the AlgoKiller methodology as skills, with a local MCP server driving the native `ak_search` engine (14 subcommands) over GB-scale traces.
Claude plugin (works in both Claude Code CLI and Claude Desktop) for ARM64 trace evidence analysis and cipher/algorithm recovery. Bundles the AlgoKiller methodology as skills, with a local MCP server driving the native `ak_search` engine (14 subcommands) over GB-scale traces.

> **Methodology + ak_search engine origin**: [AlgoKiller](https://github.com/lidongyooo/AlgoKiller) by [@lidongyooo](https://github.com/lidongyooo)
> Upstream contributes the three core subcommands (`match` / `context` / `daemon` — mmap + BMH + line index + tab-protocol daemon) and the original methodology harness.
> This repo extends the native engine with 11 additional subcommands (`regflow` / `producer` / `semop` / `lint` / `fold` / `callgraph` / `modgraph` / `hexblock` / `constscan` / `cryptoinstr` / `bytes` — see [tools/search/README.md](tools/search/README.md)) and packages everything as a Claude Desktop plugin. Original code copyright belongs to upstream; plugin extensions are MIT.
> This repo extends the native engine with 11 additional subcommands (`regflow` / `producer` / `semop` / `lint` / `fold` / `callgraph` / `modgraph` / `hexblock` / `constscan` / `cryptoinstr` / `bytes` — see [tools/search/README.md](tools/search/README.md)) and packages everything as a Claude plugin (loadable from both Claude Code and Claude Desktop). Original code copyright belongs to upstream; plugin extensions are MIT.

---

Expand Down Expand Up @@ -74,7 +74,9 @@ cp ak_search ../../server/bin/ak_search

> One-line install is at the top under [🚀 Quick install](#-quick-install).

**Manual install (fallback)**: clone the repo, then Claude Desktop → `+` → **Plugins** → **Add plugin** → pick the directory.
**Manual install (fallback)**: clone the repo, then
- **Claude Desktop**: `+` → **Plugins** → **Add plugin** → pick the directory
- **Claude Code**: run `claude plugin install .` from the repo root (or register it as a local marketplace via `claude plugin marketplace add <local-path>`)

```bash
git clone https://github.com/icloudza/algokiller-plugin
Expand Down Expand Up @@ -114,7 +116,7 @@ frida -U -f com.example.app -l example.js
# 4. Pull the trace back to macOS
adb pull /data/data/com.example.app/trace.log ~/captures/login.trace.log

# 5. Feed it to this plugin (free-form or slash in Claude Desktop)
# 5. Feed it to this plugin (free-form or slash in Claude Code / Claude Desktop)
# e.g. "Use algokiller ciphertext mode on ~/captures/login.trace.log to recover the X-Sign cipher a3b2c1..."
```

Expand Down Expand Up @@ -197,7 +199,7 @@ algokiller-plugin/

---

## Local smoke test (no Claude Desktop)
## Local smoke test (no Claude client needed)

```bash
printf '%s\n' \
Expand Down Expand Up @@ -266,7 +268,7 @@ Most likely cause: `${CLAUDE_PLUGIN_ROOT}` was not expanded by your Desktop buil
}
```

Check the Claude Desktop MCP server logs and grep for `[algokiller-mcp]` stderr lines.
Check the Claude client MCP server logs (Claude Desktop's application logs, or Claude Code session stderr) and grep for `[algokiller-mcp]` stderr lines.

### `bind_trace` fails with "binary not found" / "Permission denied"

Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

**语言**:**中文** | [English](README.en.md)

面向 ARM64 trace 证据分析与算法/密文还原的 **Claude Desktop plugin**。把 AlgoKiller 方法论打包为 skill,配本地 MCP server 驱动 native `ak_search` 引擎(14 个 subcommand,专攻 GB 级 trace)。
面向 ARM64 trace 证据分析与算法/密文还原的 **Claude 插件**(同时兼容 Claude Code CLI 与 Claude Desktop App)。把 AlgoKiller 方法论打包为 skill,配本地 MCP server 驱动 native `ak_search` 引擎(14 个 subcommand,专攻 GB 级 trace)。

> **方法论 + ak_search 引擎原作**:[AlgoKiller](https://github.com/lidongyooo/AlgoKiller) by [@lidongyooo](https://github.com/lidongyooo)
> 上游贡献 `match` / `context` / `daemon` 三个核心子命令(mmap + BMH + 行号索引 + tab 协议 daemon)以及原始方法论 harness。
> 本仓库在此之上额外扩展了 11 个 native 子命令(`regflow` / `producer` / `semop` / `lint` / `fold` / `callgraph` / `modgraph` / `hexblock` / `constscan` / `cryptoinstr` / `bytes`,详见 [tools/search/README.md](tools/search/README.md))并把整套打包为 Claude Desktop plugin。原始代码版权归上游作者;plugin 自身的扩展代码 MIT。
> 本仓库在此之上额外扩展了 11 个 native 子命令(`regflow` / `producer` / `semop` / `lint` / `fold` / `callgraph` / `modgraph` / `hexblock` / `constscan` / `cryptoinstr` / `bytes`,详见 [tools/search/README.md](tools/search/README.md))并把整套打包为 Claude 插件(Claude Code / Desktop 都能加载)。原始代码版权归上游作者;plugin 自身的扩展代码 MIT。

---

Expand Down Expand Up @@ -89,7 +89,9 @@ cp ak_search ../../server/bin/ak_search

> 一行装机命令见顶部 [🚀 快速安装](#-快速安装)。

**手动安装(备选)**:克隆仓库后在 Claude Desktop → `+` → **Plugins** → **Add plugin** → 选本地目录。
**手动安装(备选)**:克隆仓库后
- **Claude Desktop**:`+` → **Plugins** → **Add plugin** → 选本地目录
- **Claude Code**:在仓库根目录跑 `claude plugin install .`(或把仓库路径加进 `claude plugin marketplace add <local>`)

```bash
git clone https://github.com/icloudza/algokiller-plugin
Expand Down Expand Up @@ -129,7 +131,7 @@ frida -U -f com.example.app -l example.js
# 4. 拉回 trace 文件到 macOS
adb pull /data/data/com.example.app/trace.log ~/captures/login.trace.log

# 5. 喂给本 plugin(在 Claude Desktop 自然语言触发或敲 slash)
# 5. 喂给本 plugin(在 Claude Code / Claude Desktop 自然语言触发或敲 slash)
# 例如:"用 algokiller ciphertext 模式分析 ~/captures/login.trace.log,还原 X-Sign 密文 a3b2c1..."
```

Expand Down Expand Up @@ -210,7 +212,7 @@ algokiller-plugin/

---

## 本地 smoke test(不进 Claude Desktop)
## 本地 smoke test(不进任何 Claude 客户端)

```bash
printf '%s\n' \
Expand Down Expand Up @@ -279,7 +281,7 @@ trace 看"发生了什么",BN 看"代码长什么样"。装任一 BN MCP 自
}
```

查 Claude Desktop MCP server 日志,找 `[algokiller-mcp]` 开头的 stderr 行定位。
查 Claude 客户端的 MCP server 日志(Claude Desktop 在应用日志里,Claude Code 在 session stderr),找 `[algokiller-mcp]` 开头的 stderr 行定位。

### `bind_trace` 报 binary not found / Permission denied

Expand Down
9 changes: 5 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ release within **30 days** of confirmation.

## Threat model

`algokiller-plugin` is invoked by Claude Desktop with the user's local
privileges. It does **not** open network sockets, fetch remote content,
or accept input from anywhere other than:
`algokiller-plugin` is invoked by a Claude client (Claude Code or
Claude Desktop) with the user's local privileges. It does **not** open
network sockets, fetch remote content, or accept input from anywhere
other than:

1. The Claude Desktop MCP runtime (JSON-RPC 2.0 over stdio).
1. The Claude client's MCP runtime (JSON-RPC 2.0 over stdio).
2. The bound trace file (mmap, read-only).
3. The user's local static-analysis CLIs invoked via
`algokiller.run_static_tool` (argv list — never `/bin/sh`).
Expand Down
4 changes: 2 additions & 2 deletions examples/frida-gumtrace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ scp -P 2222 root@localhost:'/var/mobile/Containers/Data/Application/*/Documents/
~/captures/targetapp-startup.trace.log

# 4) 喂给 algokiller
# 在 Claude Desktop 里调 algokiller.bind_trace(path=..., mode='general')
# 在 Claude Code / Claude Desktop 里调 algokiller.bind_trace(path=..., mode='general')
```

> 用 `(sleep 35; echo) | frida ...` 给 stdin 喂超时管道 —— 避免 frida REPL 收 EOF 立即退出导致 setTimeout 没机会跑完。
Expand All @@ -245,7 +245,7 @@ const opt = Memory.alloc(8); opt.writeU64(<mode>)

## 8. trace 喂给 AlgoKiller plugin

trace 文件落到 macOS 后,在 Claude Desktop 里:
trace 文件落到 macOS 后,在 Claude Code / Claude Desktop 里:

```
algokiller.bind_trace(path="/Users/<you>/captures/targetapp-startup.trace.log", mode="ciphertext")
Expand Down
5 changes: 3 additions & 2 deletions hooks/dump-session-state.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def _find_latest_session() -> Path | None:
written session directory by scanning the user's likely artifact
roots in order.

The hook runs in the parent shell of Claude Desktop, which spawned
the MCP server; we don't have a reliable IPC channel back to it,
The hook runs in the parent shell of the Claude client (Claude Code
or Claude Desktop), which spawned the MCP server; we don't have a
reliable IPC channel back to it,
so the disk is our only source of truth. The 5-priority routing
means sessions can land in several places.
"""
Expand Down
3 changes: 2 additions & 1 deletion server/algokiller_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"""algokiller MCP server — JSON-RPC 2.0 over stdio, zero external deps.

Speaks MCP 2024-11-05 directly (initialize / tools/list / tools/call / ping).
Designed to be launched by Claude Desktop's plugin runtime via .mcp.json.
Designed to be launched by a Claude client's plugin runtime (Claude Code
or Claude Desktop) via .mcp.json.

The tool layer (schemas + handlers + dispatch table) lives in
`server/tools/`; this module is now a thin JSON-RPC plumbing layer plus
Expand Down
7 changes: 4 additions & 3 deletions server/picker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Cross-platform native directory picker for the `pick_output_dir` MCP tool.

The plugin's primary battleground is GUI clients (Claude Desktop, Cursor,
Codex). When the user wants to choose a report destination interactively,
The plugin's primary battleground is GUI clients (Claude Code, Claude
Desktop, Cursor, Codex). When the user wants to choose a report
destination interactively,
they say so; the agent calls `pick_output_dir(initial_dir=...)`, which
shells out to the host's native folder picker:

Expand Down Expand Up @@ -37,7 +38,7 @@
def _macos_pick(initial_dir: Optional[Path]) -> dict:
"""osascript folder picker. `initial_dir` becomes the default location
when the dialog opens. We `activate` first to bring the dialog in
front of Claude Desktop / the calling app."""
front of the Claude client / calling app."""
if initial_dir is not None and initial_dir.is_dir():
default_loc = f' default location (POSIX file "{initial_dir}")'
else:
Expand Down
2 changes: 1 addition & 1 deletion server/static_tools.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Allow-listed read-only static-analysis CLI runner.

Why this module exists:
Claude Desktop has a Bash tool, but exposing arbitrary shell to a plugin
Claude clients (Claude Code / Claude Desktop) have a Bash tool, but exposing arbitrary shell to a plugin
is risky and prompt-hard. This wrapper exposes a CURATED set of read-only
binary-analysis CLIs (radare2 family, GNU binutils, LLVM tools, Mach-O /
iOS specific, ripgrep, jq) through ONE MCP tool — `algokiller.run_static_tool`.
Expand Down
2 changes: 1 addition & 1 deletion skills/ciphertext-recovery/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: ARM64 trace 密文还原方法论。当用户给出一段 ARM64 执

# AlgoKiller — Ciphertext Recovery

你是 AlgoKiller 的密文还原 agent,运行在 Claude Desktop 中,通过 `ak` plugin 提供的 MCP 工具操作 trace 证据。
你是 AlgoKiller 的密文还原 agent,运行在 Claude 客户端中(Claude Code 或 Claude Desktop),通过 `ak` plugin 提供的 MCP 工具操作 trace 证据。

工作上下文:
- 当前 trace 文件已通过 `ak.bind_trace` 绑定到本次会话。后续所有 `ak.trace_search` / `ak.trace_context` 都自动作用于该 trace;工具调用中不要再传 trace 文件路径。
Expand Down
4 changes: 2 additions & 2 deletions skills/trace-analysis/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: ARM64 trace 通用证据分析方法论。当用户给出一段 ARM

# AlgoKiller — General Trace Analysis

你是 AlgoKiller 的通用 trace 分析 agent,运行在 Claude Desktop 中,通过 `ak` plugin 提供的 MCP 工具操作 trace 证据。
你是 AlgoKiller 的通用 trace 分析 agent,运行在 Claude 客户端中(Claude Code 或 Claude Desktop),通过 `ak` plugin 提供的 MCP 工具操作 trace 证据。

工作上下文:
- 当前 trace 文件已通过 `ak.bind_trace` 绑定到本次会话。后续所有 `ak.trace_search` / `ak.trace_context` 都自动作用于该 trace;工具调用中不要再传 trace 文件路径。
Expand Down Expand Up @@ -228,7 +228,7 @@ open thread: <发现描述>

- 用户提供的线索可能很少,这是本模式的正常输入,不是默认阻塞条件。字段名、语义、函数名、行号、请求上下文、样本和追踪方向都可能只是可选线索。
- 不要因为缺少字段名、业务语义、更多样本、源码符号或用户确认就停下来反问用户;必须先自行搜索和建立证据链。
- Claude Desktop 是聊天界面,提问技术上可以,但本模式默认你能从 trace 自己找答案;只有当目标本身缺失、无法判断用户要分析哪一段、同一任务中多个互相冲突的目标无法选定、或用户必须做业务选择时,才反问用户。
- Claude 客户端(Claude Code / Desktop)都是聊天界面,提问技术上可以,但本模式默认你能从 trace 自己找答案;只有当目标本身缺失、无法判断用户要分析哪一段、同一任务中多个互相冲突的目标无法选定、或用户必须做业务选择时,才反问用户。
- 如果用户要求的是解释/归因/字段表/执行流/检测点,不要默认要求写 Python 源码;只有算法复现、生成过程复现或用户明确要求代码时才写源码。

### 通用 trace 工具策略
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_e2e_mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Spawns `python3 server/algokiller_mcp.py` as a real subprocess, sends
JSON-RPC 2.0 frames over its stdin, and parses the JSON-RPC responses
on stdout — exactly how Claude Desktop drives the plugin.
on stdout — exactly how Claude clients (Claude Code / Claude Desktop) drive the plugin.

Covers two test surfaces the unit tests cannot reach:

Expand Down
Loading