When you call it with a newly created thread (CreateThread or CreateRemoteThread) it will crash universally. When you call LoadLibrary on a D module from a C++ application's "main" function, everything is fine. The solution, I believe, in this case might be to hijack the program's "main" thread and execute your LoadLibrary call there. I'll keep working on it, but right now all I've got to go on is invalid memory access in one of the GC's Free functions.Īlright, at the end of my long search I have finally concluded that this is some sort of threading problem.Īny D module loaded in a new thread, from a C/++ application will crash. It also halted execution of the rest of my code, go figure. I don't know why this would prevent my module from crashing, but it did. The reason why it didn't fault here is because I totally screwed up the stack and I believe that caused the exception handler to trigger when the DllMain call was finished. > ret // Don't give the garbage collector the chance to makeĪctually completely disregard, what was actually happening was me being stupid. > .collect() //collect garbage before the return > extern (Windows) BOOL DllMain(HMODULE hModule, ULONG ulReason, > I recently had this problem, and I think I've solved it for now On Tuesday, 27 November 2012 at 01:01:10 UTC, s0beit wrote: So I'm wondering how to write a DLL that injects successfully. I also tested it with another injector, and the process just freezes. The problem is that when I inject the DLL into the process with Winject (a DLL Injector), the value changes fine, but Winject complains "Injection seemed successful, but DLLMain() never returned (TIMEOUT)", and then the process crashes 30 seconds later. The process I'm injecting it into has a value at that address which I want to change. I've been trying for a while now to inject a DLL written in D into another process, and I just haven't been able to get it working.īOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)īasically I just copy and pasted the code from the DLL tutorial on the D website and added the *cast(int*)0x22FF3C = 1337 line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |