Skip to content

SignatureBeef/clrhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

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.

Requirements

  • Linux x64 or OSX Arm64
  • Mono or CoreCLR runtime based application

Usage

  1. Build coreclr (see build.sh or your preferred build method).
  2. Launch your Mono application with coreclr injected, e.g.:
    # Linux
    LD_PRELOAD=/path/to/coreclr.so ./TheGame
    # OSX
    DYLD_INSERT_LIBRARIES=./clrhook.dylib ./TheGame
    Initial run will create the directory structures, so close the application and proceed.
  3. Place your plugin DLLs in the coreclr/plugins/ directory. Each plugin should have a class StartupHook with a static Initialize method (see clr docs).
  4. Run again and check the output for plugin load status and logs.

Plugin Examples

Notes

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

About

clrhook is a runtime .net plugin loader for mono/coreclr based games and applications that doesn't modify the target.

Topics

Resources

License

Stars

Watchers

Forks

Contributors