Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MonoMod/MonoMod
C# modding swiss army knife, powered by cecil.
https://github.com/MonoMod/MonoMod
c-sharp cecil cil cross-platform detours modding monkey-patching mono msil net-framework patching unity
Last synced: 4 months ago
JSON representation
C# modding swiss army knife, powered by cecil.
- Host: GitHub
- URL: https://github.com/MonoMod/MonoMod
- Owner: MonoMod
- License: mit
- Created: 2015-05-06T16:15:42.000Z (almost 10 years ago)
- Default Branch: reorganize
- Last Pushed: 2024-10-22T02:35:37.000Z (4 months ago)
- Last Synced: 2024-10-23T03:51:26.355Z (4 months ago)
- Topics: c-sharp, cecil, cil, cross-platform, detours, modding, monkey-patching, mono, msil, net-framework, patching, unity
- Language: C#
- Homepage: https://monomod.dev/
- Size: 13.3 MB
- Stars: 776
- Watchers: 23
- Forks: 99
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# MonoMod
![]()
General purpose .NET assembly modding "basework", powered by [cecil](https://github.com/jbevain/cecil/).
*MIT-licensed.*[](https://github.com/MonoMod/MonoMod/actions/workflows/ci.yml)
| GitHub: All | NuGet: Patcher | NuGet: Utils | NuGet: RuntimeDetour | NuGet: HookGen |
|--|--|--|--|--|
| [](https://github.com/MonoMod/MonoMod/releases) | [](https://www.nuget.org/packages/MonoMod/) | [](https://www.nuget.org/packages/MonoMod.Utils/) | [](https://www.nuget.org/packages/MonoMod.RuntimeDetour/) | [](https://www.nuget.org/packages/MonoMod.RuntimeDetour.HookGen/) |
| [](https://github.com/MonoMod/MonoMod/releases) | [](https://www.nuget.org/packages/MonoMod/) | [](https://www.nuget.org/packages/MonoMod.Utils/) | [](https://www.nuget.org/packages/MonoMod.RuntimeDetour/) | [](https://www.nuget.org/packages/MonoMod.RuntimeDetour.HookGen/) |[... or download fresh build artifacts for the last commit.](https://dev.azure.com/MonoMod/MonoMod/_build/latest?definitionId=1)
## Sections
- [Introduction](#introduction)
- [Using RuntimeDetour](docs/RuntimeDetour/Usage.md)----
## Introduction
MonoMod is a modding "basework" (base tools + framework).
Mods / mod loaders for the following games are already using it in one way or another:
- Terraria: [tModLoader](https://github.com/blushiemagic/tModLoader), [TerrariaHooks](https://github.com/0x0ade/TerrariaHooks)
- Hollow Knight: [HollowKnight.Modding](https://github.com/seanpr96/HollowKnight.Modding)
- Celeste: [Everest](https://everestapi.github.io/)
- Risk of Rain 2: [BepInExPack (BepInEx + MonoMod + R2API)](https://thunderstore.io/package/bbepis/BepInExPack/)
- Enter the Gungeon: [Mod the Gungeon](https://modthegungeon.github.io/)
- Rain World: [RainDB via BepInEx](http://www.raindb.net/)
- Totally Accurate Battle Simulator: [TABS-Multiplayer](https://github.com/Ceiridge/TABS-Multiplayer)
- Salt and Sanctuary: [Salt.Modding](https://github.com/seanpr96/Salt.Modding)
- Nimbatus: [Nimbatus-Mods via Partiality](https://github.com/OmegaRogue/Nimbatus-Mods)
- Dungeon of the Endless: [DungeonOfTheEndless-Mod via Partiality](https://github.com/sc2ad/DungeonOfTheEndless-Mod)
- FEZ: [FEZMod (defunct)](https://github.com/0x0ade/FEZMod-Legacy)
- And many more! *Ping me on Discord if your mod uses MonoMod!*It consists of the following **modular components**:
- [**MonoMod.Patcher**](docs/README.Patcher.md): The ahead-of-time MonoMod patcher and relinker.
- [**MonoMod.Utils**](docs/README.Utils.md): Utilities and helpers that not only benefit MonoMod, but also mods in general.
It contains classes such as `PlatformDetection`, `FastReflectionHelper`, `DynamicMethodHelper`, `DynamicMethodDefinition`, `DynDll` and the `ModInterop` namespace.
- **MonoMod.DebugIL**: Enable IL-level debugging of third-party assemblies in Visual Studio / MonoDevelop.
- [**MonoMod.Core**](docs/README.Core.md): The core upon which runtime method detouring is built.
- [**MonoMod.RuntimeDetour**](docs/RuntimeDetour/Usage.md): A flexible and easily extensible runtime detouring library, supporting x86/x86_64 on .NET Framework, .NET Core, and Mono.
- [**MonoMod.RuntimeDetour.HookGen**](docs/RuntimeDetour.HookGen/Usage.md): A utility to generate a "hook helper .dll" for any IL assembly. This allows you to hook
methods in runtime mods as if they were events. Built with MonoMod and RuntimeDetour.
- [**MonoMod.Backports**](docs/README.Backports.md): A collection of BCL backports, enabling the use of many new language and library features, as far back as .NET Framework 3.5.### Why?
- Cross-version compatibility, even with obfuscated assemblies.
- Cross-platform compatibility, even if the game uses another engine (f.e. Celeste uses XNA on Windows, FNA on macOS and Linux).
- Use language features which otherwise wouldn't be supported (f.e. C# 7 in Unity 4.3).
- Patch on the player's machine with a basic mod installer. No need to pre-patch, no redistribution of game data, no copyright violations.
- With HookGen, runtime hooks are as simple as `On.Namespace.Type.Method += (orig, a, b, c) => { /* ... */ }`
- With HookGen IL, you can manipulate IL at runtime and even inline C# delegate calls between instructions.
- Modularity allows you to mix and match. Use only what you need!---
### Special thanks to my [patrons on Patreon](https://www.patreon.com/0x0ade):
- [Chad Yates](https://twitter.com/ChadCYates)
- [Sc2ad](https://github.com/sc2ad)
- Raegous
- Chaser6
- [Harrison Clarke](https://twitter.com/hay_guise)
- [KyleTheScientist](https://www.twitch.tv/kylethescientist)
- [Renaud Bédard](https://twitter.com/renaudbedard)
- [leo60228](https://leo60228.space)
- [Rubydragon](https://www.twitch.tv/rubydrag0n)
- Holly Magala
- [Jimmy Londo (iamdadbod)](https://www.youtube.com/iamdadbod)
- [Artus Elias Meyer-Toms](https://twitter.com/artuselias)