int __stdcall undo( )
{
// detach function.
// add ur undo stuff..
// e.g: c_hooks::get( )->undo( );
// return true
return 1;
}
unsigned long __stdcall init( )
{
// attach function.
// call ur stuff, etc...
// e.g: c_hooks::get( )->init( );
// EXIT_SUCESSFULLY.
return 0;
}
int __stdcall DllMain( HMODULE module_stroing, unsigned long reason_for_call, void* reserved )
{
// disable useless calls.
DisableThreadLibraryCalls( module_stroing );
switch ( reason )
{
case DLL_PROCESS_ATTACH:
{
// init ur thread.
if ( const auto thread = CreateThread( 0, 0, init, module_stroing, 0, 0 ) )
CloseHandle( thread );
// break this case.
break;
}
case DLL_PORCESS_DETACH:
{
// init ur detach function.
undo( );
// break this case.
break;
}
}
// return trueeeeeee.
return 1;
}