Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Re Cpp Abi

ASecurity

现代 C++ 二进制逆向:RTTI/异常/虚表恢复、ABI 识别、mangling 解码。 触发词:C++逆向、RTTI、虚表恢复、异常处理、C++ ABI、mangling、C++反编译。

54 stars
0 votes
0 copies
0 views
Added 9/19/2026
securityc++

Security Analysis

A100/100

Scanned 9/19/2026

Install to Claude Code

$npx -y skills add dslsdzc/rev-skills --skill re-cpp-abi --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Re Cpp Abi?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Re Cpp Abi
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dslsdzc-re-cpp-abi/badge)](https://www.skillsdirectory.com/skills/dslsdzc-re-cpp-abi)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: re-cpp-abi
type: atomic
description: >
  现代 C++ 二进制逆向:RTTI/异常/虚表恢复、ABI 识别、mangling 解码。
  触发词:C++逆向、RTTI、虚表恢复、异常处理、C++ ABI、mangling、C++反编译。
capabilities: [decompilation]
---

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

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

4. **异常处理表**:
   ```sh
   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 块)

5. **模板/lambda 识别**:
   - 模板:符号含 `<...>` 参数(Itanium mangling 中展开为长串);实例化爆炸时按调用模式聚类
   - lambda:Itanium 中 `_ZZ<作用域>ENK...` 特征、MSVC 中 `<lambda_...>`;lambda 局部类**无 RTTI**(步骤 2 缺失时反推)
   - 输出:疑似模板实例化/lambda 的函数清单 + 调用点

6. **mangling 解码(批量)**:
   ```sh
   readelf -s sample | grep -E '_ZN|_ZTV|_ZTI' | awk '{print $8}' | c++filt | head -20
   ```
   - MSVC: `undname` 或在线等价工具
   - 解码结果写入符号表(供 [[re-ghidra]] / [[re-ida]] 重命名)

## 跨域联合

- [[re-binary-core]] 网关:本技能归属(re-binary-core 选择树已挂载)
- [[re-ghidra]] / [[re-ida]]:反编译底座与脚本化
- [[re-deobfuscate]]:混淆与 ABI 分析衔接
- [[re-analyze/analysis-contract]]:类继承图/符号表按数据契约传递
- [[re-analyze/rerouting]]:RTTI/异常表特征触发本技能(A 表已挂)

## 常见坑与陷阱

- **ABI 误判导致全部解析失败**:现象——用 Itanium 结构解析 MSVC 目标(或反之)全盘错位;原因——识别步骤跳过;对策——先做步骤 1,mangling 特征双查
- **模板展开导致符号爆炸**:现象——readelf 输出几万行 `_Z...`;原因——模板实例化;对策——按调用模式聚类、过滤标准库符号(libstdc++/STL 前缀)
- **lambda 无 RTTI**:现象——类继承图缺节点;原因——lambda 局部类不生成 typeinfo;对策——按 `_ZZ` mangling 特征与调用点识别,不硬找 RTTI
- **异常表版本差异**:现象——.xdata 解析错位;原因——MSVC 异常处理版本(__CxxFrameHandler3 等)不同;对策——按导入函数(__CxxFrameHandler)确认版本再解析
- **虚调用无法静态定名**:现象——`call *reg` 全是间接调用;原因——虚分派;对策——结合 vtable 槽位与调用点证据缩小候选,不猜

Attribution

dslsdzcdslsdzc
View sourceMore from dslsdzc →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Springboot Security

Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。

2456590 votes

Security Review

Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.

2456590 votes

Summarize Status

Write a short, colloquial summary for a Paperclip summary slot: open with the 1–3 specific, concrete actions the reader needs to take right now to unblock the work, then a brief plain-language status, streaming progress as it works.

798220 votes

Paperclip Task Bridge

Create, comment on, update, and list Paperclip tasks from Hermes using scoped Paperclip API credentials.

798220 votes

V3 Security Overhaul

Complete security architecture overhaul for claude-flow v3. Addresses critical CVEs (CVE-1, CVE-2, CVE-3) and implements secure-by-default patterns. Use for security-first v3 implementation.

701370 votes
View all in security →