ClrHook is a lightweight native library that enables drop-in managed .NET plugins to load at runtime without modifying the target application.
It provides a unified plugin model across runtimes by wrapping CoreCLR’s built-in Host Startup Hook feature, and backporting equivalent behavior to Mono so that plugins work transparently on both runtimes.
- Linux x64 or OSX Arm64
- Mono or CoreCLR runtime based application
- Build
coreclr(seebuild.shor your preferred build method). - Launch your Mono application with
coreclrinjected, e.g.:Initial run will create the directory structures, so close the application and proceed.# Linux LD_PRELOAD=/path/to/coreclr.so ./TheGame # OSX DYLD_INSERT_LIBRARIES=./clrhook.dylib ./TheGame
- Place your plugin DLLs in the
coreclr/plugins/directory. Each plugin should have a classStartupHookwith a staticInitializemethod (see clr docs). - Run again and check the output for plugin load status and logs.
- Tested on Linux x64 & OSX Arm64 (Apple Silicon) on games:
- Terraria via Steam - Mono based runtime embedded (MonoKickstart/FNA)
- Stardew Valley via Steam - Coreclr based runtime (MonoGame)
- Plugins must be compatible with the target application's Mono version and runtime configuration.
- This tool is is provided without warranty. Use at your own risk, as with anything...