BepInEx.MelonLoader.Loader
Loader for BepInEx to be able to use MelonLoader plugins.
IL2CPP only, as I am not aware of any games that are Mono-based and (still) use MelonLoader
Notes
- Launch options for melonloader are located in
BepInEx/config/io.bepis.melonloader.loader.cfg. Additional options configuring the internal components of MelonLoader are also located here - The Mods and Plugins folders have been moved to
MelonLoader/ModsandMelonLoader/Pluginsfolders respectively. Other folders and files have been moved to theMelonLoaderfolder, but some plugins/mods won't respect this.
Installation instructions
- Install an IL2CPP bleeding edge version of BepInEx from here (pick the correct bitness for your game, task manager will tell you if the process is 32bit or 64bit).
- Download the latest release into the your game folder.
- (Optional but recommended) Download the dependencies for your game's unity version here (you can figure out the unity version by right clicking your game's .exe and checking the properties -> details -> file version)
Extract them into your
BepInEx/unity-libsfolder (create it if it doesn't exist). If you've opened your game before this point, deleteBepInEx/unhollowed/assembly-hash.txtand the unhollowed assemblies will regenerate correctly.
Troubleshooting issues with MelonLoader mods/plugins
Some mods or plugins won't work out of the box with this. Some things you can do to fix this:
- Follow step 3. in the above guide
- Download the full BCL pack and extract it into
<your game directory>/mono/Managed. This folder should already exist if you've installed the IL2CPP version of BepInEx correctly - Some games (VRChat and Among Us) require deobfuscation maps. Download the latest version for your game from here, and move it to
BepInEx/DeobfuscationMap.csv.gz. (This will sometimes need to be updated when the game updates)
Sometimes the unhollowed assemblies generated by BepInEx can differ significantly from assemblies generated by MelonLoader (due to a reason I haven't diagnosed yet). ML plugins and mods will typically complain about missing types or methods in such unhollowed assemblies. Follow this guide to fix this problem:
- Open
BepInEx/config/io.bepis.melonloader.loader.cfgand setEnableAssemblyGenerationto true. - Launch the game once.
- The unhollowed assemblies created by MelonLoader will be located in
MelonLoader/AssemblyOutput. OpenBepInEx/unhollowed, delete ONLY the .dll files, and move the .dll files from AssemblyOutput to here. - Set
EnableAssemblyGenerationback to false.
You will have to do this every time the game updates. Make sure to only delete the .dll files and don't touch assembly-hash.txt; if it has been deleted or modified, BepInEx will assume that the unhollowed assemblies have to be regenerated, and will overwrite the MelonLoader generated .dll files.
Some VRChat mods have a check to ensure that you are running an official build of MelonLoader with full obfuscation detection support. The version of BepInEx.MelonLoader.Loader posted here does not have this check, and as such these mods will not work. While I do have a fix for this, I have been asked by Knah not to post the circumvention online.
Licensing
This repo uses code adapted from MelonLoader itself, which is under the Apache 2.0 license (included in the repo)
As per licensing instructions, the changes included in this repository are:
- All references to native libraries / code removed
- Cleaned up some code
- Hollowed out some classes to act as wrappers for greater implementations in BepInEx
- Removed unused libraries
- Harmony now uses a managed detour creator instead of the native Detours library