Howto call MessageBox in dllmain

前端 未结 2 715
滥情空心
滥情空心 2021-01-19 12:11

I\'m creating a little dll to use in a DLL-INJECTION POC (proof-of-concept). I\'m using codeblocks\' c++ ide.

My dll\'s main (dllmain) looks like this:



        
2条回答
  •  孤街浪徒
    2021-01-19 12:51

    See this question to read about the huge number of limitations in DllMain. It's not just security problems. Anything exported by user32 falls into this category.

    In other words, you cannot use MessageBox in DllMain. Use something like OutputDebugString instead, which is in kernel32 and does not display any UI.

提交回复
热议问题