@@ -11,32 +11,36 @@ CLI tool that can replace C# methods in .NET Core applications
1111
1212### Requirements
1313
14- - Visual Studio 2022 with installed C++ & C# build tools: https://visualstudio.microsoft.com/en/vs/
14+ - C++ & C#
15+ - Linux: g++, .NET 8: https://dotnet.microsoft.com/en-us/download/dotnet/8.0
16+ - Windows: Visual Studio 2022 with installed C++ & C# build tools: https://visualstudio.microsoft.com/en/vs/
1517- Node.js: https://nodejs.org/en/download/
1618- frida: https://frida.re
1719
18- ### Installation on Windows
20+ ### Building
1921
2022Open command line and run this script
2123
24+ - ` _build.sh ` on Linux
25+ - ` _build.bat ` on Windows
26+
2227It will build
2328
2429- Node.js package [ net-core-injector] ( package.json ) - DLL-injector written in TypeScript
2530- [ Bootstrapper] ( Bootstrapper ) - helper native library written in C++ to interact with .NET Core runtime
2631- [ DemoApplication] ( DemoApplication ) - test application to demonstrate how it works
2732- [ RuntimePatcher] ( RuntimePatcher ) - code that attaches to [ DemoApplication] ( DemoApplication )
2833
29- ```
30- _build.bat
31- ```
32-
3334### Running
3435
3536This script should produce output like the GIF above
3637
37- ```
38- _run.bat
39- ```
38+ - ` _run.sh ` on Linux
39+
40+ Note: If you want to attach to an existing process on Linux, this requires root privileges. In this case, use
41+ ` _run.sh -a ` (attach).
42+
43+ - ` _run.bat ` on Windows
4044
4145### Internal documentation
4246
@@ -50,8 +54,8 @@ I did it in [`Bootstrapper/src/library.cpp`](Bootstrapper/src/library.cpp).
5054
5155[ ` net-core-injector/src/main.ts ` ] ( src/main.ts ) injects ` Bootstrapper.dll ` into C# process and loads custom assembly
5256
53-
5457The following command runs ` DemoApplication.exe ` on another thread and injects code.
58+
5559```
5660start DemoApplication\dist\DemoApplication.exe
5761
@@ -64,6 +68,7 @@ RuntimePatcher\dist\RuntimePatcher.dll ^
6468```
6569
6670Then the execution happens in this order:
71+
67721 . get into ` DemoApplication.exe ` process memory via DLL-injection of ` Bootstrapper.dll `
68732 . call native C++ code
6974 ``` cpp
@@ -86,4 +91,4 @@ You can use this to mod games written in C# or to patch any software
8691
8792### TODO
8893
89- - Linux support is incomplete due to some issues with the secondary host context in `hostfxr`
94+ - I don't have macOS device so it's supported for now. External contributors are welcome.
0 commit comments