Code:
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( TOOLKIT::_OFFSET ( USERCMD_2 ) ) , &sequence_number, 4, NULL );
uiSeed = MD5_PseudoRandom( sequence_number + 1 ) & 0x7fffffff;
iSeed = uiSeed &255;
iSeed++;
Random::SetSeed(iSeed);
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwLocalPlayer + 0xD28 ) , &m_hActiveWeapon, sizeof(unsigned long), NULL );
WeaponIndex = m_hActiveWeapon & 0xFFF;
dwWeaponAddress = GetEntityByIndex(WeaponIndex);
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponAddress + 0x9A6 ) , &wPtr, sizeof(WORD), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( TOOLKIT::_OFFSET ( WeaponData_1 ) ) , &dwWeaponDataPtr, sizeof(DWORD), NULL );
DWORD dwWeaponDataInfo = 0x10 * wPtr + dwWeaponDataPtr + 0xC;
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponDataInfo ) , &dwWeaponDataInfo, sizeof(DWORD), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponAddress + 0x9E4 ) , &dwThisPtr, sizeof(DWORD), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponDataInfo + 4 * dwThisPtr + 0x8E4 ) , &v11, sizeof(float), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponDataInfo + 4 * dwThisPtr + 0x8AC ) , &flCone, sizeof(float), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponDataInfo + 0x6F8 ) , &var_4, sizeof(float), NULL );
float v15 = var_4 * 0.9499999881f;
float v16 = var_4 * 0.3400000036f;
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwLocalPlayer + 0x100 ) , &LocalMove, sizeof(float), NULL );
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwLocalPlayer + 0xFC ) , &LocalVelocity, sizeof(float), NULL );
flSpeed = sqrt((LocalMove * LocalMove) + (LocalVelocity * LocalVelocity));
ReadProcessMemory( TOOLKIT::_HANDLE ( HL2 ), (PVOID)( dwWeaponAddress + 0x9E8 ) , &multi, sizeof(float), NULL );
float flSpread = sub_(flSpeed,v16,v15,0.000000f,v11) + multi;
Random::RandomFloat ( 0.0f, PI * 2 );
Random::RandomFloat ( 0.0f, flSpread );
Random::RandomFloat ( 0.0f, PI * 2 );
Random::RandomFloat ( 0.0f, flCone ); |