Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "HNetVarManager.h"
- void CNetVarManager::Setup( bool bLog )
- {
- ofstream log;
- log.open( "C:\\NetVars.txt" , ios_base::app );
- while( !g_pClient->GetAllClasses( ) )Sleep( 100 );
- for( ClientClass* pClass = g_pClient->GetAllClasses( ); pClass; pClass = pClass->m_pNext )
- {
- RecvProp* pProp[ 3 ];
- NetVarTable_t* pTable = new NetVarTable_t( pClass->m_pRecvTable->m_pNetTableName );
- if( bLog )log << "> " << pClass->m_pRecvTable->m_pNetTableName << endl;
- for( int i = 0; i < pClass->m_pRecvTable->m_nProps; ++i )
- {
- pProp[ 0 ] = &pClass->m_pRecvTable->m_pProps[ i ];
- if( isdigit( pProp[ 0 ]->m_pVarName[ 0 ] ) )continue; //sorting shit classes out
- if( bLog )log << "-> " << pProp[ 0 ]->m_pVarName << " [ 0x" << hex << pProp[ 0 ]->m_Offset << " ]" << endl;
- pTable->AddNetVar( pProp[ 0 ]->m_pVarName , pProp[ 0 ]->m_Offset );
- if( !pProp[ 0 ]->m_pDataTable )continue;
- for( int j = 0; j < pProp[ 0 ]->m_pDataTable->m_nProps; ++j )
- {
- pProp[ 1 ] = &pProp[ 0 ]->m_pDataTable->m_pProps[ j ];
- if( isdigit( pProp[ 1 ]->m_pVarName[ 0 ] ) )continue; //sorting shit classes out
- if( bLog )log << "--> " << pProp[ 1 ]->m_pVarName << " [ 0x" << hex << pProp[ 1 ]->m_Offset << " ]" << endl;
- pTable->AddNetVar( pProp[ 1 ]->m_pVarName , pProp[ 1 ]->m_Offset );
- if( !pProp[ 1 ]->m_pDataTable )continue;
- for( int k = 0; k < pProp[ 1 ]->m_pDataTable->m_nProps; ++k )
- {
- pProp[ 2 ] = &pProp[ 1 ]->m_pDataTable->m_pProps[ k ];
- if( isdigit( pProp[ 2 ]->m_pVarName[ 0 ] ) )continue; //sorting shit classes out
- if( bLog )log << "---> " << pProp[ 2 ]->m_pVarName << " [ 0x" << hex << pProp[ 2 ]->m_Offset << " ]" << endl;
- pTable->AddNetVar( pProp[ 2 ]->m_pVarName , pProp[ 2 ]->m_Offset );
- }
- }
- }
- this->AddNetVarTable( pTable );
- }
- log.close( );
- }
- vector<NetVarTable_t> pNetVarTableList;
- DWORD CNetVarManager::GetNetVarOffset( char* pszTableName , char* pszNetVar )
- {
- for( int i = 0; i < pNetVarTableList.size( ); ++i )
- {
- if( strcmp( pNetVarTableList[ i ].pszName , pszTableName ) != NULL )continue;
- for( int j = 0; j < pNetVarTableList[ i ].pNetVarList.size( ); ++j )
- {
- if( !strcmp( pNetVarTableList[ i ].pNetVarList[ j ].pszName , pszNetVar ) )
- return pNetVarTableList[ i ].pNetVarList[ j ].dwOffset ? pNetVarTableList[ i ].pNetVarList[ j ].dwOffset : NULL;
- }
- }
- return NULL;
- }
- void CNetVarManager::AddNetVarTable( NetVarTable_t* pNetVarTable )
- {
- pNetVarTableList.push_back( *pNetVarTable );
- }
- CNetVarManager* g_pNetVarManager;
Advertisement
Add Comment
Please, Sign In to add comment