• 13
• 16
• 27
• 9
• 9

# DLL Injection

This topic is 3583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok, im making a program that will inject a DLL into another program, by making a remote thread, and attaching the function from the DLL to the thread. But, when i inject, the program im trying it on (mIRC), crashes. My guesses are: 1) Im loading the library (DLL) in my memory space, and referencing to my memory space, which would crash it, but, i thought DLL where all in shared memory space. 2) mIRC counts it own thread numbers for injection, and crashes itself (very unlikely) Here is my source for injection, i already have a valid handle to the program:
			 // Validate we have the Handle.
if(!SWGHandle)
{
MessageBox::Show("For some reason the hook was lost, please re-attach.","Error!", MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
}

// Load the DLL into memory space
if(!DLL)
{
MessageBox::Show("Failed to load DLL! Please check that it exists.", "Error!", MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
return;
}


and here is my very simple DLL:
#include <windows.h>

{
AllocConsole();
}