注入DLL它不起作用

时间:2014-12-14 14:11:47

标签: c++

我有一个DLL

#include <windows.h>
     BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
    {
            switch (fdwReason)
        {
            case DLL_PROCESS_ATTACH:
                MessageBox(NULL, "DLL_PROCESS_ATTACH", "", MB_OK);
                hWndProc();
                break;

            case DLL_PROCESS_DETACH:
                MessageBox(NULL, "DLL_PROCESS_DETACH", "", MB_OK);
                break;

            case DLL_THREAD_ATTACH:
                MessageBox(NULL, "DLL_THREAD_ATTACH", "", MB_OK);
                break;

            case DLL_THREAD_DETACH:
                MessageBox(NULL, "DLL_THREAD_DETACH", "", MB_OK);
                break;
        }
        return TRUE; // succesful
    }

我使用Winject在进程中注入此DLL,但是当DLL在该进程中时它不起作用。消息框不会显示。

0 个答案:

没有答案