Aimbot C++ [credit to eVobyte]

07/23/2011 22:10 0NEUP#1
Hello guys,

I recently started learning RE and other stuff.
I use Tsearch MHS ArtMoney CheatEngine to look up addresses and offsets (base address for example).

I am now quite good in C++ but still, I need to learn a lot(ex polymorphism,vectors,and other crazy stuff)

There some aimbot source on several sites, they all refer to one source:

[Only registered and activated users can see links. Click Here To Register...]

LINK: ****[dot]net/forum/31-c-c-programming/82510-aimbot-tut.html

there even more sites with this example source code.

Here some pastebin of it:
[Only registered and activated users can see links. Click Here To Register...]

I know its outdated, PEEK and POKE can be done now by ReadProcessMemory and WriteProcessMemory.

But now the question:
How do I know what is the Base address of the "Host" ( how to look for it?) and how to look for (offset) "the gap between players" ?

Also I dont understand the parameter PLAYER_DATA GetPlayerData(BYTE PlayerNum), how does the program know what is the PlayerNum?

As I said it is outdated but I want to understand at least these thing I stated.

I know that today's aimbots use WorldToScreen functions to convert 3D to 2D,and work with entities or textures.

Thanks anyways
07/24/2011 10:48 buFFy!#2
very unclean code. you should get a pointer to the playerstruct instead of doing all this +0xxx shit. like

Code:
PLAYER_DATA* Player = 0xABC123;
Player->CoordX = NewCoord;
struct can look like
Code:
struct PLAYER_DATA {
	float CoordX;
	float CoordY;
	float CoordZ;
};
07/24/2011 11:26 0NEUP#3
Thanks for the post! I will look through it.
07/24/2011 11:56 buFFy!#4
Actually, i didn't read the question at all. I guess PlayerNum is the index of the entity in the entitylist.

It's very gamespecific, but however. Usually theres something like an entityarray. for example, if one entity has 75 bytes reserved, entity #34 would be at address+75*34.

You definitly have to reverse the entitylist to properly use it.

The host is usually found (easiest, global way) by stepping trough the entitylist.
Maybe theres something like a IsHost boolean. You have to figure this out.

Code:
BYTE cPlayer::GetHost()
{
	for(int i=0; i<(this->GetLastEntityIndex()); i++)
	{
		if( (this->GetEntity(i) != NULL && (this->EntityIsHost(i)) == 1 )
			return (BYTE)i;
	}
	return 0;
}
07/24/2011 12:24 0NEUP#5
Thanks again, helps me a lot to understand these things.