
Originally Posted by
dakr54
dllmain is your entry point. from my knowledge it is most likely something else in your code causing detection.
any coder can correct me if i am wrong

.
small correction : DllMain is not the entry point. the real entry point is called _DllMainCRTStartup , unless you define a custom entry point
here is _DllMainCRTStartup defination from dllcrt0.c (lcated in VC/crt/src)
Code:
BOOL WINAPI
_DllMainCRTStartup(
HANDLE hDllHandle,
DWORD dwReason,
LPVOID lpreserved
)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
/*
* The /GS security cookie must be initialized before any exception
* handling targetting the current image is registered. No function
* using exception handling can be called in the current image until
* after __security_init_cookie has been called.
*/
__security_init_cookie();
}
return __DllMainCRTStartup(hDllHandle, dwReason, lpreserved);
}
__declspec(noinline)
BOOL __cdecl
__DllMainCRTStartup(
HANDLE hDllHandle,
DWORD dwReason,
LPVOID lpreserved
)
{
BOOL retcode = TRUE;
/*
* If this is a process detach notification, check that there has
* has been a prior process attach notification.
*/
if ( (dwReason == DLL_PROCESS_DETACH) && (__proc_attached == 0) )
/*
* no prior process attach notification. just return
* without doing anything.
*/
return FALSE;
__try {
if ( dwReason == DLL_PROCESS_ATTACH || dwReason == DLL_THREAD_ATTACH )
{
if ( _pRawDllMain )
retcode = (*_pRawDllMain)(hDllHandle, dwReason, lpreserved);
if ( retcode )
retcode = _CRT_INIT(hDllHandle, dwReason, lpreserved);
if ( !retcode )
return FALSE;
}
retcode = DllMain(hDllHandle, dwReason, lpreserved);
if ( (dwReason == DLL_PROCESS_ATTACH) && !retcode )
{
/*
* The user's DllMain routine returned failure, the C runtime
* needs to be cleaned up. Do this by calling _CRT_INIT again,
* this time imitating DLL_PROCESS_DETACH. Note this will also
* clear the __proc_attached flag so the cleanup will not be
* repeated upon receiving the real process detach notification.
*/
DllMain(hDllHandle, DLL_PROCESS_DETACH, lpreserved);
_CRT_INIT(hDllHandle, DLL_PROCESS_DETACH, lpreserved);
if (_pRawDllMain)
{
(*_pRawDllMain)(hDllHandle, DLL_PROCESS_DETACH, lpreserved);
}
}
if ( (dwReason == DLL_PROCESS_DETACH) ||
(dwReason == DLL_THREAD_DETACH) )
{
if ( _CRT_INIT(hDllHandle, dwReason, lpreserved) == FALSE )
retcode = FALSE ;
if ( retcode && _pRawDllMain )
retcode = (*_pRawDllMain)(hDllHandle, dwReason, lpreserved);
}
} __except ( __CppXcptFilter(GetExceptionCode(), GetExceptionInformation()) ) {
return FALSE;
}
return retcode ;
}