# SolvedCSGO How to loop through entitylist

#### Oneshot

Meme Tier VIP
N/A
How long you been coding/hacking?
N/A
Coding Language
N/A
Hello ive made an Aimbot but i wanna know how to make it loop thru the entity list and make something of the info.
But i want to do the best way possible so i can use that
in all the games that i will hack in the future
I have seen some videos from Fleep and Hazardedit
but i dont think those ways are good. Or am i wrong?

Last edited by a moderator:

#### Rake

This is some old source code but checkout this SortPlayerVector function

I have a function that does ReadProcessMemory on all the players in the array, puts all their data into a vector of player objects and then I calculate the angle to aim at them, calculate the distance between my current angle from the angle to enemy, and then I sort the vector using std::sort and a sort predicate that I Defined for the player objects.

You can do this without a vector of redundant player objects but you must have some sort of array of angles and indexes into the player array

#### r4z0r

##### Coder
Meme Tier VIP
How did you manage to code an aimbot and don't know how to loop through the list? Anyway you have to choose how you will find a target 4 the aimbot (closest to the crosshair, visible, nearest...) e.g you choose the nearest and if it is visible: get the nearest (izi peazy) and check if its visible (not izi peazy) then while he's alive you don't change to the next... Basically you need to find a target according to you parameters and not change it until he's dead nor while your parameters are true

#### Oneshot

Meme Tier VIP
i just used the offsets to the one player/bot while coding but i did not think that i would be able to make an aimbot at all. but after learning the ways of calculating angels with trigonometry it went my way and i succeeded but forgot the part where i need to calculate the closest player or in closest fov. i wanna make it so it targets the one thats nearest to my crosshair . do you have some links that could help me out. i have no ide how to compere targets and finding the closest one. ive made a function thats loops thru the entitys and stores the data in one of my structs but how do i the use the data like compering them and geting distance etc.

C++:
``````int memory()
{
memoryloop = 0;
while (memoryloop < 65)
{
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Entity_Base + (EntityLoopD * memoryloop)), &Entitybase, sizeof(DWORD), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + Ihealth), &Player[memoryloop].health, sizeof(int), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + Entityteam), &Player[memoryloop].team, sizeof(int), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + m_lifestate), &Player[memoryloop].m_lifestate, sizeof(int), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + MyPosOS), &Player[memoryloop].posX, sizeof(float), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + MyPosOS + 4), &Player[memoryloop].posY, sizeof(float), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + MyPosOS + 8), &Player[memoryloop].posZ, sizeof(float), NULL);
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(Entitybase + Dormant), &Player[memoryloop].dormantcheck, sizeof(float), NULL);
memoryloop++;
if (memoryloop == 65)
{
memoryloop = 0;

}
Sleep(1);
}
return 0;

}``````
is this wrong way to do this?

#### Oneshot

Meme Tier VIP
Rake;44906 said:
This is some old source code but checkout this SortPlayerVector function

I have a function that does ReadProcessMemory on all the players in the array, puts all their data into a vector of player objects and then I calculate the angle to aim at them, calculate the distance between my current angle from the angle to enemy, and then I sort the vector using std::sort and a sort predicate that I Defined for the player objects.

You can do this without a vector of redundant player objects but you must have some sort of array of angles and indexes into the player array
Thanks i discoverd the sort function in c++ yesterday and i dreamed about it. and it was like you described it here . many thanks for showing me the way

#### Oneshot

Meme Tier VIP
Hello Rake now i have this working but havent used a vector i only have an array but the aimbot is working but how do i do so when the player dies that it switches to the closest one thats alive?
my aimbot function that aims takes one parameter and thats the entity number. so i sorted the angels and compered them with the unsorted angels and got my player index from there. and then i use that info for the aimbot to aim.
but the problem is that it cant se if the entity are dead or not so it wont switch . and if i make it go to next entity in the list it will go to the closest one but if that one is the last one in the entitylist it will stop.

