This is a simple tutorial on the question How to inject trainer dll with BepInEx. I won't go into very specific details in order to keep it quick and understandable.
Quick info before we get started:
BepInEx isn't an ordinary injector that we normally use to inject dlls but it's more of an open souce a plugin / modding framework for Unity Mono, IL2CPP and .NET framework games (XNA, FNA, MonoGame, etc.) based on Doorstop – which is another tool used to execute assemblies inside Unity -. This means that you can't use this to inject dlls in other games that aren't based on the engines / backends listed above. And since BepInEx isn't an ordinary injector a lot of people don't really know how to use it. This is why I'm making this tutorial.
Alright let's get started:
How to inject trainer dll with BepInEx?:
- Download the BepInEx zip file provided below
- Download the trainer dll that you'd like to inject
- Extract the files in the zip file (most important ones being "winhttp.dll", "doorstep_config.ini" and the "BepInEx" folder. So, make sure they are there!) to the root directory of the game you want inject the dll into
- Paste the trainer dll in the BepInEx folder
- Open doorstop_config.ini with an editor of your choice (I recommend notepad++)
- In the 5th line you will see a variable called "targetAssembly"
As default this variable is equal to "BepInExcoreBepInEx.Preloader.dll"
Change this to BepInEx**name_of_the.dll** For example: "targetAssembly=BepInExtrainer.dll"
- Save the file by pressing CTRL + S or by clicking on the save button on the top left
- And this is it. Now run the game and the dll will be injected automatically.
If it didn't work for you please read the post once again very carefully or check out our other tutorial on How to inject trainer dll with Doorstop. I've also included some screenshots of the steps that people may have trouble with down below, check them out.
Extracting BepInEx files in the root directory of the game:
Extracting the trainer dll in the BepInEx folder:
Editing the config file:
Saving the config file: