Help with Aimbot

Posts 1–15 of 19 · Page 1 of 2
Help with Aimbot
Hello MPGH, Im starting the aimbot for my multihack and i was looking at Nether's Source to see how aimbots work and i couldn't get it working for some reason, ive moved it into my multihack (im intending to re-write it when its fixed) and i would appreciate some help

Here is what i have for the aimbot
Code:
float Get3D1(float X, float Y, float Z, float eX, float eY, float eZ)
{
	return(sqrtf((eX - X) * (eX - X) + (eY - Y) * (eY - Y) + (eZ - Z) * (eZ - Z)));
}

float CloseEnt()
{
	//Variables
	float fLowest = 100000, TMP;
	int iIndex;

	for (int i = 0; i < 32; i++)
	{
		EnemyPlayer[i].ReadInfo(i);
		//Store Distances In Array
		TMP = Get3D1(EnemyPlayer[0].Posi[0], EnemyPlayer[0].Posi[1], EnemyPlayer[0].Posi[2], EnemyPlayer[i].Posi[0], EnemyPlayer[i].Posi[1], EnemyPlayer[i].Posi[2]);

		//If Enemy Has Lower Distance The Player 1, Replace (var)Lowest With Current Enemy Distance
		if (TMP < fLowest && EnemyPlayer[i].Health != 0)
		{
			fLowest = TMP;
			iIndex = i;
		}
	}
	return iIndex;
}

void CalcAngle(float *src, float *dst, float *angles, int fFlags)
{
	double delta[3] = { (src[0] - dst[0]), (src[1] - dst[1]), (src[2] - dst[2]) };
	double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
	angles[0] = (float)(asinf(delta[2] / hyp) * 57.295779513082f);
	angles[1] = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f);
	angles[2] = 0.0f;

	if (delta[0] >= 0.0)
	{
		angles[1] += 180.0f;
	}

	if (fFlags == 775)
		angles[0] = angles[0] + 5;
}

void Aimbot() {

	if (GetAsyncKeyState(VK_MBUTTON))
	{
		for (int i = 0; i < 32; i++)
		{
		EnemyPlayer[i].ReadInfo(i);
		//Get Closest Entity Array Index Number
		int Index = CloseEnt();

		//Calculate Angle To Closest Entity
		CalcAngle(EnemyPlayer[0].Posi, EnemyPlayer[i].Posi, EnemyPlayer[i].Angle, EnemyPlayer[i].Flags);

		//Write To AngRotation The Current Angle Of The Entity
		Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[i].Angle[0]);
		Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[i].Angle[1]);
		//I did call the games function SetAng Here but it has bugs, Will be fixed on next release
		//Ill also add Bone-Aimbot ( i just cba to add it all in with the bulk pointers :P
		}
	}

}
And Here is what i have for the structs
Code:
struct EnemyPlayer_t
{
	uintptr_t CEntityList;
	int Health;
	int TeamNum;
	int Dormant;
	int ArmorValueInt;
	int Flags;
	float Posi[3];
	float Angle[3];

	void ReadInfo(int _pInfo) {
		CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
		Health = Mem.Read<int>(CEntityList + iHealth);
		TeamNum = Mem.Read<int>(CEntityList + iTeamNum);
		ArmorValue = Mem.Read<int>(CEntityList + ArmorValue);
		Dormant = Mem.Read<int>(CEntityList + IsDormant);
		Flags = Mem.Read<int>(CEntityList + m_fFlags);
		Posi[0] = Mem.Read<float>(CEntityList + vecOrigin);
		Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4);
		Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8);
		Angle[0] = Mem.Read<float>(Client + ViewAngle);
		Angle[1] = Mem.Read<float>(Client + ViewAngle + 0x4);
		Angle[2] = Mem.Read<float>(Client + ViewAngle + 0x8);
	}

}EnemyPlayer[32];
Any help would be greatly appreciated and if you help, you will be credited when i post the next version
I can't immediately see what's causing the problem, but you could try switching the floats to this Vector3 class from this math.h file that's around the copypastas. You can also search on github for "csgo-external" and look at the one by A5-. That's where I copied all my aimbot from and it works great even has velocity compensation. Best of luck
Code:
// math.h - Author Unknown

#pragma once

#define M_RADPI 57.295779513082f
#define M_PI 3.14159265358979323846
#define M_PI_F		((float)(M_PI))

#define SQUARE( a ) a*a
#define DEG2RAD( x  )  ( (float)(x) * (float)( M_PI_F / 180.f ) )
#define RAD2DEG( x  )  ( (float)(x) * (float)( 180.f/M_PI_F ) )



double inline __declspec ( naked ) __fastcall FastSQRT( double n )
{
	_asm fld qword ptr[ esp + 4 ]
	_asm fsqrt
	_asm ret 8
}

class Vector3
{
public:
	float x, y, z;

	Vector3()
	{
		x = y = z = 0.0f;
	}

	Vector3( float X, float Y, float Z )
	{
		x = X; y = Y; z = Z;
	}

	Vector3( float XYZ )
	{
		x = XYZ; y = XYZ; z = XYZ;
	}

	Vector3( float* v )
	{
		x = v[ 0 ]; y = v[ 1 ]; z = v[ 2 ];
	}

	Vector3( const float* v )
	{
		x = v[ 0 ]; y = v[ 1 ]; z = v[ 2 ];
	}

	inline Vector3& operator=( const Vector3& v )
	{
		x = v.x; y = v.y; z = v.z; return *this;
	}

	inline Vector3& operator=( const float* v )
	{
		x = v[ 0 ]; y = v[ 1 ]; z = v[ 2 ]; return *this;
	}

	inline float& operator[]( int i )
	{
		return ( ( float* )this )[ i ];
	}

	inline float operator[]( int i ) const
	{
		return ( ( float* )this )[ i ];
	}

	inline Vector3& operator+=( const Vector3& v )
	{
		x += v.x; y += v.y; z += v.z; return *this;
	}

	inline Vector3& operator-=( const Vector3& v )
	{
		x -= v.x; y -= v.y; z -= v.z; return *this;
	}

	inline Vector3& operator*=( const Vector3& v )
	{
		x *= v.x; y *= v.y; z *= v.z; return *this;
	}

	inline Vector3& operator/=( const Vector3& v )
	{
		x /= v.x; y /= v.y; z /= v.z; return *this;
	}

	inline Vector3& operator+=( float v )
	{
		x += v; y += v; z += v; return *this;
	}

	inline Vector3& operator-=( float v )
	{
		x -= v; y -= v; z -= v; return *this;
	}

	inline Vector3& operator*=( float v )
	{
		x *= v; y *= v; z *= v; return *this;
	}

	inline Vector3& operator/=( float v )
	{
		x /= v; y /= v; z /= v; return *this;
	}

	inline Vector3 operator-( ) const
	{
		return Vector3( -x, -y, -z );
	}

	inline Vector3 operator+( const Vector3& v ) const
	{
		return Vector3( x + v.x, y + v.y, z + v.z );
	}

	inline Vector3 operator-( const Vector3& v ) const
	{
		return Vector3( x - v.x, y - v.y, z - v.z );
	}

	inline Vector3 operator*( const Vector3& v ) const
	{
		return Vector3( x * v.x, y * v.y, z * v.z );
	}

	inline Vector3 operator/( const Vector3& v ) const
	{
		return Vector3( x / v.x, y / v.y, z / v.z );
	}

	inline Vector3 operator+( float v ) const
	{
		return Vector3( x + v, y + v, z + v );
	}

	inline Vector3 operator-( float v ) const
	{
		return Vector3( x - v, y - v, z - v );
	}

	inline Vector3 operator*( float v ) const
	{
		return Vector3( x * v, y * v, z * v );
	}

	inline Vector3 operator/( float v ) const
	{
		return Vector3( x / v, y / v, z / v );
	}

	inline float Length() const
	{
		return sqrtf( x * x + y * y + z * z );
	}

	inline float LengthSqr() const
	{
		return ( x * x + y * y + z * z );
	}

	inline float LengthXY() const
	{
		return sqrtf( x * x + y * y );
	}

	inline float LengthXZ() const
	{
		return sqrtf( x * x + z * z );
	}

	inline float DistTo( const Vector3& v ) const
	{
		return ( *this - v ).Length();
	}

	inline float Dot( const Vector3& v ) const
	{
		return ( x * v.x + y * v.y + z * v.z );
	}

	inline Vector3 Cross( const Vector3& v ) const
	{
		return Vector3( y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x );
	}

	inline bool IsZero() const
	{
		return ( x > -0.01f && x < 0.01f
				 &&	y > -0.01f && y < 0.01f
				 &&	z > -0.01f && z < 0.01f );
	}
};

class Matrix4x4
{
public:
	union
	{
		struct
		{
			float _11, _12, _13, _14;
			float _21, _22, _23, _24;
			float _31, _32, _33, _34;
			float _41, _42, _43, _44;
		};

		float m[ 4 ][ 4 ];
		float mm[ 16 ];

		struct
		{
			__m128 m1, m2, m3, m4;
		};
	};

	inline void Transpose()
	{
		for( int i = 0; i < 4; i++ )
		{
			for( int j = 0; j < 4; j++ )
			{
				m[ i ][ j ] = m[ j ][ i ];
			}
		}
	}

	inline Vector3& GetAxis( int i )
	{
		return *( Vector3* )&m[ i ][ 0 ];
	}
};

class Matrix3x4
{
public:
	union
	{
		struct
		{
			float _11, _12, _13, _14;
			float _21, _22, _23, _24;
			float _31, _32, _33, _34;
		};

		float m[ 3 ][ 4 ];
		float mm[ 12 ];
	};

	inline Vector3& GetAxis( int i )
	{
		return *( Vector3* )&m[ i ][ 0 ];
	}
};

class Math
{
public:

	Math()
	{
		srand( time( NULL ) );
	}

	void inline SinCos( float radians, float *sine, float *cosine )
	{
		_asm
		{
			fld		DWORD PTR[ radians ]
				fsincos

				mov edx, DWORD PTR[ cosine ]
				mov eax, DWORD PTR[ sine ]

				fstp DWORD PTR[ edx ]
				fstp DWORD PTR[ eax ]
		}

		*sine = sin( radians );
		*cosine = cos( radians );
	}

	void AngleVectors( const Vector3 &angles, Vector3 *forward )
	{

		float sr, sp, sy, cr, cp, cy;

		SinCos( DEG2RAD( angles[ 0 ] ), &sy, &cy );
		SinCos( DEG2RAD( angles[ 1 ] ), &sp, &cp );
		SinCos( DEG2RAD( angles[ 2 ] ), &sr, &cr );

		if( forward )
		{
			forward->x = cp*cy;
			forward->y = cp*sy;
			forward->z = -sp;
		}
	}

	void AngleVectors( const Vector3 &angles, Vector3 *forward, Vector3 *right, Vector3 *up )
	{

		float sr, sp, sy, cr, cp, cy;

		SinCos( DEG2RAD( angles[ 0 ] ), &sy, &cy );
		SinCos( DEG2RAD( angles[ 1 ] ), &sp, &cp );
		SinCos( DEG2RAD( angles[ 2 ] ), &sr, &cr );

		if( forward )
		{
			forward->x = cp*cy;
			forward->y = cp*sy;
			forward->z = -sp;
		}

		if( right )
		{
			right->x = ( -1 * sr*sp*cy + -1 * cr*-sy );
			right->y = ( -1 * sr*sp*sy + -1 * cr*cy );
			right->z = -1 * sr*cp;
		}

		if( up )
		{
			up->x = ( cr*sp*cy + -sr*-sy );
			up->y = ( cr*sp*sy + -sr*cy );
			up->z = cr*cp;
		}
	}

	float DotProduct( Vector3 &v1, float* v2 )
	{
		return v1.x*v2[ 0 ] + v1.y*v2[ 1 ] + v1.z*v2[ 2 ];
	}

	float Dot( const Vector3 &v1, Vector3 &v2 )
	{
		return v1[ 0 ] * v2[ 0 ] + v1[ 1 ] * v2[ 1 ] + v1[ 2 ] * v2[ 2 ];
	}

	void VectorTransform( Vector3 &in1, Matrix3x4& in2, Vector3 &out )
	{
		out.x = DotProduct( in1, in2.m[ 0 ] ) + in2.m[ 0 ][ 3 ];
		out.y = DotProduct( in1, in2.m[ 1 ] ) + in2.m[ 1 ][ 3 ];
		out.z = DotProduct( in1, in2.m[ 2 ] ) + in2.m[ 2 ][ 3 ];
	}

	float VecLength( Vector3& vec )
	{
		return FastSQRT( vec.x *  vec.x + vec.y *  vec.y + vec.z *  vec.z );
	}

	float VecDist( Vector3& fVec1, Vector3& fVec2 )
	{
		return FastSQRT( pow( fVec1.x - fVec2.x, 2 ) + pow( fVec1.y - fVec2.y, 2 ) + pow( fVec1.z - fVec2.z, 2 ) );
	}

	float GetFov( Vector3 angle, Vector3 src, Vector3 dst )
	{
		Vector3 ang, aim;
		ang = CalcAngle( src, dst );
		MakeVector( angle, aim );
		MakeVector( ang,   ang );

		float mag = FastSQRT( pow( aim.x, 2 ) + pow( aim.y, 2 ) + pow( aim.z, 2 ) );
		float u_dot_v = Dot( aim, ang );

		return RAD2DEG( acos( u_dot_v / ( pow( mag, 2 ) ) ) );
	}

	Vector3 CalcAngle( Vector3 PlayerPos, Vector3 EnemyPos )
	{
		Vector3 AimAngles;
		Vector3 delta = PlayerPos - EnemyPos;
		float hyp = FastSQRT( ( delta.x * delta.x ) + ( delta.y * delta.y ) ); //SUPER SECRET IMPROVEMENT CODE NAME DONUT STEEL
		AimAngles.x = atanf( delta.z / hyp ) * M_RADPI;
		AimAngles.y = atanf( delta.y / delta.x ) * M_RADPI;
		AimAngles.z = 0.0f;
		if( delta.x >= 0.0 )
			AimAngles.y += 180.0f;

		return AimAngles;
	}

	void VectorAngles( const Vector3& dir, Vector3 &angles )
	{
		float hyp = FastSQRT( ( dir.x * dir.x ) + ( dir.y * dir.y ) ); //SUPER SECRET IMPROVEMENT CODE NAME DONUT STEEL
		angles.x = atanf( dir.z / hyp ) * M_RADPI;
		angles.y = atanf( dir.y / dir.x ) * M_RADPI;
		angles.z = 0.0f;
		if( dir.x >= 0.0 )
			angles.y += 180.0f;
	}

	void ClampAngle( Vector3& angles )
	{
		if( angles.x < -89.0f )
			angles.x = 89.0f;
		if( angles.x >  89.0f )
			angles.x = 89.0f;
		if( angles.y < -180.0f )
			angles.y += 360.0f;
		if( angles.y >  180.0f )
			angles.y -= 360.0f;
		if( angles.z != 0.0f ) 
			angles.z = 0.0f;
	}

	void VectorNormalize( Vector3& v )
	{
		float l = VecLength( v );
		if( l != 0.0f )
		{
			v /= l;
		}
		else
		{
			v.x = v.y = 0.0f; v.z = 1.0f;
		}
	}

	void SmoothAngle( Vector3& ViewAngle, Vector3& DestAngles, float smooth )
	{
		Vector3 vecDelta = ViewAngle - DestAngles;
		ClampAngle( vecDelta );
		DestAngles = ViewAngle - vecDelta / 100.0f * smooth; // 50.0f is ur smooth value
	}

	void MakeVector( Vector3 angle, Vector3& vector )
	{
		float pitch = float( angle[ 0 ] * M_PI / 180 );
		float yaw = float( angle[ 1 ] * M_PI / 180 );
		float tmp = float( cos( pitch ) );
		vector[ 0 ] = float( -tmp * -cos( yaw ) );
		vector[ 1 ] = float( sin( yaw )*tmp );
		vector[ 2 ] = float( -sin( pitch ) );
	}

	Vector3 AngleToDirection( Vector3 angle )
	{
		// Convert angle to radians 
		angle.x = ( float )DEG2RAD( angle.x );
		angle.y = ( float )DEG2RAD( angle.y );

		float sinYaw = sin( angle.y );
		float cosYaw = cos( angle.y );

		float sinPitch = sin( angle.x );
		float cosPitch = cos( angle.x );

		Vector3 direction;
		direction.x = cosPitch * cosYaw;
		direction.y = cosPitch * sinYaw;
		direction.z = -sinPitch;

		return direction;
	}

	void VectorITransform( Vector3& in1, const Matrix3x4& in2, Vector3& out )
	{
		float in1t[ 3 ];

		in1t[ 0 ] = in1.x - in2.m[ 0 ][ 3 ];
		in1t[ 1 ] = in1.y - in2.m[ 1 ][ 3 ];
		in1t[ 2 ] = in1.z - in2.m[ 2 ][ 3 ];

		out.x = in1t[ 0 ] * in2.m[ 0 ][ 0 ] + in1t[ 1 ] * in2.m[ 1 ][ 0 ] + in1t[ 2 ] * in2.m[ 2 ][ 0 ];
		out.y = in1t[ 0 ] * in2.m[ 0 ][ 1 ] + in1t[ 1 ] * in2.m[ 1 ][ 1 ] + in1t[ 2 ] * in2.m[ 2 ][ 1 ];
		out.z = in1t[ 0 ] * in2.m[ 0 ][ 2 ] + in1t[ 1 ] * in2.m[ 1 ][ 2 ] + in1t[ 2 ] * in2.m[ 2 ][ 2 ];
	}

	void VectorIRotate( Vector3& in1, const Matrix3x4& in2, Vector3& out )
	{
		out.x = in1.x*in2.m[ 0 ][ 0 ] + in1.y*in2.m[ 1 ][ 0 ] + in1.z*in2.m[ 2 ][ 0 ];
		out.y = in1.x*in2.m[ 0 ][ 1 ] + in1.y*in2.m[ 1 ][ 1 ] + in1.z*in2.m[ 2 ][ 1 ];
		out.z = in1.x*in2.m[ 0 ][ 2 ] + in1.y*in2.m[ 1 ][ 2 ] + in1.z*in2.m[ 2 ][ 2 ];
	}
};
First of all, CSGO can properly handle 64 players on one server; not only 32.

Secondly, your code is very inconsistent. You are not using a vector, therefore you are using a float* to point to the array of 3 floats within your CalcAngle function, but in your Get3D1 function, you are passing each float individually.

Apart from reading the entity data for each entity twice, in your aimbot function aswell as in your CloseEnt function which you call inside of your aimbot function being extremely inefficient, you don't even need to have a for loop inside of your aimbot function. You are reading everything of each entity, but only use the data of your closest entity. Atleast you should, even though you don't. Read more on that below.

Code:
Aimbot for loop iteration 1
        CloseEnt for loop iteration 1
        CloseEnt for loop iteration 2
        CloseEnt for loop iteration 3
        .....................................
        CloseEnt for loop iteration 32
Aimbot for loop iteration 2
        CloseEnt for loop iteration 1
        CloseEnt for loop iteration 2
        CloseEnt for loop iteration 3
        .....................................
        CloseEnt for loop iteration 32
..................................
Aimbot for loop iteration 32
        CloseEnt for loop iteration 1
        CloseEnt for loop iteration 2
        CloseEnt for loop iteration 3
        .....................................
        CloseEnt for loop iteration 32
Return out of Aimbot for other stuff ( bunnyhop, glow or whatever if in the same thread )
Inside your aimbot function, you are reading each enemies data, yet you would only need the data of the closest entity.
Each time you are iterating inside your aimbot function, you are calculating an angle between index 0 and index i; after that you set the angle.
You are getting the closest entity, yet never use it. You are aiming at every entity. One after another.

You are assuming 0 is the index of yourself, inside your closeent function aswell as inside of your aimbot function ( calcangle ). This won't work online. You are barely ever at index 0 on an online server unless you are the very first player on the server.

You are getting the 3D distance between you and entity with index i, yet you never update the position of entity 0 ( assuming it's your own player ). What if you are at iteration 32, but your player already moved? You will get the distance between your old position and the entities current position. The same principle applies to calcangle. You are calculating an angle between your old position and the current position of the entity. Together with your badly optimized loop, this will lead into very bad angles. Imagine your angle at your completely pointless for loop iteration 32 inside your aimbot function, you've read your own position at the very first iteration, and since you're iterating 32 times inside the closeent function before you iterate again inside your aimbot function, you've already iterated 992 times through a for loop ( closeent ), which takes time. In that time, your own position could've changed drastically.

Code:
void Aimbot() {

	if (GetAsyncKeyState(VK_MBUTTON))
	{
		int Index = CloseEnt();
                EnemyPlayer[Index].ReadInfo(Index);
               
                int LocalPlayerIndex = 0; // Get the index of your LocalPlayer here.
                EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);

		CalcAngle(EnemyPlayer[LocalPlayerIndex].Posi, EnemyPlayer[Index].Posi, EnemyPlayer[Index].Angle, EnemyPlayer[Index].Flags);

		Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[Index].Angle[0]);
		Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[Index].Angle[1]);
	}
}
Ok, So now i have this for my aimbot loop
Code:
void Aimbot()
{

	if (GetAsyncKeyState(VK_MBUTTON))
	{
		int Index = CloseEnt();
		EnemyPlayer[Index].ReadInfo(Index);

		int LocalPlayerIndex = 0x178; // Get the index of your LocalPlayer here.
		EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);

		CalcAngle(EnemyPlayer[LocalPlayerIndex].Posi, EnemyPlayer[Index].Posi, EnemyPlayer[Index].Angle, EnemyPlayer[Index].Flags);

		Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[Index].Angle[0]);
		Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[Index].Angle[1]);
	}
}
And this for my struct

Code:
struct EnemyPlayer_t
{
	uintptr_t CEntityList;
	int Health;
	int TeamNum;
	int Dormant;
	int ArmorValueInt;
	int Flags;
	float Posi[3];
	float Angle[3];

	void ReadInfo(int _pInfo) {
		CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
		Health = Mem.Read<int>(CEntityList + iHealth);
		TeamNum = Mem.Read<int>(CEntityList + iTeamNum);
		ArmorValue = Mem.Read<int>(CEntityList + ArmorValue);
		Dormant = Mem.Read<int>(CEntityList + IsDormant);
		Flags = Mem.Read<int>(CEntityList + m_fFlags);
		Posi[0] = Mem.Read<float>(CEntityList + vecOrigin);
		Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4);
		Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8);
		Angle[0] = Mem.Read<float>(Client + ViewAngle);
		Angle[1] = Mem.Read<float>(Client + ViewAngle + 0x4);
		Angle[2] = Mem.Read<float>(Client + ViewAngle + 0x8);
	}

}EnemyPlayer[32];
and whenever i press middle mouse now, it crashes my cheat... do you possibly know what is causing that to happen? its also not changing the angle to the enemy player
Quote Originally Posted by ImWhacky View Post
and whenever i press middle mouse now, it crashes my cheat... do you possibly know what is causing that to happen? its also not changing the angle to the enemy player
Code:
int LocalPlayerIndex = 0x178; // Get the index of your LocalPlayer here.
EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);
You are trying to write to EnemyPlayer[ 376 ], which doesn't exist. You are accessing your array out of the bounds. You created an array of 32 entries and now try to access entry 376.

You are supposed to get the ID of your LocalPlayer.
Either read PlayerBase + 0x64 or get it via IVEngineClient::GetLocalPlayer, which returns you ClientState + 0x178, hence the 0x178. You'd need to read ClientState + 0x178 to get the ID.

Also, how do you get dwAngPtr ?
I'm probably wrong but I think I'm getting the engine pointer, I can't remember and I'm at school so I can't check it, what is the dwAngPtr supposed to be?
Quote Originally Posted by ImWhacky View Post
I'm probably wrong but I think I'm getting the engine pointer, I can't remember and I'm at school so I can't check it, what is the dwAngPtr supposed to be?
Listen to the teacher and don't browse MPGH, i told you before!

It's supposed to be RPM( engine.dll + ClientState ).
Quote Originally Posted by WasserEsser View Post
Listen to the teacher and don't browse MPGH, i told you before!

It's supposed to be RPM( engine.dll + ClientState ).
I've only got a few days left of school and I'm in study halls so it's chill, thanks again, I'll try that when I get home
OK, so now i have this for my aimbot function
Code:
void Aimbot()
{

	if (GetAsyncKeyState(VK_MBUTTON))
	{
		int Index = CloseEnt();
		EnemyPlayer[Index].ReadInfo(Index);

		dwAngPtr = Mem.Read<float>(Engine + ClientState);
		int LocalPlayerIndex = Mem.Read<int>(ClientState + 0x178); // Get the index of your LocalPlayer here.
		EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);

		CalcAngle(EnemyPlayer[LocalPlayerIndex].Posi, EnemyPlayer[Index].Posi, EnemyPlayer[Index].Angle, EnemyPlayer[Index].Flags);

		Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[Index].Angle[0]);
		Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[Index].Angle[1]);
	}
