mirror of
https://github.com/vxunderground/MalwareSourceCode.git
synced 2026-06-16 07:49:24 +00:00
900263ea6f
n/a
32 lines
1.4 KiB
C
32 lines
1.4 KiB
C
//===============================================================================================//
|
|
// This is a stub for the actuall functionality of the DLL.
|
|
//===============================================================================================//
|
|
#include "ReflectiveLoader.h"
|
|
|
|
// Note: REFLECTIVEDLLINJECTION_VIA_LOADREMOTELIBRARYR and REFLECTIVEDLLINJECTION_CUSTOM_DLLMAIN are
|
|
// defined in the project properties (Properties->C++->Preprocessor) so as we can specify our own
|
|
// DllMain and use the LoadRemoteLibraryR() API to inject this DLL.
|
|
|
|
// You can use this value as a pseudo hinstDLL value (defined and set via ReflectiveLoader.c)
|
|
extern HINSTANCE hAppInstance;
|
|
//===============================================================================================//
|
|
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )
|
|
{
|
|
BOOL bReturnValue = TRUE;
|
|
switch( dwReason )
|
|
{
|
|
case DLL_QUERY_HMODULE:
|
|
if( lpReserved != NULL )
|
|
*(HMODULE *)lpReserved = hAppInstance;
|
|
break;
|
|
case DLL_PROCESS_ATTACH:
|
|
hAppInstance = hinstDLL;
|
|
MessageBoxA( NULL, "Hello from DllMain!", "Reflective Dll Injection", MB_OK );
|
|
break;
|
|
case DLL_PROCESS_DETACH:
|
|
case DLL_THREAD_ATTACH:
|
|
case DLL_THREAD_DETACH:
|
|
break;
|
|
}
|
|
return bReturnValue;
|
|
} |