Games & PackagedZero Extra Tools NeededMCP Tool: inspect_il2cpp_metadata

How to REA Unity IL2CPP Games: global-metadata.dat, GameAssembly & Ghidra Seeds

Deconstruct Ahead-Of-Time (AOT) compiled Unity games and mobile apps: decode global-metadata.dat (versions 24-39), link method tokens to GameAssembly.dll or libil2cpp.so, and export Ghidra analysis seeds without running the game.

AI Overview Direct AnswerHow to REA: Unity IL2CPP Games & Binaries Quickstart Summary

In this official REA guide for Unity IL2CPP Games & Binaries, AI coding agents (Claude Code, Cursor, Windsurf) execute 'rea inspect-il2cpp-metadata ./global-metadata.dat --binary ./libil2cpp.so --ghidra-seeds seeds.json --json' to safely extract file layout, symbols, and code logic without launching unverified binaries.

Investigation ScenarioReal-World Objective

The Problem & Target Artifact

Mobile game penetration testing or desktop Unity game modding: The game's executable is stripped of all C# symbols. You have global-metadata.dat and GameAssembly.dll/libil2cpp.so, and need to find the PlayerEconomy and AntiCheat functions.

Target Artifact: global-metadata.dat and matching native binary (GameAssembly.dll, GameAssembly.dylib, or libil2cpp.so).
AI PromptClaude Code / Cursor / Windsurf

Natural Language Agent Instructions

Copy and paste this prompt directly into your AI coding agent when REA is registered via Model Context Protocol (MCP):

Prompt Template:Select All to Copy
Use REA to inspect this Unity game's global-metadata.dat and libil2cpp.so. Find all methods under the Game.Security namespace, resolve their native code addresses, and generate Ghidra analysis seeds.
ExecutionTerminal & MCP Tool Call

Run REA Analysis Command

Execute the following command in your terminal or inspect the MCP JSON-RPC call executed by your agent:

CLI Command Execution
rea inspect-il2cpp-metadata ./global-metadata.dat --binary ./libil2cpp.so --ghidra-seeds seeds.json --json

What REA Extracts & Returns

Header verification: Metadata version (24, 27, 29, 31, 39: Unity 2019.4 up to Unity 6) and section offsets
Assembly images, type definitions, method declarations, properties, and string literals
Il2CppCodeRegistration & Il2CppCodeGenModule mapping via R_AARCH64_RELATIVE / R_X86_64_RELATIVE relocations
Exportable Ghidra seeds (seeds.json) to automatically label functions at memory addresses in NSA Ghidra

Resolved Method Token & Address Mapping

The verified findings and synthesized clean-room structures generated from this investigation:

Resolved Method Token & Address Mapping
{
  "type": "Game.Security.LicenseManager",
  "method": "CheckLicenseStatus",
  "token": "0x06000210",
  "native_address": "0x0042a180",
  "rva": "0x0002a180",
  "image": "Assembly-CSharp.dll",
  "relocation_status": "R_AARCH64_RELATIVE resolved"
}
Internal MechanicsProduction Engineering

Relocation-Aware Module Alignment Without Symbols

In stripped IL2CPP binaries, function names are replaced with memory pointers. Position-independent ELF/PE binaries store zero in pointer slots and keep target offsets in dynamic relocation tables (DT_RELA). REA's parser writes relocation targets into a private in-memory copy, finds module records via declared NUL-terminated image name pointers, and matches token row indices directly to native code addresses.

Security Guardrails & Analysis Boundary Rules

Zero execution: Does not launch the Unity engine, bypassing anti-tamper, debugger checks, and integrity hashes.
Supports metadata versions 24 (Unity 2019.4), 27 (2020.3), 29 (2022.3), 31 (2022.3 LTS), and 39 (Unity 6).
Paging query API prevents out-of-memory errors when processing massive 200MB+ game metadata files.