A DLL injector to inject .NET assemblies into a foreign .NET process.
Перейти к файлу
HoLLy dd4d3647d6
Fix typo
2021-06-30 18:12:38 +00:00
ManagedInjector.CLI Early exit on errors in cli 2021-05-02 00:57:05 +02:00
ManagedInjector.GUI Minor fixes 2021-05-02 13:55:02 +02:00
ManagedInjector.Lib Publish NuGet package, closes #2 2021-05-02 14:09:21 +02:00
.editorconfig Initial commit 2021-04-02 21:32:48 +02:00
.gitignore Update gitignore 2021-05-02 01:50:29 +02:00
LICENSE Create LICENSE 2021-05-01 23:52:49 +00:00
ManagedInjector.sln Add UI injector MVP 2021-05-01 22:14:59 +02:00
README.md Fix typo 2021-06-30 18:12:38 +00:00

README.md

ManagedInjector 💉

NuGet version (HoLLy.ManagedInjector)

With ManagedInjector, you can inject .NET assemblies into other .NET processes. This allows you to run your own code under the context of that process, and gives you access to all its internal state using the .NET reflection API.

Getting started

Currently, only .NET Framework targets are supported. Mono will be supported in the near future and .NET Core/.NET will come soon after that.

For .NET Framework targets, the method to be run after injecting must be of signature static int MyMethod(string).

GUI

The GUI allows you to select a process and DLL in a graphical interface.

Main Window

Entrypoint Selection

CLI

With the CLI application, you can inject DLLs from the comfort of the commandline, or easily script it without having to do any programming.

$ .\ManagedInjector.CLI.exe --help
ManagedInjector.CLI 1.0.0
Copyright (C) 2021 ManagedInjector.CLI

  -n, --name      (Group: process) Specifies the target process name

  -p, --pid       (Group: process) Specifies the target process id

  -i, --input     Required. The DLL to inject

  -t, --type      Required. The full type of the entry point

  -m, --method    Required. The method name of the entry point

  --help          Display this help screen.

  --version       Display version information.
$ .\ManagedInjector.CLI.exe -n Wox -i D:\Injectable.dll -t Injectable.Program -m InjectableMain
PID: 15912
Status: Ok
Arch: NetFrameworkV4
Copied DLL to C:\Users\HoLLy\AppData\Local\Temp\69e4c80c-f828-4f07-bfb3-770c23d4308f.dll
Written to 0x2A389C60000
Thread handle: 00000354

.NET API

With ManagedInjector.Lib, you can integrate ManagedInjector into your own applications with an easy-to-use API.

⚠ Note that ManagedInjector.Lib will not move your DLLs to a temporary location. Due to how managed injection works, the files will remain "in use" by the target process until it closes. If you are actively developing your injectable, it is recommended to move it to a temporary location first.

using HoLLy.ManagedInjector;

uint pid = 0x1234;
var process = new InjectableProcess(pid);

Debug.Assert(process.GetStatus() == ProcessStatus.Ok);
Debug.Assert(process.GetArchitecture() == ProcessArchitecture.NetFrameworkV4);

process.Inject("D:\Injectable.DLL", "Injectable.Program", "Main");

Attribution

ManagedInjector uses the following libraries:

  • Iced, licensed under the MIT license

ManagedInjector.CLI uses the following libraries:

ManagedInjector.GUI uses the following libraries:

License

This project is licensed under the MIT License.

TL;DR: You are allowed to anything you wish with this software, as long as you include the original copyright and license notice in your software/source code.