Home > Software engineering >  Why the remote thread injecting DLL procedures no response?
Why the remote thread injecting DLL procedures no response?

Time:09-23

With remote DLL injection shows success
1. The are injected into the program will press a key no response
2. Sometimes like card machine
Don't understand why???
Don't know much about remote injection Hook what you need to add some

 # include & lt; Windows. H> 
The static HHOOK MeHow=NULL;
The static HMODULE YouLose=NULL;

LRESULT a CALLBACK LoseProc (LPARAM int code, WPARAM w, l)
{
If (code & lt; 0)
Return CallNextHookEx (MeHow, code, w, l);
If (code==HC_ACTION & amp; & GetKeyState (w) & lt; 0)
{
MessageBox (NULL, "lose" the "error", "", 0).
}
Return CallNextHookEx (MeHow, code, w, l);
}
BOOL APIENTRY DllMain (HMODULE HMODULE, dwords ul_reason_for_call LPVOID lpReserved)
{
The switch (ul_reason_for_call)
{
Case DLL_PROCESS_ATTACH:
{
YouLose=(HINSTANCE hModule);
MeHow=SetWindowsHookEx (WH_KEYBOARD, HOOKPROC LoseProc, (HINSTANCE) YouLose, 0).
If (MeHow==NULL)
{
MessageBoxA (0, "Loser", "", 0).
Return TRUE;
}
The else {
MessageBoxA (0, "Instance to DLLC", "", 0).
MSG MSG.
While (GetMessage (& amp; MSG, NULL, 0, 0))
{
TranslateMessage (& amp; MSG);
DispatchMessage (& amp; MSG);
}
}
}
break;
Case DLL_THREAD_ATTACH:
break;
Case DLL_THREAD_DETACH:
break;
Case DLL_PROCESS_DETACH:
{
If (MeHow!=NULL)
UnhookWindowsHookEx (MeHow);
MessageBoxA (0, "chat", "", 0).
break;
}
}
Return TRUE;
}

CodePudding user response:

Hooks don't use block form of MessageBox function
Can try OutputDebugString non-blocking operations

  • Related