-
-
Save livz/8794bf3bc3ec55d11c12fe5862da2eb8 to your computer and use it in GitHub Desktop.
Simple Dll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#pragma comment(lib, "User32.lib") | |
/* | |
* Compile with cl: | |
* cl /nologo /LD myDll.c /link /out:myDll.dll | |
* | |
* Test: | |
* rundll32 myDll.dll,#1 | |
* | |
*/ | |
__declspec(dllexport) BOOL APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID lpReserved) | |
{ | |
switch(reason) | |
{ | |
case DLL_PROCESS_ATTACH: | |
case DLL_THREAD_ATTACH: | |
MessageBox(NULL, "DLL loaded", "DLL Main", MB_OK); | |
ExitProcess(1); | |
break; | |
case DLL_THREAD_DETACH: | |
case DLL_PROCESS_DETACH: | |
break; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment