il2cpp_dumper 0.4.0

A blazing fast and reliable il2cpp dumper cross platfrom.
Documentation
<p align="center">
  <img src="https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=rust&logoColor=white" />
  <img src="https://img.shields.io/badge/IL2CPP-v16--v39-blueviolet?style=for-the-badge" />
  <img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" />
</p>

<h1 align="center">๐Ÿ›ก๏ธ Rodroid Il2CppDumper V4</h1>

<p align="center">
  <b>A blazing-fast, cross-platform IL2CPP binary dumper written in Rust.</b><br/>
  Full rewrite from the original C# <a href="https://github.com/Perfare/Il2CppDumper">Il2CppDumper</a> with significant performance improvements, modern CLI UI, and advanced features.
</p>

<p align="center">
  <a href="https://t.me/+WmudnO0-xoNhMDQ8">๐Ÿ“ข Telegram Channel</a> &nbsp;ยท&nbsp;
  <a href="https://t.me/+QylrYL1GNsJiYjc0">๐Ÿ’ฌ Telegram Group</a> &nbsp;ยท&nbsp;
  <b>Dev:</b> <a href="https://t.me/rodroidmods"><code>@rodroidmods</code></a>
</p>

---

## ๐Ÿ† Feature Comparison โ€” Rust vs C# vs Python

| Feature | [Python]https://github.com/springmusk026/Il2CppDumper-Python | [C#]https://github.com/Perfare/Il2CppDumper | **Rust (This)** |
|---------|:---:|:---:|:---:|
| **dump.cs generation** | โš ๏ธ Basic (no properties) | โœ… Full | โœ… Full |
| **DummyDLL generation** | โŒ No | โœ… Yes | โœ… Yes (parallel) |
| **il2cpp.h struct gen** | โš ๏ธ Basic | โœ… Full | โœ… Full |
| **script.json** | โœ… Yes | โœ… Yes | โœ… Yes |
| **stringliteral.json** | โœ… Yes | โœ… Yes | โœ… Yes |
| **Split Dump Per Type (DiffableCS)** | โŒ No | โŒ No | โœ… **Yes (parallel)** |
| **Variable-width indices (v39/Unity 6)** | โŒ No | โŒ No | โœ… **Yes** |
| **Auto-XOR Metadata Decryption** | โŒ No | โŒ No | โœ… **Yes** |
| **Latest Unity Formats (v104, v106)** | โŒ No | โŒ No | โœ… **Yes** |
| **Assembly name in dump.cs** | โŒ No | โŒ No | โœ… **Yes** |
| **Unity version detection** | โŒ No | โŒ No | โœ… **Auto-detect** |
| **Inline Disassembly (ARM64/ARM32/x86/x64)** | โŒ No | โŒ No | โœ… **Yes** |
| **Control Flow Graph (CFG) Analysis** | โŒ No | โŒ No | โœ… **Yes** |
| **Metadata Annotations (strings, types, vtable)** | โŒ No | โŒ No | โœ… **Yes** |
| **Semantic Variable Tracking** | โŒ No | โŒ No | โœ… **Yes** |
| **Fat Mach-O (Universal)** | โŒ No | โœ… Yes | โœ… Yes |
| **WASM (WebGL)** | โœ… Yes | โœ… Yes | โœ… Yes |
| **Dump file support** | โŒ No | โœ… Yes | โœ… Yes (+ ELF reload) |
| **v27+ ImageBase fix** | โŒ No | โœ… Yes | โœ… Yes |
| **Parallel I/O (`rayon`)** | โŒ No | โŒ No | โœ… **Yes** |
| **Auto-numbered output dirs** | โŒ No | โŒ No | โœ… **Dump0/, Dump1/...** |
| **Modern CLI UI (spinners, colors, prompts)** | โŒ No | โŒ No | โœ… **Yes** |
| **Cross-platform binary** | โš ๏ธ Needs Python | โš ๏ธ Needs .NET | โœ… **Standalone** |
| **C++ Scaffold (il2cpp-functions.h)** | โŒ No | โŒ No | โœ… **Yes** |
| **C++ Name Mangling (Itanium ABI)** | โŒ No | โŒ No | โœ… **Yes** |
| **Unity Header Auto-Detection** | โŒ No | โœ… Yes | โœ… **Yes (version-matched)** |
| **cpp_project/ Scaffolding** | โŒ No | โœ… Yes | โœ… **Yes** |
| **Topological Sort (type ordering)** | โŒ No | โŒ No | โœ… **Yes** |
| **Type Group Classification** | โŒ No | โŒ No | โœ… **Yes** |
| **Enhanced IDA Metadata** | โŒ No | โŒ No | โœ… **Yes** |
| **ELF Section Header Symbol Fallback** | โŒ No | โœ… Yes | โœ… **Yes** |
| **GUI** | โŒ No | โœ… WinForms | โœ… **Jetpack Compose + Tauri** |
| **Embeddable as library** | โŒ No | โŒ No | โœ… **Rust crate / JNI** |

