Solved Aimbot not working

  • CSGO recently moved logic from 'client_panorama.dll' to 'client.dll', you must update all code that uses 'client_panorama.dll' and replace it with 'client.dll' or the code will not work.
Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

F4DE

Newbie
Full Member
Mar 28, 2016
17
98
0
First post:DatSheffy:

Hai,
So I am trying to create an aimbot for my hack, and I can't seem to get it to work.
Right now, when I press middle mouse button(the button to activate aimbot) it just crashes my cheat.
I have no clue what I do wrong, so could someone help me out?
Source:
C++:
DWORD  ViewMatrix = 0x04A91464; // ViewMatrix offset
DWORD  iHealth = 0xFC; //Always: 0xFC
DWORD  iTeamNum = 0xF0; //Always: 0xF0
DWORD  ArmorValue = 0xA9E8;
DWORD  IsDormant = 0xE9; //Always: 0xE9
DWORD  vecOrigin = 0x134;//Always: 0x134
DWORD ViewAngle = 0x00004D0C;

struct EnemyPlayer_t
{
	uintptr_t CEntityList;
	int Health;
	int TeamNum;
	int Dormant;
	int ArmorValue;
	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];

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;
}

DWORD Engine;
float dwAngPtr;

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

			dwAngPtr = Mem.Read<float>(Engine + Client);
			int LocalPlayerIndex = Mem.Read<int>(dwAngPtr + 0x178) - 1; // Get the index of your LocalPlayer here.
			dwAngPtr = Mem.Read<DWORD>(Engine + 0x610334); //0x610334 is Engine pointer
			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]);
		}
	}
}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
you have to trace backwards. ReadInfo() is called in 3 places, which one leads to crash

Put a breakpoint on this line:
C++:
CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
Then evaluate "Client + EntityList + (_pInfo * 0x10)" in the watch window like I show you in the video. Compare to what you see in cheat engine.


Like I explain in the video: "you actually have to debug every single line of code, when you get to the end, your hack will work perfectly"
 
Last edited:

Amonomen

Resident A$$hole
Dank Tier Donator
May 1, 2016
22
373
1
It's difficult to just look at some source code and try to determine the problem.

Have you tried debugging it?

Here's how to debug your hacks:

Debugging should shed some light on the problem.
 
Last edited by a moderator:

F4DE

Newbie
Full Member
Mar 28, 2016
17
98
0
Rake;42913 said:
F4DE



you sonuva bitch
Ahaha sorry bro couldn't resist not doing it ;3

Well, I've tried to debug the code and the error seems to point at this code:
C++:
		CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
(uintptr_t = uintptr_t CEntityList;)


Addictional information translation: Try to read or edit protected memory. This means most of the time that other memory is damaged.

Still no idea what is wrong with it
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
C++:
CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10));
Still no idea what is wrong with it
I see all DWORDs and then your program breaks on the only line that uses a uintptr_t, if changing that to DWORD doesn't fix it then the alternatives are:
1)You need to only read data for valid entities in the EntityList by limiting your for loop with "i < numOfPlayers"
2)Your offsets / addresses are wrong

If you 100% debug this the way I show you in the video, you will find the answer
 

F4DE

Newbie
Full Member
Mar 28, 2016
17
98
0
Rake;42916 said:
I see all DWORDs and then your program breaks on the only line that uses a uintptr_t, if changing that to DWORD doesn't fix it then the alternatives are:
1)You need to only read data for valid entities in the EntityList by limiting your for loop with "i < numOfPlayers"
2)Your offsets / addresses are wrong

If you 100% debug this the way I show you in the video, you will find the answer
For some reason, every time I try to step out with the debugger it just totally exits the hack / terminates the debugger.
So, I can't get past the line from CEntityList, because all of the debug options let to the hack being closed
 
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