MH_CreateAndEnableHook ( pSAMP -> dwSAMPAddr + 0x9525 , & HOOK_RakClientDestructor , NULL ) ;
__declspec ( naked ) void HOOK_RakClientDestructor ( void ) { if ( pSAMP -> getInfo ( ) -> pRakClientInterface != NULL ) delete pSAMP -> getInfo ( ) -> pRakClientInterface ; pSAMP -> getInfo ( ) -> pRakClientInterface = pSAMP -> getRakClientInterface ( ) ; static DWORD retDestruct = pSAMP -> dwSAMPAddr + 0x37686 ; __asm { mov eax , [ esp + 04 ] test eax , eax jmp retDestruct } }
typedef void ( __fastcall * sub_10009510 ) ( void * ) ; sub_10009510 fpHkDestructor = 0 ; void __fastcall HOOK_sub_10009510 ( void * pThis ) { pSAMP -> getInfo ( ) -> pRakClientInterface = pSAMP -> getRakClientInterface ( ) ; return fpHkDestructor ( pThis ) ; } MH_CreateHook ( reinterpret_cast ( dwSAMP + 0x9510 ) , & HOOK_sub_10009510 , reinterpret_cast ( & fpHkDestructor ) ) ; MH_EnableHook ( reinterpret_cast ( dwSAMP + 0x9510 ) ) ;