i have created a simple dll. I am injecting it in a process but it not showing message box.The code for mesg box is written in dll.
dll code:
//DLL TEST
#include <windows.h>
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) {
if(callReason == DLL_PROCESS_ATTACH)
MessageBox(0, "Dll Injection Successful! ", "Dll Injector", MB_ICONEXCLAMATION | MB_OK);
return TRUE;
}
First of all you don't posted the code which you use to inject the DLL or at least not described ich which way you do the injection.
Nevertheless your code have a large problem. You try to call
MessageBox
inside of DllMain. It is safe to use only functions from the Kernel32.dll and not form User32.dll which can not be initialized. On the MSDN you can read