keybode

Untitled

Apr 14th, 2019
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. int CreateKeyValues( int a1 )
  2. {
  3.     static auto image = ( std::uintptr_t )GetModuleHandleA( "engine.dl" );
  4.     static auto procedure = reinterpret_cast< int( __cdecl* )( int ) >( image + 0x24B630 );
  5.     return procedure( a1 );
  6. }
  7.  
  8. DWORD* SetKeyValues( DWORD* a1, const char* a2 )
  9. {
  10.     static auto image = ( std::uintptr_t )GetModuleHandleA( "engine.dl" );
  11.     static auto procedure = reinterpret_cast< DWORD*( __thiscall* )( DWORD*, const char* ) >( image + 0x24B5D0 );
  12.     return procedure( a1, a2 );
  13. }
  14.  
  15. DWORD* SetKeyValuesString( DWORD* a1, const char* a2, const char* a3 )
  16. {
  17.     static auto image = ( std::uintptr_t )GetModuleHandleA( "engine.dl" );
  18.     static auto procedure = reinterpret_cast< DWORD*( __thiscall* )( DWORD*, const char*, const char* ) >( image + 0x24E0D0 );
  19.     return procedure( a1, a2, a3 );
  20. }
  21.  
  22. class IVEngineClient
  23. {
  24. public:
  25.     void ServerCmdKeyValues( KeyValues* pKeyValues )
  26.     {
  27.         return memory::Call< 127, void >( this, pKeyValues );
  28.     }
  29. };
  30.  
  31. void SetClanTag( const char* clan_tag )
  32. {
  33.     DWORD* pKeyValues = ( DWORD* )CreateKeyValues( 32 );
  34.    
  35.     if( !pKeyValues )
  36.         return;
  37.        
  38.     pKeyValues = SetKeyValues( pKeyValues, "ClanTagChanged" );
  39.     SetKeyValuesString( pKeyValues, "tag", clan_tag );
  40.     g_pEngineClient->ServerCmdKeyValues( pKeyValues );
  41. }
Advertisement
Add Comment
Please, Sign In to add comment