Solved Aimbot not aim to Enemy

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Camaru

Newbie
Oct 26, 2015
26
183
1
Hello Everyone can you tell me about my Problem? I'm already update Offset, Address for my Game Correctly.

here my Problem my Aimbot it's aim to Sky or Everything

https://www.youtube.com/watch?v=XvHBjE0f3ZQ

here my code Cpoy&Past

C++:
/*This code allows us to create a Triggerbot hack for CSS,
in theory this will work for most games. 
Especially source based like TF2 all Counter-strikes etc.

Credits to ExcidiumDubstep for external base tutorial and Nubtik for certain code sections

Written by Fleep at [url]https://guidedhacking.com/[/url], feel free to check us out for many tutorials 
on cheating and join our friendly hacking community
If you end up releasing any hacks from this code they would be greatly appreciated on our GuidedHacking.
*/

/*
TO DO:
-ADD m_fFlags CHECK on enemies so we can aim appropriately
*/
#include <Windows.h>  
#include <iostream> 
#include <math.h>  
#include "HackProcess.h"
#include <vector>
#include <algorithm>    // std::sort
//Create our 'hooking' and process managing object
CHackProcess fProcess;  
using namespace std;  
//We use F6 to exit the hack
#define F6_Key 0x75
//right click
#define RIGHT_MOUSE 0x02
//Here we store the num of players and update it regularly to know how many enemies we are dealing with
//this saves us doing loops unless their necessary e.g. we have 12 players and still loop 32 times wasting our great resources
//This makes our triggerbot MUCH faster in general
int NumOfPlayers = 32;
const DWORD dw_PlayerCountOffs = 0x0;//Engine.dll

//The player base is VERY important so we know where our player info is at
//including current jump status so we can use force jumping making our bHop
const DWORD Player_Base = 0x0;
const DWORD GameBase = 0x0;
//The ATTACK address BELOW, WE WRITE 5 TO SHOOT OR 4 TO 
const DWORD dw_mTeamOffset = 0x00;//client
const DWORD dw_Health = 0x00;//client
//FOR the x coord we can use cl_pdump for m_vecOrigin Vector or just move around the map looking for different values
//e.g. to find y coordinate walk up ladder search up, walk down search down etc.
const DWORD dw_Pos = 0x00;//client

//Enemy Vars including the enemy loop
const DWORD EntityPlayer_Base = 0x0;
//How far in memory is each enemy data
const DWORD EntityLoopDistance = 0x04;

//ViewAngles
//We find these by moving our mouse around constantly looking for changed/unchanged value,
//the alternative is to use cl_pdump 1 and search for the value assigned to m_angRotation vector
const DWORD dw_m_angRotation = 0x0;



//We will use this struct throughout all other tutorials adding more variables every time
struct MyPlayer_t  
{ 
	DWORD CLocalPlayer;

	DWORD ggGameBase;
	DWORD ggGameBaseB;
	DWORD ggGameBaseC;
	int Team;
	int Health;
	int NP;
	
	float Position[3];

	DWORD TeamPtr;
	DWORD HealthPtr;
	DWORD PositionPtr;
	DWORD PlayersC;
	DWORD SpeedHack;

	DWORD BaseOffsA, BaseOffsB, BaseOffsC, BaseOffsD, BaseOffsE, BaseOffsF, BaseOffsG, BaseOffsH;
	DWORD BaseOffsCounts;
	DWORD BaseOffsAptr, BaseOffsBptr, BaseOffsCptr, BaseOffsDptr, BaseOffsEptr, BaseOffsFptr, BaseOffsGptr, BaseOffsHptr;
	DWORD Counts, PlayerCounts, PlayCounts;
	DWORD TeamGambiarra;

	void ReadInformation() 
	{
		//=====================================Read Offset=================================================

		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(GameBase), &ggGameBase, sizeof(DWORD), 0);

		BaseOffsA = ggGameBase + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsA), &BaseOffsAptr, sizeof(DWORD), 0);

		BaseOffsB = BaseOffsAptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsB), &BaseOffsBptr, sizeof(DWORD), 0);

		BaseOffsC = BaseOffsBptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsC), &BaseOffsCptr, sizeof(DWORD), 0);

		BaseOffsCounts = BaseOffsBptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsCounts), &Counts, sizeof(DWORD), 0);

		//===============================================================================================

		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsCptr + 0x00), &Health, sizeof(int), 0);


		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsCptr + 0x00), &Team, sizeof(int), 0);
		//printf("MyTeam = %d \n", Team);
		Sleep(500);

		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsCptr + 0x00), &Position, sizeof(float[3]), 0);

		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(PlayersC), &NumOfPlayers, sizeof(int), 0); 
		//printf("PlayerCounts = %d \n", NumOfPlayers);

		//===============================================================================================
	}
}MyPlayer;    





struct TargetList_t 
{
	float Distance;
	float AimbotAngle[3];

	TargetList_t()
	{
		//our default constructor :S
	}

	TargetList_t(float aimbotAngle[], float myCoords[], float enemyCoords[])
	{
		//Send our coordinates and the enemy's to find out how close they are to us!
		Distance = Get3dDistance(myCoords[0], myCoords[1], myCoords[2],
								enemyCoords[0], enemyCoords[1], enemyCoords[2] );

		//Define our aimbot angles and set them for later use when shooting
		AimbotAngle[0] = aimbotAngle[0];
		AimbotAngle[1] = aimbotAngle[1];
		AimbotAngle[2] = aimbotAngle[2];
	}

	//Get our 3d Distance between 2 sets of coordinates(ours and enemies) and find out how close an enemy is to us
	//when it comes to shooting we aim at the closest enemy
	//Simple but effective

	//Here we will AVOID vectors for simplicity but feel free to create to use them
	//if you prefer float Get3dDistance(std::vector<float> myCoords, std::vector<float> enemyCoords)
	
	//See how far away our enemy is to us
	float Get3dDistance(float myCoordsX, float myCoordsZ, float myCoordsY, 
						float eNx, float eNz, float eNy)
	{
		//Use the 3d distance formula to get a resulting Floating distance value POW!!
		return sqrt(
			pow(double(eNx - myCoordsX), 2.0) + 
			pow(double(eNy - myCoordsY), 2.0) + 
			pow(double(eNz - myCoordsZ), 2.0));
	}
};



//ENemy struct
struct PlayerList_t 
{
	DWORD gggGameBase;
	DWORD gggGameBaseB;
	DWORD gggGameBaseC;
	DWORD CBaseEntity;
	int Team;
	int Health;
	int Speed;
	int Arrmor = 0;
	float Position[3];
	float AimbotAngle[3];
	char Name[39];

	DWORD Healthptr;
	DWORD Teamptr;
	DWORD Positionptr;
	DWORD Nameptr;
	


	DWORD BaseOffsA, BaseOffsB, BaseOffsC, BaseOffsD, BaseOffsE, BaseOffsF, BaseOffsG, BaseOffsH;
	DWORD BaseOffsAptr, BaseOffsBptr, BaseOffsCptr, BaseOffsDptr, BaseOffsEptr, BaseOffsFptr, BaseOffsGptr, BaseOffsHptr;
	void ReadInformation(int Player)
	{
		//======================================ReadOffset===============================================
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(GameBase), &gggGameBase, sizeof(DWORD), 0);
		BaseOffsA = gggGameBase + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsA), &BaseOffsAptr, sizeof(DWORD), 0);
		BaseOffsB = BaseOffsAptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsB), &BaseOffsBptr, sizeof(DWORD), 0);
		BaseOffsC = BaseOffsBptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsC), &BaseOffsCptr, sizeof(DWORD), 0);
		BaseOffsD = BaseOffsCptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsD), &BaseOffsDptr, sizeof(DWORD), 0);
		BaseOffsF = BaseOffsDptr + 0x00;
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsF), &BaseOffsFptr, sizeof(DWORD), 0);

		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(BaseOffsDptr + (Player * EntityLoopDistance)), &CBaseEntity, sizeof(DWORD), 0);

		Teamptr = CBaseEntity + dw_mTeamOffset;
		Healthptr = CBaseEntity + dw_Health;
		Positionptr = CBaseEntity + dw_Pos;
		

		//===============================================================================================
		
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + 0x00), &Team, sizeof(int), 0); //Tirar
		//printf("CBaseEntityTeam = %d \n", Team);
		//Sleep(500);
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + 0x00), &Health, sizeof(int), 0);
		
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + 0x00), &Position, sizeof(float[3]), 0);

		


	}
}PlayerList[32];  



//Used to compare the distance when sorting the array of Target Enemies
//JUST think of this as an assist for a sorting algorithm
//and this isn't necessarily related to hacking but it helps us out
struct CompareTargetEnArray
{
	//USE A COMPARATOR TO SORT OUR ARRAY nicely
	bool operator() (TargetList_t & lhs, TargetList_t & rhs) 
	{
		return lhs.Distance < rhs.Distance; 
	}
};


//Props to Nubtik and a couple of other places on the interwebs for this function
void CalcAngle( float *src, float *dst, float *angles )
{
	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; 
	}
}






void Aimbot()
{
	//Declare our target list to define our victims through a dynamic array
	TargetList_t* TargetList = new TargetList_t[NumOfPlayers];
	//Loop through all our players and retrieve their information
	//we use this mainly here to find out what players are our enemies and what players are on our team
	//loops through players to set the target enemies
	int targetLoop = 0;

	//====================================ReadOffset================================================
	DWORD MouseBase, MouseX;
	DWORD mPtrA, mPtrB, mPtrC;
	DWORD mOffsetA, mOffsetB, mOffsetC;
	ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(GameBase), &MouseBase, sizeof(DWORD), 0);
	mOffsetA = MouseBase + 0x00;
	ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(mOffsetA), &mPtrA, sizeof(DWORD), 0);
	mOffsetB = mPtrA + 0x00;
	ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(mOffsetB), &mPtrB, sizeof(DWORD), 0);
	

	//===============================================================================================

	for(int i = 0; i < NumOfPlayers; i ++)
	{
		PlayerList[i].ReadInformation(i);

		// Skip if they're my teammates. 
		if (PlayerList[i].Team == MyPlayer.Team) 
			continue; 

		//Make sure our targets have at keast 2 health
		if (PlayerList[i].Health < 2) 
			continue; //break to next iteration

		//PlayerList[i].Position[2] -= 10;
		CalcAngle (MyPlayer.Position, PlayerList[i].Position, PlayerList[i].AimbotAngle);  

		//ONCE WE GET HERE we have already read all the information we want, all enemies have been checked for valid data
		//Therefore players on our team a dont get selected and only enemies with over 1 health are allowed

		//WE NOW DEFINE A LIST OF ENEMIES TO SHOOT AT, from here we will scan that array and choose to aim at the closest one
		//Create our target loop player and store the most important information
		TargetList[targetLoop] = TargetList_t(PlayerList[i].AimbotAngle, MyPlayer.Position, PlayerList[i].Position);

		//Increment so we can add more players onto the array
		targetLoop++;
	}


	



	//ONLY AIM if we have any enemies 
	if(targetLoop > 0)
	{
		//SORT ENEMIES ARRAY BY DISTANCE before AIMING AT THEM
		//JUST NORMAL std::sort function with our custom comparator, not much to it
		//target loop -1 because it will always go 1 above the count
		std::sort(TargetList, TargetList+targetLoop, CompareTargetEnArray());

		//AIM at the closest guy we found, 
		//by default aim at ALL times, if you right click hold it switches it off
		//This isn't the best example but change the example to whatevery you like E.g. Left click etc...
		if (!GetAsyncKeyState(0x2)) 
		{

			WriteProcessMemory(fProcess.__HandleProcess,
				(PBYTE*)(mPtrB + 0x00),
				TargetList[0].AimbotAngle, 12, 0);
				
					

			//no recoil above text
		}

	}
	//reset the loop counter
	targetLoop = 0;
	//DELETE OUR ARRAY and clear memory, very important
	delete [] TargetList;
}



int main()
{
	fProcess.RunProcess(); // Waiting for CSS......
	cout << "Game found! Running Aimbot..." << endl; 

	//Exit if the F6 key is pressed
	while (!GetAsyncKeyState(F6_Key)) // or for(;;)
	{
		//Read player information into our struct so we know the player 
		//base and the bunny hop addresses
		MyPlayer.ReadInformation(); 

		//Call our Aimbot
		Aimbot();
	}
}
 
Last edited:

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,118
78,998
2,392
Hey buddy all your addresses are set to 0.
 

Lovelace

Jr.Coder
Full Member
Nobleman
Oct 23, 2015
83
938
5
Are you using the SetCursorPos function or are you writing the crosshair position through in-game memory?

I have the same problem as yours (probably). I'm writing the crosshair position through in-game memory.

example (MicroVolts):



yaw (left max) = 1.25, yaw (right max) = -1.25
pitch (up max) = 1.13, pitch (down max) = -1.48

I have no idea how to calculate this. I'm not assuming that both of us have the same problem. Good luck solving your problem.
 

Tarolion

Newbie
Full Member
Nobleman
Mar 12, 2015
42
258
1
Also, what is this??

C++:
//Props to Nubtik and a couple of other places on the interwebs for this function
void CalcAngle( float *src, float *dst, float *angles )
{
    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;
    }
}
Why not use Vector3's because this is confusing as hell dude.... Or is it just me....

IMO, (just the way I do things) Create an ESP first, then once you have that, use your world to screen function to project enemy positions to your screen.

Then all you need to do is find where they are on your screen, and create a mouse_event to move your mouse over them. Or as suggested earlier use a SetCursorPos, etc.
 

bhupesh

Newbie
Dank Tier Donator
Sep 9, 2012
36
274
0
Wow, I was just reading about this on the c++ book tutorial and like Rake said:
All your addresses are set to 0...
Go get a new source and embed your new aiming offsets lol.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods