Skip to content

Add support for injection into .NET Core#9

Draft
Oreeeee wants to merge 1 commit into
holly-hacker:masterfrom
Oreeeee:coreclr-injector
Draft

Add support for injection into .NET Core#9
Oreeeee wants to merge 1 commit into
holly-hacker:masterfrom
Oreeeee:coreclr-injector

Conversation

@Oreeeee
Copy link
Copy Markdown

@Oreeeee Oreeeee commented May 7, 2026

Currently probably not ready for merge, so I'm drafting it for now. Injecting into a 64-bit process running on .NET 10 worked.

A few issues:

  1. This will not work for single-file published files, as they don't LoadLibrary coreclr.dll.
  2. Microsoft wants to remove GetCLRRuntimeHost export from coreclr.dll. However, it seems safe to use that for now. The old API was used for simplicity reasons, and could be replaced by the newer one instead.
  3. For some reason, injected modules can't resolve their dependencies.

Note: A lot of code is shared with the .NET Framework implementation (basically a copy paste almost). It did not feel fitting to inherit from FrameworkInjectorBase though, and a lot of methods are implemented inside of CreateCallStub method. I feel like some of these should be separated into another class?


Closes #3

@holly-hacker
Copy link
Copy Markdown
Owner

Thanks for the PR! This looks good at first glance, but I don't have a Windows machine to test on right now so I don't know when I can get around to properly testing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support injecting into .NET Core/.NET 5+

2 participants