re-cpp-abi

re-cpp-abi is a skill for Claude Code from dslsdzc/rev-skills. It costs 69 tokens per session (1,824 once invoked), scanned A, original, Apache-2.0.

A tool for examining compiled modern C++ programs when the original source code is unavailable. It helps recover class information, virtual function tables, exception paths, and readable names from a binary file.

In plain words
What is it for?
Analyzing C++ binaries with tools such as readelf, llvm-objdump, c++filt, Ghidra, IDA, and optionally gdb. It is intended for programs that use runtime type information, virtual methods, or C++ exceptions.
Why use it?
Compiled C++ code can hide class relationships and function names, making reverse engineering difficult. This provides a documented process for identifying the compiler’s binary format and reconstructing those details.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dslsdzc/rev-skills/re-cpp-abi
Any agent
npx skills add dslsdzc/rev-skills --skill re-cpp-abi
Clone the repo
git clone --depth 1 https://github.com/dslsdzc/rev-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for re-cpp-abi

README.md
[![agentmods](https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-cpp-abi.svg)](https://agentmods.dev/skills/dslsdzc/rev-skills/re-cpp-abi)
Your own site
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-cpp-abi"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-cpp-abi.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,824 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.01824
Opus 5 $0.00034 $0.00912
Sonnet 5 $0.00014 $0.00365
Haiku 4.5 $0.00007 $0.00182

Measured 5d ago against content hash 12d862e7ebf8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

re-cpp-abi scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/re-cpp-abi/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

现代 C++ 逆向(RTTI / 异常 / 虚表)

何时使用 / 何时不用

  • 用:RTTI/异常表密集的二进制、反编译结果混乱的 C++ 目标(类层次/虚调用/异常流无法直接读出)
  • 不用:C 代码或纯汇编(走 [[re-binary-core]] 通用路径);混淆主导的目标(先 [[re-deobfuscate]])

工具准备

readelf / llvm-objdump(节表与异常表)

  • Linux: apt install binutils llvm / dnf install binutils llvm / pacman -S binutils llvm
  • macOS: brew install llvm(binutils 部分 macOS 自带)
  • Windows: WSL 或 llvm 预编译
  • 验证: readelf --versionllvm-objdump --version

c++filt / undname(mangling 解码)

  • Linux/macOS: c++filt(binutils 自带);Windows: undname(VS 工具链)
  • 验证: echo '_ZN3foo3barEv' | c++filt(输出 foo::bar()

Ghidra / IDA(反编译底座,脚本化 RTTI 遍历)

  • 安装与验证见 [[re-ghidra]] / [[re-ida]] 工具准备

gdb(异常断点,可选)

  • 安装与验证见 [[re-gdb]]

操作步骤

按顺序执行,每步产物存档(路径 + sha256,见 [[re-triage]])。

  1. ABI 识别

    readelf -s sample | grep -E '_ZN|_ZTV|_ZTI' | head    # Itanium(GCC/Clang)
    strings sample | grep -E '^\?\?_' | head              # MSVC
    
    • Itanium 特征:_ZN(函数)、_ZTV(虚表)、_ZTI(RTTI 类型信息)
    • MSVC 特征:??_7(vftable)、??_R(RTTI)(strip 后 ??_ 在符号表而非字符串区——补查导入表 __CxxFrameHandler / msvcp 特征辅助判断)
    • 识别错则后续全部偏——先确认再继续
  2. RTTI 重建(Itanium)

    readelf -s sample | grep _ZTI | head
    # _ZTI<类名> 指向 typeinfo;typeinfo 首 8 字节 vptr 指向 _ZTVN10__cxxabiv1... 类型信息虚表(+8 为类型名指针)
    
    • 结构:typeinfo__class_type_info 派生链 → 每个类的完整继承路径
    • 脚本化:Ghidra/IDA 遍历 _ZTI 引用,重建类继承图(父子关系表)
    • 产出:类名 → 继承链映射(写入会话 symbols_known,见 [[analysis-contract]])
    • MSVC:??_R0<类名> TypeDescriptor 符号 + _RTTICompleteObjectLocator(COL)遍历重建继承图
  3. 虚表恢复

    readelf -s sample | grep _ZTV | head
    
    • _ZTV<类名> 指向 vtable 起点(虚函数指针数组);vtable 前缀两槽位(32 位 8 字节 / 64 位 16 字节):offset to top + typeinfo 指针(Itanium ABI)
    • 定位 vtable 后:每个槽位的函数地址 → 调用点反推虚方法名(结合步骤 2 的继承图)
    • 虚调用(call *reg)无法静态定名 → 用调用点上下文(参数/返回值使用)缩小候选
  4. 异常处理表

    readelf -S sample | grep -E 'eh_frame|gcc_except'   # ELF:.eh_frame(readelf 不解析 PE,PE 走下方命令)
    llvm-readobj --coff-unwind-info sample.exe            # PE:.pdata/.xdata(或 objdump -h / pefile)
    
    • PE:.pdata 的 RUNTIME_FUNCTION(Begin/End/UnwindInfo)→ .xdata 展开数据 → 异常处理器(__CxxFrameHandler3)
    • ELF:.eh_frame 的 FDE/CIE → 展开规则与 LSDA(.gcc_except_table)→ 异常处理函数
    • 用途:恢复被异常路径打断的控制流、定位析构/清理逻辑(catch 块)

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 105 lines · 69 tokens per session scan A 12d862e7ebf8

Subscribe to this mod's changes

re-cpp-abi is a skill published in the GitHub repository dslsdzc/rev-skills (40 stars, last pushed 7d ago), licensed Apache-2.0. It adds 69 tokens to every session and 1,824 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware in Ghidra by parsing Go buildinfo and pclntab structures, recovering stripped/obfuscated function names (e.g. via GoResolver), and extracting embedded module/dependency strings and types from Go binaries. Use when analyzing a Go-language malware sample, deobfuscating a…

Youngmaidainon/Agent-Level-Up · 95 tokens

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware using Ghidra with specialized scripts for function recovery, string extraction, and type reconstruction in stripped Go binaries.

plurigrid/asi · 40 tokens

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware using Ghidra with specialized scripts for function recovery, string extraction, and type reconstruction in stripped Go binaries.

26zl/cybersec-toolkit · 40 tokens

analyzing-golang-malware-with-ghidra

Use when reverse engineer Go-compiled malware using Ghidra with specialized scripts for function recovery, string extraction, and type reconstruction in stripped Go binaries. Use when reverseing engineer go-compiled malware using ghidra with specialized scripts for.

oyi77/1ai-skills · 60 tokens

analyzing-windows-prefetch-with-python

Parse Windows Prefetch (.pf) files with the windowsprefetch Python library to reconstruct application execution history, run counts, and accessed file/volume lists. Use when investigating renamed or masquerading binaries, verifying program execution timelines, or hunting for suspicious execution patterns in incident…

Youngmaidainon/Agent-Level-Up · 66 tokens

analyzing-golang-malware-with-ghidra

Reverse engineer Go-compiled malware using Ghidra with specialized scripts for function recovery, string extraction, and type reconstruction in stripped Go binaries.

autohandai/community-skills · 40 tokens