All Projects → EquiFox → Minject

EquiFox / Minject

Licence: mit
Mono Framework Interaction / Injection Library for .NET (C++/CLI)

Projects that are alternatives of or similar to Minject

Cscore
cscore is a minimal-footprint library providing commonly used helpers & patterns for your C# projects. It can be used in both pure C# and Unity projects.
Stars: ✭ 115 (+173.81%)
Mutual labels:  unity, unity3d, injection
Escapefromtarkov Trainer
Escape from Tarkov Trainer
Stars: ✭ 59 (+40.48%)
Mutual labels:  unity, mono, injection
Unityandroidhotupdate
(Unity3D热更新) provide a way to hot update Unity app on Android, support code&resources, not need lua js or IL runtime etc..., will not disturb your project development; just loading the new version apk file to achieve.
Stars: ✭ 85 (+102.38%)
Mutual labels:  unity, unity3d, mono
Unity Ui Examples
📚 A collection of UI examples for Unity.
Stars: ✭ 152 (+261.9%)
Mutual labels:  unity, unity3d, mono
Bepinex
Unity / XNA game patcher and plugin framework
Stars: ✭ 1,001 (+2283.33%)
Mutual labels:  unity, unity3d, mono
Riru Il2cppdumper
Using Riru to dump il2cpp data at runtime
Stars: ✭ 259 (+516.67%)
Mutual labels:  unity, unity3d, reverse-engineering
Il2cppdumper
Unity il2cpp reverse engineer
Stars: ✭ 3,362 (+7904.76%)
Mutual labels:  unity, unity3d, reverse-engineering
Centrifuge
Cross-platform runtime mod loader and API for any Unity-based game. Supports Unity 5 and up!
Stars: ✭ 18 (-57.14%)
Mutual labels:  unity, unity3d, mono
Seido
Visuals for Matsuura Masaya's live performance in Osaka and Tokyo.
Stars: ✭ 31 (-26.19%)
Mutual labels:  unity, unity3d
Unity Signals
Signals for Unity3D
Stars: ✭ 32 (-23.81%)
Mutual labels:  unity, unity3d
Unitypluginwithwsl
Unity native plugin with WSL (Windows Subsystem for Linux)
Stars: ✭ 39 (-7.14%)
Mutual labels:  unity, unity3d
Unity Assetpipeline Presentation
Unity project for "A Technical Deep-Dive into Unity's Asset Pipeline" presented at Develop: 2018
Stars: ✭ 31 (-26.19%)
Mutual labels:  unity, unity3d
Savegamepro
A Complete and Powerful Save Game Solution for Unity (Game Engine)
Stars: ✭ 30 (-28.57%)
Mutual labels:  unity, unity3d
Ecs Snake
Simple snake game powered by ecs framework.
Stars: ✭ 41 (-2.38%)
Mutual labels:  unity, unity3d
Museum
Live coding rig for Channel 18 at SuperDeluxe
Stars: ✭ 30 (-28.57%)
Mutual labels:  unity, unity3d
Minimumaudioplugin
Minimum implementation of a native audio plugin for Unity
Stars: ✭ 33 (-21.43%)
Mutual labels:  unity, unity3d
Packedrgbmshader
32-bit packed color format with RGBM encoding for shader use
Stars: ✭ 39 (-7.14%)
Mutual labels:  unity, unity3d
Managedinjector
A C# DLL injection library
Stars: ✭ 28 (-33.33%)
Mutual labels:  injection, reverse-engineering
Flutter Unity View Widget
Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
Stars: ✭ 961 (+2188.1%)
Mutual labels:  unity, unity3d
Unitystandalonefilebrowser
A native file browser for unity standalone platforms
Stars: ✭ 1,002 (+2285.71%)
Mutual labels:  unity, unity3d

MInject

Mono Framework Interaction / Injection Library for .NET (C++/CLI)

Features

  • Core is in pure C++ for reliabilty and performance
  • No locking on the injected assembly file
  • Native MonoProcess class is exposed to .NET throught a custom managed wrapper
  • Allow easy interaction with the Mono namespace
  • Allow easy injection into Mono namespace
  • Provides experimental safety mechanisms to hide the injected assembly from AssemblyLoad callbacks and GetAssemblies()

Download

You can find the most recent releases here: https://github.com/EquiFox/MInject/releases

You don't have time to waste with coding ? No problem !
Just grab my pre-compiled injector (based on this library) here: https://github.com/EquiFox/MInjector

Usage

Add MInject.dll to your .NET project references. Don't forget using MInject;

//Grab the target process by its name
Process targetProcess = Process.GetProcessesByName("Game")[0];
MonoProcess monoProcess;

//Try to attach to targetProcess Mono module
if (MonoProcess.Attach(targetProcess, out monoProcess))
{
    byte[] assemblyBytes = File.ReadAllBytes("TestInjection.dll");

    IntPtr monoDomain = monoProcess.GetRootDomain();
    monoProcess.ThreadAttach(monoDomain);
    monoProcess.SecuritySetMode(0);
    
    //Disable AssemblyLoad callbacks before injection
    monoProcess.DisableAssemblyLoadCallback();

    IntPtr rawAssemblyImage = monoProcess.ImageOpenFromDataFull(assemblyBytes);
    IntPtr assemblyPointer = monoProcess.AssemblyLoadFromFull(rawAssemblyImage);
    IntPtr assemblyImage = monoProcess.AssemblyGetImage(assemblyPointer);
    IntPtr classPointer = monoProcess.ClassFromName(assemblyImage, "TestInjection", "Loader");
    IntPtr methodPointer = monoProcess.ClassGetMethodFromName(classPointer, "Init");
        
    //Finally invoke the TestInjection.Loader.Init method
    monoProcess.RuntimeInvoke(methodPointer);

    //Restore the AssemblyLoad callbacks to avoid weird behaviours
    monoProcess.EnableAssemblyLoadCallback();    
    
    //You MUST dispose the MonoProcess instance when finished
    monoProcess.Dispose();
}

Safety Mechanisms

Tested and confirmed working on Albion Online (x86) & Escape from Tarkov (x64) as of November 27th, 2017.

Since multiple variants of Mono exists, using these features on any other Mono process might result in a crash.
Feel free to open an issue if a specific process isn't working and I'll take a look.

Note: Disabling AssemblyLoad Callbacks also prevents the assembly from being listed by GetAssemblies(), it's the recommended way to go.

Compile Yourself

  • Requires Visual Studio 2017 (Toolset v141)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].