Evil Bank Mod Loader (EBML)

Growing up with Minecraft, I loved the idea of modding a game. Creating a mod for a game can be both fun and challenging, but in order to create a mod in the first place you generally want to use a "Mod Loader" that someone has developed. A Mod Loader is responsible for loading multiple mods from different creators and expose access to the internal game logic in an easy manner. Since most games are closed-source, creating a mod loader usually revolves around reverse engineering the game and injecting or overriding some internal logic in order to change or extend the game logic.
So I though: Hey, why not try to create a Mod Loader for a game that currently does not support mods?
I chose the game Evil Bank Manager as it was a game that didn't have a mod loader (to my understanding) and was made in the Unity Game Engine - which I have a lot of experience with.
Here's a quick description of the game:
What could be better than having a million? Have a hundred million? Billion? But this will not give you complete power over the world. Your goal is not to make a lot of money - your goal is to get control of money. Start printing them. Only by becoming a Federal Reserve System will you become great!
Reverse engineering
I used a tool called ILSpy to view the code for the game. Using this I was able to figure out the internal logic for how the game was setup.
DLL Injection
It would be problematic to include modified copies of files due to copyright reasons, and it would also make it harder for any user to install the modloader. Therefore, my modloader uses a method called DLL injection to dynamically install the ModLoader while the game is running. I used SharpMonoInjector to help me with this.
Modloader GUI
The modloader comes with a GUI that allows easy installation. By default, it will try to auto-inject itself when the game is running. There is also a button to manually inject.

After the DLL has been force loaded, it runs a static OnInjection function that creates a "bootstrapper" GameObject . This "bootstrapper" object runs on the Unity Main Thread and is therefore able to access all Unity functions and run Unity-specific code. After this object has been created, some other stuff gets initialized and mods located in the mods folder (additional .dlls) get loaded into the application as well.

The project also ships with a Visual Studio project for an example mod to showcase how mods could be created for this modloader. Under is the output you will get on the main menu of the game if the injection is successful and the example mod has been loaded:

API
To be able to access the in-game code, the modloader comes with a mod API that allows you to get game assets, register new in-game resources, and setup sprites/textures, etc.
Using a library called Harmony , various "hooks" are inserted into existing game functions by patching the .NET IL while the game is running. This basically gives the mod loader control over what should execute either before or after the function body defined by the game itself.
Conclusion
This was a really fun project to undertake, and being able to showcase a working proof-of-concept is pretty cool. I learned a ton in the process and although it's far from a "production ready" modloader it still works pretty well. At the time of writing (March 2025), the game itself has not been updated since 2020 and the mod loader still works.