本文へスキップ
Skillpedia
セキュリティ6.5k · #14163

deep-analysis

できること

このスキルは、プログラムの1つの領域を深く理解するための、慎重で段階的な方法を説明します。学びたい部分をすでに見つけているリバースエンジニア向けです。

使う場面

  • ✓分析者が不審な関数をすでに見つけ、その正確な動作を知りたいとき。
  • ✓リサーチャーが、プログラム内の暗号化の方式やデータ構造を特定する必要があるとき。
  • ✓チームが、マルウェアのサンプルが使う通信プロトコルを追跡したいとき。

スキルのリンク

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/deep-analysis/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/reverser/deep-analysis/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“プログラムのこの関数が正確に何をするのか、段階を追って説明してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

このスキルはAIに、明確な質問を1つ立て、そのうえでコードの逆コンパイル、名前の変更、説明、コメントの追加を繰り返すよう指示します。以前の手順を見失わないよう、メモを残します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Deep Binary Analysis Loop

Depth-first RE for full understanding of a specific target area. Distinct from breadth-first triage (reverser/triage) — here you don't stop at a signal, you keep iterating until the function is fully understood.

Core Principle: Narrow → Deep

Triage finds the surface; deep-analysis excavates one shaft. Commit to one question at a time. Context-rot (losing track of what you've already renamed or retyped) is the primary failure mode — guard against it explicitly.

1. Entry Point

Before decompiling anything, state the question in writing:

kg_add_node("hypothesis", "deep-analysis target",
  props={"question": "<exact question, e.g. 'what does sub_401A20 do'>",
         "binary": "/workspace/target",
         "entry_function": "<hex addr or name>",
         "key": "deep-analysis:entry"})

Commit to one question. Do not pivot mid-session unless the current function is fully annotated and the answer is "it delegates to X".

2. Decompile→Rename→Retype→Comment Loop

For each function under analysis, follow this cycle exactly:

2a. Decompile

In hosted runs, use ghidra_find_tools(query="decompile") to discover the native decompiler tool and its argument schema, then pass the imported program and target function. Do not infer a decompiler call from a local-only example. Read the full output before touching anything.

2b. Rename all locals and parameters

As soon as you understand a variable's purpose, rename it. Collect related renames and use the native rename tool discovered with ghidra_find_tools(query="rename"); inspect its schema before calling it. Do not leave a decompiled function with placeholder names (param_1, local_8, uVar1) if you know what they are.

2c. Retype parameters and locals

Correct types catch bugs in decompiler reasoning. Discover the native type editing operation with ghidra_find_tools(query="type") and use the returned schema for the active program. Pay special attention to: size_t vs int (sign confusion), pointer-as-int patterns, struct pointer vs void*, callback function pointers.

2d. Add inline comments

At every branch point whose purpose is now understood, add a comment with the native annotation tool discovered by ghidra_find_tools(query="comment").

2e. Re-read the decompilation

After rename+retype, decompile again. The output will often look dramatically cleaner and reveal previously hidden logic.

Repeat 2a–2e until the function's purpose is unambiguous.

3. On-Task Check (every 3–5 tool calls)

After each batch of tool calls, answer explicitly:

  1. Is the current function still the right place to dig?
  2. Have I renamed every local/param I now understand?
  3. Have I documented what this function does (even partially) in the KG?
  4. Am I still working toward the original question, or have I drifted?

If you've called into a callee 3+ levels deep without updating the KG, that's context-rot — surface the findings upward before going deeper.

kg_add_node("note", "deep-analysis progress",
  props={"function": "decrypt_config_blob",
         "finding": "RC4 variant — XOR stream cipher, 16-byte key from .rdata:0x40D0C0",
         "status": "complete",
         "key": "deep-analysis:decrypt_config_blob"})

4. Per-Question Strategies

"What does function X do?"

  1. Decompile X.
  2. List callees with the registered ghidra_get_xrefs_from tool for the imported program; use ghidra_find_tools when another reference view is needed.
  3. For each callee, check if it's a library stub (look up import table) or custom code. Library stubs → infer semantics from function name. Custom code → recurse one level.
  4. Draw the call path as a KG calls edge chain.
  5. Answer: input/output contract, side effects, return value semantics.

"Identify crypto primitive"

High-entropy constants are the fastest path:

# Search for known crypto constants (AES S-box, RC4 init, ChaCha sigma, etc.)
grep -r "0x63636363\|0x6B617479\|0xE2280613\|0xDB3D18\|0x61707865\|0x3320646E" \
  /workspace/target.bin 2>/dev/null || true

# Capa identifies crypto more reliably
capa /workspace/target --json > /workspace/capa_crypto.json
cat /workspace/capa_crypto.json | python3 -c "
import json, sys
d = json.load(sys.stdin)
for r in d.get('rules', {}).values():
    if 'crypto' in r.get('rule',{}).get('namespace','').lower():
        print(r['rule']['name'])
"

Constants to recognize:

Constant Algorithm
よくある質問

簡易のトリアージとはどう違いますか?

トリアージは幅広く手がかりを探しますが、この方法は1つの領域を完全に理解できるまで深く掘り下げます。

どのような目的に役立ちますか?

サンプル内の暗号化、コマンドの構造、通信プロトコルを特定するのに役立ちます。

特別なツールが必要ですか?

リバースエンジニアリングの環境が提供する逆コンパイラを使います。

詳細

作者による元の説明

Depth-first RE investigation loop for a single binary or function cluster: decompile→rename→retype→comment→re-read, with context-rot guards and on-task checks. Use when triage has already identified the interesting area and the goal is full understanding: what does function X do, identify cryptographic primitives, locate C2 protocol, recover data structures. Triggers on: 'deep analysis', 'understand function', 'recover struct', 'crypto identification', 'C2 protocol', 'reverse this binary fully', 'what does this function do'.

repo: BitterSecurity/Decepticon

人気

GitHubのスター
6.5k
ランキング
#14163
ライセンス
Apache-2.0
更新日
2026/11/1

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル