Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject managed DLL #273

Open
Symbai opened this issue Dec 17, 2023 · 3 comments
Open

Inject managed DLL #273

Symbai opened this issue Dec 17, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Symbai
Copy link

Symbai commented Dec 17, 2023

Problem Description

I need to inject a managed DLL into a managed (.NET core) process and execute the entry method. Maybe dnSpyEx already supports this? I couldn't find it

Proposal

When debugging a target allow us to select a managed DLL to inject and perhaps select a method to execute

Alternatives

I couldn't find any simple injector that works with .NET (core) targets
Target has detection for DOTNET_STARTUP_HOOKS so I cannot use this either.

Additional Context

No response

@Symbai Symbai added the enhancement New feature or request label Dec 17, 2023
@GazziFX
Copy link

GazziFX commented Dec 17, 2023

Maybe you should try to write a loader that will run the target program and your DLL using Assembly.Load?

@Symbai
Copy link
Author

Symbai commented Dec 17, 2023

Thank you for your valuable(?) response. I still think this would be a useful feature for dnSpyEx/a debugger.

@Dump-GUY
Copy link

Dump-GUY commented Jan 8, 2024

Hello. Shameless plug here...
Could you please try to do something we did in our publication regarding .NET Hooking: https://research.checkpoint.com/2024/net-hooking-harmonizing-managed-territory/

Check the last section "Harmony Hooking from the DnSpyEx Debugging Context" - where we used the "Watch" window to load our managed hooking dll and invoke some functions etc.
Hopefully, it could be useful in your case too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants