I found the solution to my problem, If anyone have the same problem: Just use Visual Sudio instead of code block
Dll injection failed
-
29-03-2022 - |
문제
I'm trying to work a dll injection, I've tryed 100 of things but none of them works, I'm now on a windows 7 32 bits (to avoid 32/64 conflict). I've used two famous dll injector found on the web (AutoInject and Extreme injector V2) and a handmade one. I'm trying to mesagebox in notepad (can't be more simple right?) I sould also add that my windows run under Vmware. here My main for my dll (build with Code-Block)
#if BUILD_DLL
#define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
#define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
MessageBox (0, "Hello from injected DLL!\n", "Hi", MB_ICONINFORMATION);
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
I don't know what to try now
해결책
다른 팁
According to Howto call MessageBox in dllmain you cannot call MessageBox inside DllMain (it's severely restricted in what you can do). tenfour suggests using something like OutputDebugString.
제휴하지 않습니다 StackOverflow