keybode

css v34 PrepareSteamConnectResponse hook

Jan 10th, 2016
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. bool __fastcall Hooked_PrepareSteamConnectResponse( void* ecx, void* edx, int a2, int a3, int a4, int a5, int a6, int a7, bf_write& msg )
  2. {
  3.     bool bRet = m_PrepareSteamConnectResponse( ecx, a2, a3, a4, a5, a6, a7, msg );
  4.  
  5.     // header = 4
  6.     // c2s_connect = 1
  7.     // protocol_version = 4
  8.     // auth_protocol = 4
  9.     // challenge_nr = 4
  10.     // name = strlen( cl_name.m_pszString );
  11.     // password = strlen( cl_password.m_pszString );
  12.     // steam3_cookie_len = 2
  13.     // steam3_cookie
  14.  
  15.     int offset = 4 + 1 + 4 + 4 + 4;
  16.  
  17.     static ConVar* name = m_pCvar->FindVar( "name" );
  18.  
  19.     int add = strlen( name->m_pszString );
  20.  
  21.     offset += add + 1;
  22.  
  23.     static ConVar* password = m_pCvar->FindVar( "password" );
  24.  
  25.     add = strlen( password->m_pszString );
  26.  
  27.     offset += add + 1;
  28.  
  29.     char* steam3Cookie = ( char* )( msg.m_pData + offset );
  30.  
  31.     Framework::DebugPrint( "cookie: %s", steam3Cookie );
  32.  
  33.     return bRet;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment