ps2-cpp-rtti
/ps2-cpp-rtti
Recover C++ class names, type_info objects, type-info (__tf) functions and vtables from PlayStation 2 executables with ps2re rtti - GCC 2.9x old ABI (Q24Foo3Bar names, __tf functions, {delta,index,pfn} vtables) and GCC 3+ Itanium ABI (_ZTV/_ZTI/_ZTS, .gnu.linkonce sections), stripped or not. Use to map classes, find virtual methods, or name constructors and vtables in a PS2 C++ game.
- Author
- glampert ↗
- Repository
- ps2-re-tools ↗
- Licence
- MIT
- Last repository change
- 13.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 13.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Recover C++ class names, type_info objects, type-info (__tf) functions and vtables from PlayStation 2 executables with ps2re rtti - GCC 2.9x old ABI (Q24Foo3Bar names, __tf functions, {delta,index,pfn} vtables) and GCC 3+ Itanium ABI (_ZTV/_ZTI/_ZTS, .gnu.linkonce sections), stripped or not. Use to map classes, find virtual methods, or name constructors and vtables in a PS2 C++ game.
Original author description
Recover C++ class names, type_info objects, type-info (__tf) functions and vtables from PlayStation 2 executables with ps2re rtti - GCC 2.9x old ABI (Q24Foo3Bar names, __tf functions, {delta,index,pfn} vtables) and GCC 3+ Itanium ABI (_ZTV/_ZTI/_ZTS, .gnu.linkonce sections), stripped or not. Use to map classes, find virtual methods, or name constructors and vtables in a PS2 C++ game.
How it works
- Using the results
- Pitfalls
SKILL.md preview
---
name: ps2-cpp-rtti
description: Recover C++ class names, type_info objects, type-info (__tf) functions and vtables from PlayStation 2 executables with ps2re rtti - GCC 2.9x old ABI (Q24Foo3Bar names, __tf functions, {delta,index,pfn} vtables) and GCC 3+ Itanium ABI (_ZTV/_ZTI/_ZTS, .gnu.linkonce sections), stripped or not. Use to map classes, find virtual methods, or name constructors and vtables in a PS2 C++ game.
---
# C++ RTTI recovery
```sh
ps2re rtti GAME.ELF -o rtti.tsv
ps2re rtti GAME.ELF --functions export/functions.tsv -o rtti.tsv # name the referencing functions
ps2re rtti GAME.ELF --strict # only classes with a recovered vtable
```
Columns: `class mangled name_addr typeinfo ref_funcs vtables data_refs abi`
| Column | GCC 2.9x | GCC 3+ |
|---|---|---|
| `name_addr` | mangled name string | `_ZTS` string |
| `typeinfo` | static type_info `{vptr, &name}` (often empty: built at run time in .bss) | `_ZTI` object |
| `ref_funcs` | functions referencing name/type_info = the `__tf<class>` type-info function | rarely useful |
| `vtables` | data with `{0, __tf}` as slot 0 → vtable start | `{offset_to_top, &typeinfo}` → vtable start (address points must add 8) |
| `data_refs` | other data words pointing at `__tf` (engine class descriptors, RTTI base lists) | — |
| `abi` | `gcc2`, `gcc3`, `+sym` when confirmed by symbols / `.gnu.linkonce.*` names | |
## Using the results
- Virtual methods: GCC 2 vtable slots are 8 bytes `{s16 delta, s16 index,
void *pfn}`; slot 0 is `__tf`, methods follow. GCC 3 vtables are plain
pointers starting at vtable+8. Run `CreateDataRefFuncs.java` in Ghidra so
every slot target becomes a function, then name them `Class::vfuncN`.
- Constructors store the vtable address into `this` (`lui/addiu` then
`sw rX, 0(a0)` or a fixed offset): `ps2re refs GAME.ELF <vtable>` lists
them (GCC 3: search for vtable+8).
- Class hierarchy: GCC 2 `__tf` functions call the parent's `__tf` and
`__rtti_si`/`__rtti_class`; GCC 3 `__si_class_type_info` has the base
type_info at +8.
## Pitfalls
- Name candidates are pattern matches; GCC 2 names with no evidence are
kept only when Q-qualified or clearly class-like. Template names are
shortened to `Name<...>` (arguments elided).
- On stripped ELFs without `--functions`, function starts are guessed
from `jr ra` boundaries (`sub_XXXXXXXX`); GCC 2 vtables are still found
(they only need the `__tf` start), but pass a Ghidra `functions.tsv` for
reliable `ref_funcs`.
Versions
The database has no other skills named ps2-cpp-rtti.
Database snapshot: 13.11.2026 · package version 4b275cdd54fd (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100ps2-strings-xrefs
Extract and classify strings from PlayStation 2 ELFs (SDK ids, RTTI names, source paths, printf/assert/debug messages, device file paths, identifiers, UI text) and cross-reference data strings or arbitrary addresses with the EE code that references them (lui/addiu pairs,… - 100ps2-build-diff
Compare PlayStation 2 executable builds and transfer knowledge between them with ps2re elfdiff (section table, added/removed/changed functions by relocation-masked hash) and ps2re match (propagate function names from a symbolized build - demo, beta, other region - to a stripped… - 100mormot2-core
Use when working with mORMot 2 core types (RawUtf8, RawByteString, TSynLocker, TDocVariant), mormot.defines.inc, unit order, JSON, or RTTI. Do NOT use for ORM/REST/DB/Net/Crypto: use sibling skills. - 90cc-cpp-project-standard
Use when C++ module/header boundaries, resource lifetime, exception safety, ABI, build-standard conventions or project-wide C++ checks need design or review. - 100cpp
Guides C++17/20/23 code: ownership and lifetimes, concurrency, CMake targets and ABI. Use when writing or reviewing .cpp/.hpp or CMakeLists.txt, chasing a dangling string_view or span, a coroutine or callback lifetime bug, atomic ordering, an ODR/ABI mismatch between targets, or a sanitizer report. - 100gcc
GCC compiler skill for C/C++ projects. Use when selecting optimization levels, warning flags, debug builds, LTO, sanitizer instrumentation, or diagnosing compilation errors with GCC. Covers flag selection for debug vs release, ABI concerns, preprocessor macros, profile-guided…