Skip to content

BepInEx loader for MelonLoader mods and plugins

License

AGPL-3.0, Apache-2.0 licenses found

Licenses found

AGPL-3.0
LICENSE
Apache-2.0
LICENSE_MelonLoader.md
Notifications You must be signed in to change notification settings

BepInEx/BepInEx.MelonLoader.Loader

Repository files navigation

BepInEx.MelonLoader.Loader

Current version supports MelonLoader 0.5.7.

Loader for BepInEx to be able to use MelonLoader plugins.

Notes

  • Launch options for MelonLoader are located in BepInEx/config. Additional options configuring the internal components of MelonLoader are also located here. The configuration file will be generated on the first launch automatically.
  • The Mods and Plugins folders have been moved to MLLoader/Mods and MLLoader/Plugins folders respectively. Other folders and files have been moved to the MLLoader folder, but some plugins/mods won't respect this.

Installation instructions

  1. Install BepInEx 5 or 6 according to the game you want to use. Note that IL2CPP support is only available for BepInEx 6.
  2. Download the latest release (pick the correct version) and extract it into your game folder.
  3. Run the game

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:

  • 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:

  1. Open BepInEx/config/io.bepis.melonloader.loader.cfg and set EnableAssemblyGeneration to true.
  2. Launch the game once.
  3. The unhollowed assemblies created by MelonLoader will be located in MelonLoader/AssemblyOutput. Open BepInEx/unhollowed, delete ONLY the .dll files, and move the .dll files from AssemblyOutput to here.
  4. Set EnableAssemblyGeneration back 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 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. Fixes for this will not be committed here at the request of Knah.


Licensing

This repo uses code adapted from MelonLoader itself, which is under the Apache 2.0 license (included in the repo)

As per licensing, the changes included in this repository are:

  • Replaced internal calls with managed equivalents backed by BepInEx
  • Disabled MelonLoader's startup screen as startup is handled by BepInEx
  • Added extra configuration options via BepInEx config (e.g. runtime fix management, patchshield configuration, etc)
  • Changed the base directory to MLLoader
  • Repackaged resources using EmbeddedResource (allows to build the project using dotnet msbuild)

The repository contains only the BepInEx plugin and all modified MelonLoader assemblies. Unmodified assemblies are built directly from MelonLoader source.