Open HeroXx opened 2 years ago
Loading libraries from DllMain will cause a deadlock due to the loader lock.
Consider starting a separate thread and starting the runtime from there. Example.
Alternatively, if you need your code to execute as part of startup before target process' code; either start the process suspended, inject into that and resume when done; or hijack one of the DLLs supported by the application and run your bootstrapper from there (like ASI loaders etc. do)
I'm having problems translating this into a DLL startup. I've tried expanding out the bootstrap example to use DllMain and running the CLR from within the attach but injection always fails.
I don't suppose you have any guidance you could give?