To analyze a Unity IL2CPP native binary (GameAssembly.dll on Windows or libil2cpp.so on Android) with full C# class names and signatures inside Ghidra, follow the standard Perfare/Il2CppDumper pipeline:
Step 1: Extract Metadata & Output Files
Run Il2CppDumper against the native binary and <Game>_Data/il2cpp_data/Metadata/global-metadata.dat. This outputs script.json, il2cpp.h, il2cpp_header_to_ghidra.py, and DummyDll/ stubs (inspectable in ILSpy/dnSpy).
Step 2: Convert Header Syntax for Ghidra
Standard il2cpp.h triggers C parser syntax errors in Ghidra unless converted first:
bash
python il2cpp_header_to_ghidra.pyThis produces il2cpp_ghidra.h.
Step 3: Import & Parse in Ghidra
- Import
GameAssembly.dllorlibil2cpp.sointo Ghidra's Code Browser and let Auto-Analysis finish. - Open File -> Parse C Source..., add
il2cpp_ghidra.h, and click Parse to populate the Data Type Manager. - Open Window -> Script Manager, add Il2CppDumper's script directory, run `ghidra_with_struct.py`, and select your generated `script.json` to rename every method RVA and attach type definitions automatically.