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 - Architecture deep-dives and technical internals
- 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:
- Proxy DLL Injection - Ships as a
version.dllproxy β just drop it in the game folder, no external injector needed - 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.7.2 via COM-based CLR hosting
- MonoBehaviour Injection - Fabricates an IL2CPP MonoBehaviour subclass in memory for main-thread callbacks
- 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 (DX11/DX12)
All of this happens automatically on first injection. Subsequent launches are instant if nothing has changed.
Key Features
π Zero-Configuration Setup
Rename MDB_Bridge.dll to version.dll, drop it in the game folder, and launch the game β no injector required. MDB also supports direct DLL injection for development. 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
MDB supports two injection modes: proxy mode (recommended) and direct injection (for development).
In proxy mode, MDB_Bridge.dll is renamed to version.dll and placed in the game folder. Windows loads it automatically at startup via DLL search order β no external injector needed.
Game.exe launches
β Windows loads version.dll (our proxy) from game directory
β DllMain spawns background initialization thread
β Proxy forwards all 17 version API calls to the real System32 version.dll
β Background thread polls for GameAssembly.dll (up to 30s)
β Resolves 50+ IL2CPP function exports (with obfuscation fallback)
β Dumps all IL2CPP metadata (classes, methods, fields, properties)
β Generates C# wrapper source files with full generic type resolution
β Invokes MSBuild to compile GameSDK.ModHost.dll
β Hosts .NET Framework 4.7.2 CLR via COM (ICLRRuntimeHost)
β Calls ModManager.Initialize() β discovers and loads mods
β Fabricates MDBRunner MonoBehaviour in IL2CPP memory
β Attaches to Unity player loop for Update/FixedUpdate/LateUpdate callbacks
β Mods run on Unity's main thread via MDBRunner dispatch
See the Architecture Guide for a detailed explanation of each step, the Proxy DLL Injection Guide for the version.dll proxy system, and the Class Injection Guide for the MonoBehaviour fabrication system.
Supported Platforms
- Operating System: Windows 10/11 (x64 only)
- Unity Runtime: IL2CPP (Unity 2021+, metadata v29+)
- Graphics API: DirectX 11 or DirectX 12 (for ImGui overlay)
- .NET Target: Framework 4.7.2 or higher (hosted via COM CLR)
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.
Guides
In-depth technical guides covering MDBβs internal architecture and design:
| Guide | Description |
|---|---|
| Architecture | Full injection chain, initialization sequence, and component overview |
| Proxy DLL Injection | How the version.dll proxy works β DLL search order, forwarding, loader lock safety |
| Class Injection | MonoBehaviour fabrication β IL2CPP memory layouts, hooks, negative tokens |
Get Started
Ready to start modding? Head to the Getting Started guide to:
- Prepare your environment
- Deploy MDB to a Unity game (proxy or direct injection)
- 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.