i would paste some code but i dont want my shitty work to go around the internet.

#### Rake

Looks like you have a health and a m_lifestate variable, you can filter out targets that do not meet the health > 0 and m_lifestate = ALIVE criteria or whatever it may be

#### Oneshot

Meme Tier VIP
i got it to work but whats up with the entity list online? some times it works and some times it dosen't. is it like changing adress or something? got rcs as well but sendinput wont play well with another sendinput. coded the rcs in another function with its on sendinput can these coexist without problem? noticed that sendinput kidnaps the mouse and wont let me press left mouse when the aimbot are tracking enemy's. think it does that to the other sendinput so the rcs dosent work..

#### hf.ub3r

##### Newbie
A bit off topic but you should read positions as Vectors in 1 RPM instead of 3 separate floats in 3 RPM's.

Or even read the entire entity as a buffer in 1 RPM then sort through the buffer for the info you want - but that might be a bit much to do before you've even got a working aimbot.

#### Rake

Sounds like you just need to spend a lot of time working on this project until you figure it out, seems like you're off to a great start!

#### Oneshot

Meme Tier VIP
A bit off topic but you should read positions as Vectors in 1 RPM instead of 3 separate floats in 3 RPM's.

Or even read the entire entity as a buffer in 1 RPM then sort through the buffer for the info you want - but that might be a bit much to do before you've even got a working aimbot.
yeah but im pretty noob. im doing this to get my c++ skills up. i did not know any c++ before this but one thing i can tell you that my code is so shit that no one will understand it and the risk of anyone doing same code is minimal ud4ever hahahhahah got the aimbot fully working but without rcs :/

here the work so far.

#### Oneshot

Meme Tier VIP
i wonder how does vac work? does it analyse the running code and tests if it are making changes to the game? i have read some on vac and i think it is shit. games like rust(new) i have never ever bumped in to a hacker. why is it so? why are vac so much worse then lets say EAC? / i know this is off topic but this is a help thread in my aimbot and i might need this information

#### Rake

i wonder how does vac work? does it analyse the running code and tests if it are making changes to the game? i have read some on vac and i think it is shit. games like rust(new) i have never ever bumped in to a hacker. why is it so? why are vac so much worse then lets say EAC? / i know this is off topic but this is a help thread in my aimbot and i might need this information
VAC uses signature based detection. They also detect potential hacking via very basic heuristics and if found, they can upload the DLL to the VAC for manual analysis later on. Here's some stuff:
https://guidedhacking.com/tags.php?tag=vac

EAC used a kernel driver that basically requires you to write your own kernel driver to bypass it, that's why there aren't many hacks for it (mambda dropped the knowledge and I'm passing it on to you )

#### Oneshot

Meme Tier VIP
Rake;45044 said:
VAC uses signature based detection. They also detect potential hacking via very basic heuristics and if found, they can upload the DLL to the VAC for manual analysis later on. Here's some stuff:
Tutorial - How To Bypass VAC Valve Anti Cheat Info
https://guidedhacking.com/tags.php?tag=vac

EAC used a kernel driver that basically requires you to write your own kernel driver to bypass it, that's why there aren't many hacks for it (mambda dropped the knowledge and I'm passing it on to you )
i have no ide how to write anything except scripts and simple functions . should i look in to drivers and learn how to write those or would that take years? i have no one else to ask that know how to program and i hope that im no annoyance that ask so many questions

#### Rake

should i look in to drivers and learn how to write those or would that take years?
Learn to hack normally first

-1

#### Ayyyther

##### Newbie
Dank Tier Donator
yeah but im pretty noob. im doing this to get my c++ skills up. i did not know any c++ before this but one thing i can tell you that my code is so shit that no one will understand it and the risk of anyone doing same code is minimal ud4ever hahahhahah got the aimbot fully working but without rcs :/

here the work so far.

"UD forever" until you get detected.

Attention! Before you post:

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