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.
npx agentmods add skills/dslsdzc/rev-skills/re-cpp-abinpx skills add dslsdzc/rev-skills --skill re-cpp-abigit clone --depth 1 https://github.com/dslsdzc/rev-skillsWrote 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.
[](https://agentmods.dev/skills/dslsdzc/rev-skills/re-cpp-abi)<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>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.
| Model | Per session | Once 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 |
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.
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 --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]])。
-
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 特征辅助判断) - 识别错则后续全部偏——先确认再继续
- Itanium 特征:
-
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)遍历重建继承图
- 结构:
-
虚表恢复:
readelf -s sample | grep _ZTV | head_ZTV<类名>指向 vtable 起点(虚函数指针数组);vtable 前缀两槽位(32 位 8 字节 / 64 位 16 字节):offset to top + typeinfo 指针(Itanium ABI)- 定位 vtable 后:每个槽位的函数地址 → 调用点反推虚方法名(结合步骤 2 的继承图)
- 虚调用(
call *reg)无法静态定名 → 用调用点上下文(参数/返回值使用)缩小候选
-
异常处理表:
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 块)
- PE:
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.
- 5d ago First seen · 105 lines · 69 tokens per session scan A 12d862e7ebf8
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.
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…
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.
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.
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.
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…
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.