What’s this global-metadata.dat thing and why does it matter?
Understand global-metadata.dat, the IL2CPP blueprint for Unity games, and learn what it reveals to hackers, plus how to keep them out.
By Tim Uhlott|Last updated: October 7, 2025|4 minutes read
cybersecurityobfuscationil2cpp

Ever poked around a Unity game folder and seen
global-metadata.dat
and thought, “What’s that doing here?” You’re not hallucinating. It’s one of those tiny files that actually holds the blueprint of the game’s managed code when Unity uses IL2CPP. Short version: it’s metadata about your original C# code, and it matters more than you’d expect.
Wait - what is IL2CPP anyway?
Short answer: Unity’s ahead-of-time trick. Instead of JIT-running C#, Unity converts the IL (that C#-compiled intermediate language) into C++, then compiles that into a native binary (GameAssembly.dll
, libil2cpp.so
, etc.). That’s necessary for platforms that forbid runtime code generation (ahem, iOS). The downside: native code loses a lot of the “about the code” info that C# normally keeps. So Unity puts that info into global-metadata.dat
.
What’s in that file?
Think of it as the game’s table of contents:- Type definitions - every class, struct, and interface.
- Method definitions - signatures and VTable info.
- Field definitions and offsets - how to read/write objects in memory.
- String literals and constants.
- A header with a magic number and offsets. All the structural stuff the IL2CPP runtime needs to behave like a managed environment.
Why is that a problem?
Becauseglobal-metadata.dat
is basically a cheat-sheet for reverse engineers. Names of classes and methods, offsets of fields, those breadcrumbs let tools like Il2CppDumper or Il2CppInspector recreate stubs or dummy DLLs you can open in a decompiler. Long story short: it makes reverse engineering much easier.
Can devs make it harder to read?
Yes. Many teams try:- Encrypt or obfuscate the metadata on disk (simple XOR up to custom schemes).
- Embed the metadata inside the native binary so it’s not plainly visible.
- Obfuscate the code that loads/decrypts it (so finding the loader is a pain). Those things don’t make reverse engineering impossible. They just raise the effort required.
What about obfuscating the original C# before IL2CPP?
Do this and you get extra protection. If you obfuscate the managed C# first, rename classes/methods/fields to meaningless labels, scramble strings, etc., then feed that into IL2CPP, the metadata that ends up inglobal-metadata.dat
already has cloaked names. That changes the game a bit:
- The metadata no longer hands out obvious names like
Player.Health
. - Even if someone decrypts the file, it’s less useful (they see
a.b.c1
instead). - Combined with on-disk protections, this significantly raises the bar.
What should you, as a dev, actually do?
Assume someone can see the metadata. Then:- Obfuscate your C# before IL2CPP so names are cloaked.
- Encrypt or hide the
global-metadata.dat
on disk. - Keep critical checks on the server - don’t trust the client.
- Use server-side validation for anything that affects fairness (scores, economy, matchmaking).
- Test your protections with pen tests or internal red-team drills.
Final thought
global-metadata.dat
is small but powerful: indispensable for IL2CPP to behave like managed code, and a convenient map for anyone trying to understand a binary. Obfuscating the original C# before IL2CPP (so names are cloaked), combined with metadata encryption and smart server-side design, gives you a practical, layered defense. Let’s be honest, nothing is unbreakable. But make reversing annoyingly hard, and most attackers will move on. Your game (and your sanity) will thank you.