MDB Framework
Runtime IL2CPP modding framework for Unity games. Dumps metadata, generates C# wrappers, builds an SDK, and loads mods β all automatically from a single DLL injection.
Encrypted global-metadata.dat? Donβt care.
Quick Links
- Getting Started - Install and create your first mod
- API Reference - Complete API documentation
- Guides - Tutorials and how-to guides
- Examples - Working mod examples with explanations
What is MDB Framework?
MDB Framework is a powerful runtime modding solution for Unity IL2CPP games. It eliminates the complexity of traditional IL2CPP modding by automating the entire workflow:
- Automatic Metadata Dumping - Extracts all classes, methods, and fields from the IL2CPP runtime
- C# Wrapper Generation - Creates type-safe C# wrappers for all game types
- SDK Auto-Building - Compiles a complete modding SDK using MSBuild
- CLR Hosting - Hosts .NET Framework 4.0 for managed mod execution
- Mod Loading - Auto-discovers and loads mods from the
Mods/folder - Harmony-Style Patching - Declarative method hooking with
[Patch]attributes - ImGui Integration - Built-in Dear ImGui overlay with input capture
All of this happens automatically on first injection. Subsequent launches are instant if nothing has changed.
Key Features
π Zero-Configuration Setup
Inject MDB_Bridge.dll into your game and youβre done. No manual dumping, no external tools, no complex setup.
π― Harmony-Style Patching
[Patch("GameNamespace", "Player")]
[PatchMethod("TakeDamage", 1)]
public static class PlayerPatch
{
[Prefix]
public static bool Prefix(IntPtr __instance, int damage)
{
// Named parameters map positionally to native args
// Return false to skip original method
return true;
}
}
π¨ Built-in ImGui UI
public override void OnLoad()
{
ImGuiManager.RegisterCallback(DrawUI, "My Window");
}
private void DrawUI()
{
if (ImGui.Begin("My Window"))
{
ImGui.Text("Hello from MDB!");
}
ImGui.End();
}
π§ Full IL2CPP Bridge Access
IntPtr playerClass = Il2CppBridge.mdb_find_class("Assembly-CSharp", "", "Player");
IntPtr healthField = Il2CppBridge.mdb_get_field(playerClass, "health");
float health = Il2CppBridge.mdb_field_get_value<float>(playerInstance, healthField);
𧬠Generic Type Resolution
Unlike traditional dumpers that erase generics to object, MDB resolves actual type arguments:
List<string>staysList<string>Dictionary<string, int>staysDictionary<string, int>- System types are fully resolved at runtime
How It Works
Inject MDB_Bridge.dll
β Wait for GameAssembly.dll
β Resolve IL2CPP API exports
β Dump all classes/methods/fields with generic type resolution
β Generate C# wrapper source files
β Invoke MSBuild to compile GameSDK.ModHost.dll
β Host .NET CLR (v4.0.30319)
β Auto-discover and apply [Patch] hooks
β Load mods from MDB/Mods/
β Start update loop (~60Hz)
See the Architecture guide for detailed explanation of each step.
Supported Platforms
- Operating System: Windows (x64 only)
- Unity Runtime: IL2CPP
- Graphics API: DirectX 11 or DirectX 12 (for ImGui overlay)
- .NET Target: Framework 4.7.2 or higher
Example Mods
The framework includes four example mods demonstrating every major API:
| Example | Difficulty | Description |
|---|---|---|
| HelloWorld | π’ Simple | Lifecycle, Logger, basic ImGui |
| UnityDebugInterceptor | π’ Simple | Declarative patching, hooking Debug.Log |
| GameStats | π‘ Medium | Advanced patching, IL2CPP Bridge |
| MDB_Explorer_ImGui | π΄ Complex | Full IL2CPP reflection, scene traversal |
All examples target universal Unity types and work across any Unity IL2CPP game.
Get Started
Ready to start modding? Head to the Getting Started guide to:
- Prepare your environment
- Inject MDB into a Unity game
- Create and load your first mod
- Learn the mod lifecycle and APIs
Disclaimer
This framework is provided βas-isβ for educational and research purposes only.
- Many games prohibit modding in their Terms of Service
- Using this framework may trigger anti-cheat systems
- Never use in online/multiplayer games
- You are solely responsible for your actions
See the full Disclaimer for important legal information.
Acknowledgments
MDB Framework builds upon the excellent work of:
- MelonLoader - Unity mod loader
- BepInEx - Unity/Mono mod framework
- Il2CppDumper - IL2CPP metadata dumper
- Dear ImGui - Immediate mode GUI library
- MinHook - x86/x64 API hooking library
Full Disclaimer
The author(s) of MDB Framework are not responsible for any consequences resulting from the use or misuse of this software. This includes but is not limited to:
- Game bans or account suspensions - Many games prohibit modding
- Anti-cheat detections - May trigger anti-cheat systems
- Data loss or corruption - Memory modifications can cause crashes
- Legal consequences - Violating EULAs may have legal implications
Before using MDB Framework:
- Read the gameβs Terms of Service - Respect the rules
- Never use in online/multiplayer - This ruins experiences for others
- Use only for single-player - Or games that explicitly allow modding
- Understand the risks - You are solely responsible
By using this framework, you acknowledge that you understand these risks and agree to use it responsibly and ethically.