### โšก Performance

| Phase | Python | C# | **Rust** |
|-------|:---:|:---:|:---:|
| Metadata loading | ~3.7s | ~2s | **~0.5s** |
| Binary loading | ~5.2s | ~3s | **~0.8s** |
| Search & Init | ~5.4s | ~2s | **~0.3s** |
| dump.cs | ~14s | ~5s | **~2s** |
| Struct generation | ~6.4s | ~5s | **~3.5s** |
| DummyDLL | โŒ N/A | ~3s | **~1.5s** |
| **Total** | **~35s** | **~20s** | **~5โ€“8s** |

> **4ร— faster than Python, 2.4ร— faster than C#** โ€” on the same binary.

---

## โœจ Features

### Core Dumping
- **dump.cs** โ€” Full C# class/method/field/property decompilation with RVA/VA/Offset and assembly names
- **Inline Disassembly** โ€” Optional per-method native assembly embedded directly in dump.cs
- **DiffableCs** โ€” Splits classes into individual `.cs` files by namespace, parallelized with `rayon`
- **script.json** โ€” Method addresses/signatures for IDA/Ghidra scripting
- **il2cpp.h** โ€” C struct definitions for native analysis with topological type ordering
- **stringliteral.json** โ€” All string literal values and indices
- **DummyDLL** โ€” Reconstructed .NET assemblies for dnSpy/ILSpy (parallelized)