And this is what i have for my struct
Code:
struct EnemyPlayer_t
{
	uintptr_t CEntityList;
	int Health;
	int TeamNum;
	int Dormant;
	int ArmorValueInt;
	int Flags;
	float Posi[3];
	float Angle[3];

	void ReadInfo(int _pInfo) {
		CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
		Health = Mem.Read<int>(CEntityList + iHealth);
		TeamNum = Mem.Read<int>(CEntityList + iTeamNum);
		ArmorValue = Mem.Read<int>(CEntityList + ArmorValue);
		Dormant = Mem.Read<int>(CEntityList + IsDormant);
		Flags = Mem.Read<int>(CEntityList + m_fFlags);
		Posi[0] = Mem.Read<float>(CEntityList + vecOrigin);
		Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4);
		Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8);
		Angle[0] = Mem.Read<float>(Client + ViewAngle);
		Angle[1] = Mem.Read<float>(Client + ViewAngle + 0x4);
		Angle[2] = Mem.Read<float>(Client + ViewAngle + 0x8);
	}

}EnemyPlayer[32];
I think i have everything you said but its still not working, i think it is something wrong with the angle part in my struct but im not sure.
Code:
void Aimbot()
{

	if (GetAsyncKeyState(VK_MBUTTON))
	{
		int Index = CloseEnt();
		EnemyPlayer[Index].ReadInfo(Index);

		dwAngPtr = Mem.Read<float>(Engine + ClientState);
		int LocalPlayerIndex = Mem.Read<int>(dwAngPtr + 0x178) - 1; // Get the index of your LocalPlayer here.
		EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);

		CalcAngle(EnemyPlayer[LocalPlayerIndex].Posi, EnemyPlayer[Index].Posi, EnemyPlayer[Index].Angle, EnemyPlayer[Index].Flags);

		Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[Index].Angle[0]);
		Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[Index].Angle[1]);
	}
}
Quote Originally Posted by WasserEsser View Post
Code:
void Aimbot()
{

    if (GetAsyncKeyState(VK_MBUTTON))
    {
        int Index = CloseEnt();
        EnemyPlayer[Index].ReadInfo(Index);

        dwAngPtr = Mem.Read<float>(Engine + ClientState);
        int LocalPlayerIndex = Mem.Read<int>(dwAngPtr + 0x178) - 1; // Get the index of your LocalPlayer here.
        EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);

        CalcAngle(EnemyPlayer[LocalPlayerIndex].Posi, EnemyPlayer[Index].Posi, EnemyPlayer[Index].Angle, EnemyPlayer[Index].Flags);

        Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[Index].Angle[0]);
        Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[Index].Angle[1]);
    }
}
I put that in and now its just enabling my triggerbot when i press Middle mouse and the aimbot is still not working @WasserEsser
Quote Originally Posted by ImWhacky View Post
I put that in and now its just enabling my triggerbot when i press Middle mouse and the aimbot is still not working @WasserEsser
Post your full code.
Quote Originally Posted by WasserEsser View Post
Post your full code.
Triggerbot
Code:
#include <windows.h>
#include <d3d9.h>
#include "Offsets.h"
#include "ProcMem.h"
#include <iostream>
#include <d3dx9.h>
#include <Dwmapi.h> 
#include <TlHelp32.h> 
#include <cstdlib>

#pragma once
void Triggerbot()
{
		if (Trigger)
		{
			int RandomDelay = rand() % 100 + 1;
			if ((inCross > 0 && inCross <= 64) && Triggerbot_Entity_TeamID != Local_Player_Team)
			{
				if (TriggerKey)
				{
					if (GetAsyncKeyState(VK_MBUTTON) & 0x8000)
					{
						if (RandomDelayEnabled)
							Sleep(RandomDelay);

						Mem.Write<int>(Client + attack, 1);
						Sleep(10);
						Mem.Write<int>(Client + attack, 0);
					}
				}
				else {
					if (RandomDelayEnabled)
						Sleep(RandomDelay);

					Mem.Write<int>(Client + attack, 1);
					Sleep(10);
					Mem.Write<int>(Client + attack, 0);
				}
			}
		}
		Sleep(1);
}
Aimbot
Code:
#pragma once
#include "Offsets.h"
#include "hDirectX.h"
#include <math.h>
//AIM

float Get3D1(float X, float Y, float Z, float eX, float eY, float eZ)
{
	return(sqrtf((eX - X) * (eX - X) + (eY - Y) * (eY - Y) + (eZ - Z) * (eZ - Z)));
}

float CloseEnt()
{
	//Variables
	float fLowest = 100000, TMP;
	int iIndex;

	for (int i = 0; i < 32; i++)
	{
		EnemyPlayer[i].ReadInfo(i);
		//Store Distances In Array
		TMP = Get3D1(EnemyPlayer[0].Posi[0], EnemyPlayer[0].Posi[1], EnemyPlayer[0].Posi[2], EnemyPlayer[i].Posi[0], EnemyPlayer[i].Posi[1], EnemyPlayer[i].Posi[2]);

		//If Enemy Has Lower Distance The Player 1, Replace (var)Lowest With Current Enemy Distance
		if (TMP < fLowest && EnemyPlayer[i].Health != 0)
		{
			fLowest = TMP;
			iIndex = i;
		}
	}
	return iIndex;
}

void CalcAngle(float *src, float *dst, float *angles, int fFlags)
{
	double delta[3] = { (src[0] - dst[0]), (src[1] - dst[1]), (src[2] - dst[2]) };
	double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
	angles[0] = (float)(asinf(delta[2] / hyp) * 57.295779513082f);
	angles[1] = (float)(atanf(delta[1] / delta[0]) * 57.295779513082f);
	angles[2] = 0.0f;

	if (delta[0] >= 0.0)
	{
		angles[1] += 180.0f;
	}

	if (fFlags == 775)
		angles[0] = angles[0] + 5;
}

void Aimbot()
{

	if (GetAsyncKeyState(VK_LSHIFT))
	{
		int Index = CloseEnt();
		EnemyPlayer[Index].ReadInfo(Index);

		dwAngPtr = Mem.Read<float>(Engine + ClientState);
		int LocalPlayerIndex = Mem.Read<int>(dwAngPtr + 0x178) - 1; // Get the index of your LocalPlayer here.
		EnemyPlayer[LocalPlayerIndex].ReadInfo(LocalPlayerIndex);

		CalcAngle(EnemyPlayer[LocalPlayerIndex].Posi, EnemyPlayer[Index].Posi, EnemyPlayer[Index].Angle, EnemyPlayer[Index].Flags);

		Mem.Write<float>(dwAngPtr + 0x4C88, EnemyPlayer[Index].Angle[0]);
		Mem.Write<float>(dwAngPtr + 0x4C8C, EnemyPlayer[Index].Angle[1]);
	}
}
Offsets File (Structs are in here)

Code:
#pragma once
#include <windows.h>
#include "ProcMem.h"
ProcMem Mem;

/* Changing */
DWORD LocalPlayer = 0x00A844DC;
DWORD EntityList = 0x04A9F8D4;
DWORD GlowObjectBase = 0x04FB576C;
DWORD attack = 0x02EDF8D0;
DWORD jump = 0x04F34C68;
DWORD sensitivity = 0x00A89CE4;
DWORD ViewAngle = 0x4D0C;
DWORD Mouse = 0x00A89D40;
DWORD ClientState = 0x00610344;

DWORD  ViewMatrix = 0x4A91464; // ViewMatrix offset
DWORD  iHealth = 0xFC; // iHealth offset [Always: 0xFC]
DWORD  iTeamNum = 0xF0; // Team offset [Always: 0xF0]
DWORD  ArmorValue = 0xA9E8; // Armor Value [Cuz cool?]
DWORD  IsDormant = 0xE9; // Is dormant or na? [Always: 0xE9]
DWORD  vecOrigin = 0x134;// vecOrigin offset [Always: 0x134];

/* Constant */
DWORD LocalPlayerIndex_a = 0x178;
DWORD m_iCrossHairID = 0xAA44;
DWORD m_iTeamNum = 0xF0;
DWORD m_fFlags = 0x100;
DWORD GlowIndex = 0xA310;
DWORD isDormant = 0xE9;
DWORD bSpotted = 0x939;
DWORD bSpottedByMask = 0x97C;
DWORD FlashMaxAlpha = 0xA2F4;
DWORD dw_EntityLoopDistance = 0x10;
DWORD dw_healthOffset = 0xFC;
DWORD m_vecOrigin = 0x134;
DWORD m_iFOV = 0x31C8;
DWORD punch = 0x300C;
DWORD DrawViewmodel = 0x3033;
DWORD ZoomLevel = 0x3330;
DWORD WeaponID = 0x0030;
DWORD EnginePosition = 0x006BEB3C;
float dwAngPtr;

DWORD EnginePointer;
DWORD VectorPunch;


bool AimbotMenu = false;
bool VisualsMenu = true;
bool OtherMenu = false;
bool OptionsMenu = false;

int menux = 100;
int menuy = 100;

int MenuR = 26;
int MenuG = 184;
int MenuB = 237;

int AccentR = 17;
int AccentG = 17;
int AccentB = 17;

bool MenuSelectR = true;
bool MenuSelectG = false;
bool MenuSelectB = false;

bool Trigger = false;
bool bhop = false;
bool GlowESPEnabled = false;
bool SlowAimEnabled = false;
bool NoFlashEnabled = false;
bool RadarEnabled = false;
bool FirstScan = true;
bool DrawCrosshair = false;
bool FovEnabled = false;
bool RandomDelayEnabled = false;
bool TriggerKey = false;
bool RCSEnabled = false;
bool AutoShootEnabled = false;
bool RainbowMenu = false;
bool RainbowCrosshair = false;
bool BoxESPEnabled = false;
bool SnapLinesEnabled = false;
bool AimbotEnabled = false;

bool SpottedCrosshair = false;

int IdleCrossR = 237;
int IdleCrossG = 184;
int IdleCrossB = 26;

int SpottedCrossR = 26;
int SpottedCrossG = 184;
int SpottedCrossB = 237;

int SnapEnemyR = 255;
int SnapEnemyG = 0;
int SnapEnemyB = 0;

int SnapTeamR = 0;
int SnapTeamG = 255;
int SnapTeamB = 0;

bool BoxRSelected = true;
bool BoxGSelected = false;
bool BoxBSelected = false;

int BoxR = 255;
int BoxG = 0;
int BoxB = 0;

bool SpottedR = true;
bool SpottedG = false;
bool SpottedB = false;

bool IdleR = true;
bool IdleG = false;
bool IdleB = false;

bool TeamCRed = false;
bool TeamCGreen = true;
bool TeamCBlue = false;
bool TeamCYellow = false;
bool TeamCOrange = false;
bool TeamCPurple = false;
bool TeamCWhite = false;
bool TeamCMint = false;
bool TeamCSkyBlue = false;
bool TeamCHotPink = false;

bool EnemyCRed = true;
bool EnemyCGreen = false;
bool EnemyCBlue = false;
bool EnemyCYellow = false;
bool EnemyCOrange = false;
bool EnemyCPurple = false;
bool EnemyCWhite = false;
bool EnemyCMint = false;
bool EnemyCSkyBlue = false;
bool EnemyCHotPink = false;

#define PI 3.14159265//Defining what PI is. PI is a Circle
int CenterX = GetSystemMetrics(0) / 2 - 1;//Gets screen X resolution then cutting it in half to ##### the center.
int CenterY = GetSystemMetrics(1) / 2 - 1;//Gets screen Y resolution then cutting it in half to ##### the center.

struct GlowStruct
{
	float r;      // Red
	float g;      // Green
	float b;      // Blue
	int a;      // Alpha
	bool rwo;     // RenderWhenOccluded
	bool rwuo;    // RenderWhenUnoccluded
};

int Current_Player_GlowIndex;
int Current_Player_Team;
DWORD Client;
DWORD Engine;
DWORD LocalBase;
DWORD GlowPointer;
int Local_Player_Team;
int inCross;
DWORD Trigger_EntityBase;
int Triggerbot_Entity_TeamID;
DWORD Crosshair_EntityBase;
int Crosshair_Entity_TeamID;
DWORD SlowAim_EntityBase;
int SlowAim_Entity_TeamID;
float Flash_Max_Alpha;
int FOV = 100;
int MySensitivity;

DWORD Current_Player;
bool Current_Player_Dormant;
DWORD G_Current_Player;
bool G_Current_Player_Spotted;

bool SeeMenu = true;

struct SimplePlayer_t
{
	uintptr_t pLocal;
	int Health;
	int TeamNum;
	int Dormant;
	int ArmorValueInt;
	float Posi[3];

	void ReadInfo() {
		pLocal = Mem.Read<uintptr_t>(Client + LocalPlayer);
		Health = Mem.Read<int>(pLocal + iHealth);
		TeamNum = Mem.Read<int>(pLocal + iTeamNum);
		ArmorValue = Mem.Read<int>(pLocal + ArmorValue);
		Dormant = Mem.Read<int>(pLocal + IsDormant);
		Posi[0] = Mem.Read<float>(pLocal + vecOrigin);
		Posi[1] = Mem.Read<float>(pLocal + vecOrigin + 0x4);
		Posi[2] = Mem.Read<float>(pLocal + vecOrigin + 0x8);
		Posi[3] = Mem.Read<float>(pLocal + vecOrigin + 0x8);
	}
}SimplePlayer;

typedef struct
{
	float flMatrix[4][4];
}WorldToScreenMatrix_t;

struct EnemyPlayer_t
{
	uintptr_t CEntityList;
	int Health;
	int TeamNum;
	int Dormant;
	int ArmorValueInt;
	int Flags;
	float Posi[3];
	float Angle[3];

	void ReadInfo(int _pInfo) {
		CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
		Health = Mem.Read<int>(CEntityList + iHealth);
		TeamNum = Mem.Read<int>(CEntityList + iTeamNum);
		ArmorValue = Mem.Read<int>(CEntityList + ArmorValue);
		Dormant = Mem.Read<int>(CEntityList + IsDormant);
		Flags = Mem.Read<int>(CEntityList + m_fFlags);
		Posi[0] = Mem.Read<float>(CEntityList + vecOrigin);
		Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4);
		Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8);
		Angle[0] = Mem.Read<float>(Client + ViewAngle);
		Angle[1] = Mem.Read<float>(Client + ViewAngle + 0x4);
		Angle[2] = Mem.Read<float>(Client + ViewAngle + 0x8);
	}

}EnemyPlayer[32];

RECT m_Rect;
RECT OurWindow;
RECT OurWindow1;
I think thats all of it
"#define PI 3.14159265//Defining what PI is. PI is a Circle"
Quote Originally Posted by pean153 View Post
"#define PI 3.14159265//Defining what PI is. PI is a Circle"
Just in case I forgot lol
Posts 1–15 of 19 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us