### C++ Headers & Scaffolding
- **il2cpp-functions.h** โ€” C++ scaffold with function pointer typedefs for hooking
- **Itanium ABI Name Mangling** โ€” Correct C++ mangled names for all IL2CPP types
- **Unity Header Auto-Detection** โ€” Version-matched `il2cpp-types.h` and `il2cpp-api.h` from embedded header database
- **cpp_project/** โ€” Ready-to-compile C++ project scaffold with includes and CMake structure
- **Topological Sort** โ€” Types emitted in dependency order; circular dependencies detected with fallback
- **Type Group Classification** โ€” Types categorized into forward declarations, method types, generic types, usage types
- **Compiler Layout** โ€” GCC (`__attribute__`) or MSVC (`__declspec`) layout attributes
- **Enhanced IDA Metadata** โ€” Extra type info annotations for IDA Pro scripts

### Disassembly Engine
- **Multi-Architecture** โ€” ARM64 (`yaxpeax-arm`), ARM32, x86/x64 (`iced-x86`)
- **Control Flow Graph (CFG)** โ€” Basic block detection, branch targets, loop back-edges, `if (condition)` reconstruction
- **Metadata Annotations** โ€” String literals, type info, method/field references, vtable resolution via `ADRP+LDR` patterns
- **Semantic Variable Tracking** โ€” Maps registers to parameter names (`X0` โ†’ `this`, `X1` โ†’ `arg0`)
- **Configurable** โ€” Toggle hex bytes, field names, annotations, CFG independently

### Supported Platforms

| Platform | Format | Status |
|----------|--------|:---:|
| Android | ELF32 / ELF64 | โœ… |
| iOS / macOS | Mach-O / Fat Mach-O | โœ… |
| Windows | PE32 / PE64 | โœ… |
| Nintendo Switch | NSO | โœ… |
| WebGL | WASM | โœ… |

### IL2CPP Versions
- **v16 โ€“ v39** (Unity 5.3 โ†’ Unity 6)
- Variable-width indices for v39/Unity 6
- Latest undocumented formats: `v104`, `v106`
- Auto XOR metadata decryption (1-byte, 4-byte, 8-byte, rolling, position-dependent, header-only)
- Manual version override via config

### Search Strategies
- **SectionHelper** โ€” Format-aware section scanning
- **Symbol Search** โ€” ELF/Mach-O symbol table lookup
- **ARM32 Search** โ€” Dedicated binary pattern matching
- **\_\_mod\_init\_func** โ€” Mach-O initializer analysis
- **Manual mode** โ€” Enter addresses as fallback

---

## ๐Ÿ“ฆ Installation

### From Source
```bash
git clone https://github.com/rodroidmods/il2cpp-dumper-rs.git
cd il2cpp-dumper-rs/il2cpp_dumper
cargo build --release
```

The binary will be at `target/release/il2cpp_dumper` (`.exe` on Windows).

### Cross-Compilation
```bash
# Linux
cargo build --release --target x86_64-unknown-linux-gnu

# macOS
cargo build --release --target aarch64-apple-darwin

# Android (via cross)
cross build --release --target aarch64-linux-android
```

---

## ๐Ÿ”ง Usage

```bash
il2cpp_dumper <il2cpp-binary> <global-metadata.dat> [output-dir]
```

### Examples
```bash
il2cpp_dumper libil2cpp.so global-metadata.dat
il2cpp_dumper GameAssembly.dll global-metadata.dat ./output
il2cpp_dumper UnityFramework global-metadata.dat
```

### Example Output
```
  Rodroid Il2CppDumper

    โ•ฆโ•ฆ  โ•”โ•โ•—โ•”โ•โ•—โ•”โ•โ•—  โ•”โ•ฆโ•—โ•ฆ โ•ฆโ•”โ•ฆโ•—โ•”โ•โ•—โ•”โ•โ•—โ•ฆโ•โ•—
    โ•‘โ•‘  โ• โ•โ•โ•‘  โ• โ•โ•   โ•‘โ•‘โ•‘ โ•‘โ•‘โ•‘โ•‘โ• โ•โ•โ•‘โ•ฃ โ• โ•ฆโ•
    โ•ฉโ•ฉโ•โ•โ•š  โ•šโ•โ•โ•ฉ    โ•โ•ฉโ•โ•šโ•โ•โ•ฉ โ•ฉโ•ฉ  โ•šโ•โ•โ•ฉโ•šโ•
    Version v0.4.0
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  ๐Ÿ“‚ Output .\Dump0

  โ”€โ”€โ”€ Binary Analysis โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  โœ“ Binary loaded: libil2cpp.so (52.43 MB)
  Unity Version: 2022.3.62f2
  โœ“ Metadata loaded: global-metadata.dat (10.88 MB)
  Metadata Version: 31
  Type Definitions: 13815
  Method Definitions: 93772

  โ”€โ”€โ”€ Format Detection โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  ๐Ÿ” Detected ELF64 format
  IL2CPP Version: 31
  CodeRegistration: 0x44e5ff8
  MetadataRegistration: 0x465a328

  โ”€โ”€โ”€ Output Generation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  โœ“ dump.cs generated
  โœ“ script.json, il2cpp.h, stringliteral.json generated
  โœ“ Dummy DLL files generated

  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
  โœจ All tasks completed successfully!
  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  ๐Ÿ“‚ Output Directory: .\Dump0
  ๐Ÿ“ฆ Generated Files: dump.cs, script.json, il2cpp.h, stringliteral.json, DummyDll/*.dll
  ๐Ÿš€ Elapsed: 8.35s
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
```

---

## โš™๏ธ Configuration

Create a `config.json` in the working directory (or use `--config`):

```json
{
  "ForceIl2CppVersion": false,
  "ForceVersion": 29.0,
  "ForceDump": false,
  "NoRedirectedPointer": false,
  "GenerateStruct": true,
  "GenerateDummyDll": true,
  "DummyDllAddToken": true,
  "dumpDisassembly": false,
  "dumpDisassemblyHexBytes": true,
  "dumpDisassemblyFieldNames": true,
  "dumpDisassemblyAnnotations": true,
  "dumpDisassemblyCfg": true,
  "maxDisassemblyInstructions": 512,
  "generateCppScaffold": true,
  "mangleNames": true,
  "enhancedIdaMetadata": true,
  "generateUnityHeaders": true,
  "compilerLayout": "GCC",
  "useTopologicalSort": true
}
```

---

## ๐Ÿ—๏ธ Architecture

```
il2cpp_dumper/src/
โ”œโ”€โ”€ main.rs                           # CLI, format detection, orchestration
โ”œโ”€โ”€ config.rs                         # Configuration handling
โ”œโ”€โ”€ formats/                          # Binary format parsers
โ”‚   โ”œโ”€โ”€ elf.rs                        # ELF32/64 (Android, Linux)
โ”‚   โ”œโ”€โ”€ pe.rs                         # PE32/64 (Windows)
โ”‚   โ”œโ”€โ”€ macho.rs                      # Mach-O + Fat Mach-O (iOS, macOS)
โ”‚   โ”œโ”€โ”€ nso.rs                        # NSO (Nintendo Switch)
โ”‚   โ””โ”€โ”€ wasm.rs                       # WebAssembly (WebGL)
โ”œโ”€โ”€ il2cpp/                           # IL2CPP structures and metadata
โ”‚   โ”œโ”€โ”€ base.rs                       # Il2Cpp main struct
โ”‚   โ”œโ”€โ”€ metadata.rs                   # Metadata parser
โ”‚   โ””โ”€โ”€ structures.rs                 # IL2CPP type definitions
โ”œโ”€โ”€ search/                           # Registration search algorithms
โ”‚   โ””โ”€โ”€ section_helper.rs
โ”œโ”€โ”€ executor/                         # IL2CPP type resolution engine
โ”œโ”€โ”€ disassembler/                     # Multi-arch disassembly engine
โ”‚   โ”œโ”€โ”€ mod.rs                        # CFG analysis, annotations, formatting
โ”‚   โ”œโ”€โ”€ arm.rs                        # ARM64/ARM32 decoder (yaxpeax)
โ”‚   โ””โ”€โ”€ x86.rs                        # x86/x64 decoder (iced-x86)
โ””โ”€โ”€ output/                           # Output generators
    โ”œโ”€โ”€ decompiler.rs                 # dump.cs + inline disassembly
    โ”œโ”€โ”€ struct_generator.rs           # script.json, il2cpp.h, type classification
    โ”œโ”€โ”€ dummy_assembly_generator.rs   # DummyDLL (parallel)
    โ”œโ”€โ”€ cpp_scaffolding.rs            # il2cpp-functions.h generation
    โ”œโ”€โ”€ cpp_ast.rs                    # C++ AST emission with group annotations
    โ”œโ”€โ”€ cpp_type_model.rs             # C++ type model from IL2CPP types
    โ”œโ”€โ”€ cpp_type_dependency_graph.rs  # Topological sort + cycle detection
    โ”œโ”€โ”€ name_mangler.rs               # Itanium ABI C++ name mangling
    โ”œโ”€โ”€ header_manager.rs             # Unity header version matching
    โ””โ”€โ”€ unity_version.rs              # Unity version parsing & ranges
```

---

## ๐Ÿ“œ License

MIT

---

## ๐Ÿ™ Credits

- [Perfare/Il2CppDumper]https://github.com/Perfare/Il2CppDumper โ€” Original C# implementation
- [SamboyCoding/Cpp2IL]https://github.com/SamboyCoding/Cpp2IL โ€” Advanced C# IL2CPP analysis tool
- [springmusk026/Il2CppDumper-Python]https://github.com/springmusk026/Il2CppDumper-Python โ€” Python port
- [LukeFZ/Il2CppInspectorRedux]https://github.com/LukeFZ/Il2CppInspectorRedux โ€” Thanks for the code i used in v4 of my il2cppdumper, but its more faster since the logic its on rust and not C#
- [dotnetdll]https://crates.io/crates/dotnetdll โ€” .NET DLL generation crate
- [rayon]https://crates.io/crates/rayon โ€” Parallel processing
- [console-rs]https://github.com/console-rs โ€” Terminal styling ecosystem (`console`, `indicatif`, `dialoguer`)

---

## ๐Ÿ“ฌ Community

| | Link |
|---|---|
| ๐Ÿ“ข **Telegram Channel** | [Join Channel]https://t.me/+WmudnO0-xoNhMDQ8 |
| ๐Ÿ’ฌ **Telegram Group** | [Join Group]https://t.me/+QylrYL1GNsJiYjc0 |
| ๐Ÿ‘ค **Developer** | [`@rodroidmods`]https://t.me/rodroidmods |

---

> **โš ๏ธ Disclaimer**: This tool is for educational and research purposes only. Respect game developers' rights and terms of service.