Outdated C++ - Counter Strike - How to Hack any Game Aimbot Tutorial

  • WARNING: You are viewing the Legacy Fleep section which contains old and badly explained tutorials. You should not use these old tutorials. Our best, new tutorials are posted here and here.
Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Hey Guys here we have the AIMBOT tutorial which will take you through all the steps to create your own aimbot for CSS. There will be a couple of updates for this code so make sure to follow the tutorial so that you can improve it later on.


Updated for 2018
Projects re-created & tested working in VS 2017
Tested working on Windows 10
Attachment updated
Code & Project cleaned up - using CodeMaid & SolZipper
Offsets updated - You will need to update the offsets again if the game updates




All Fleep Tutorials require special compiler settings

If you make a new project from scratch, you must set these project properties:

-Switch from Unicode to Multi Byte Character Set
-Set C++ -> All Options -> Permissive Conformance Mode: NO
-Linker -> Manifest File -> Require Administrator
-C++-> Precompiled Header -> Not Using Precompiled Headers
-C++ -> Add Preprocessor directive: _CRT_SECURE_NO_WARNINGS

Alternatively, download the attachment and use the pre-made project.



These tutorials are old, you should do the new ones instead: Guide - START HERE Beginners Guide to Learning Game Hacking



As usual BIG thanks for the support!

Here is the video playlist with all 6 videos:

Triggerbot tutorial here:C++ How to Hack Call of Duty 4 Modern Warfare Cheats AIMBOT TriggerBot TUTORIAL DIFFI - Guided Hacking

If you have completed the tutorial and have problems then I recommend you download the source code and compare to your own, if you still cant get it to work then look for any threads or post your own in the Tutorials help section.

Download the full source for everything in the attachments

Here's a snippet of the source code:
C++:
#include <Windows.h>
#include <iostream>
#include "HackProcess.h"
#include <vector>
#include <algorithm>
//https://guidedhacking.com/threads/c-how-to-hack-any-game-counter-strike-aimbot-tutorial-difficulty-5-10.3600/
//https://guidedhacking.com/threads/counter-strike-source-offsets-updated-2018.11314/

CHackProcess fProcess;
using namespace std;

#define F6_Key 0x75
#define RIGHT_MOUSE 0x02

int NumOfPlayers = 32;

//Relative offsets:
const DWORD dw_PlayerCountOffs = 0x5EF6BC;//Engine.dll
const DWORD Player_Base = 0x4C6708;
const DWORD dw_m_angRotation = 0x47F1B4; //ViewAngles - find by moving our mouse around, look for changed/unchanged value, or use cl_pdump 1

//entity offsets
const DWORD dw_mTeamOffset = 0x9C;
const DWORD dw_Health = 0x94;
const DWORD dw_Pos = 0x260;

const DWORD EntityPlayer_Base = 0x4D3904;//entitylist relative offset
const DWORD EntityLoopDistance = 0x10; //distance in bytes between each ent

struct MyPlayer_t
{
    DWORD CLocalPlayer; //address of our ent
    int Team;
    int Health;
    float Position[3];
    void ReadInformation()
    {
        //Get address of entity
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(CLocalPlayer), 0);
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(CLocalPlayer + dw_mTeamOffset), &Team, sizeof(Team), 0);
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(CLocalPlayer + dw_Health), &Health, sizeof(Health), 0);
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(CLocalPlayer + dw_Pos), &Position, sizeof(float[3]), 0);
        //Get Number of players
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(fProcess.__dwordEngine + dw_PlayerCountOffs), &NumOfPlayers, sizeof(int), 0);
    }
}MyPlayer;

//struct for targets
struct TargetList_t
{
    float Distance;
    float AimbotAngle[3];

    TargetList_t() {} //default contructor

    TargetList_t(float aimbotAngle[], float myCoords[], float enemyCoords[])
    {
        Distance = Get3dDistance(myCoords[0], myCoords[1], myCoords[2],
            enemyCoords[0], enemyCoords[1], enemyCoords[2]);

        //set aimbot angles for the ent
        AimbotAngle[0] = aimbotAngle[0];
        AimbotAngle[1] = aimbotAngle[1];
        AimbotAngle[2] = aimbotAngle[2];
    }

    float Get3dDistance(float myCoordsX, float myCoordsZ, float myCoordsY,
        float eNx, float eNz, float eNy)
    {
        return (float)sqrt(
            pow(double(eNx - myCoordsX), 2.0) +
            pow(double(eNy - myCoordsY), 2.0) +
            pow(double(eNz - myCoordsZ), 2.0));
    }
};

//Struct for other players
struct PlayerList_t
{
    DWORD CBaseEntity;
    int Team;
    int Health;
    float Position[3];
    float AimbotAngle[3];
    char Name[39];

    void ReadInformation(int Player)
    {
        //Get Addres of Entity
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(fProcess.__dwordClient + EntityPlayer_Base + (Player * EntityLoopDistance)), &CBaseEntity, sizeof(DWORD), 0);
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(CBaseEntity + dw_mTeamOffset), &Team, sizeof(int), 0);
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(CBaseEntity + dw_Health), &Health, sizeof(int), 0);
        ReadProcessMemory(fProcess.__HandleProcess, (BYTE*)(CBaseEntity + dw_Pos), &Position, sizeof(float[3]), 0);
    }
}PlayerList[32];

//Compare the distance when sorting the array of Target Enemies, it's called a "sort predicate"
struct CompareTargetEnArray
{
    bool operator() (TargetList_t & lhs, TargetList_t & rhs)
    {
        return lhs.Distance < rhs.Distance;
    }
};

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;

    //normalize angle
    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
    int targetLoop = 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;

        //Skip players without health such as bad ents
        if (PlayerList[i].Health < 2) continue;

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

        //Populate array of targets with only good targets
        TargetList[targetLoop] = TargetList_t(PlayerList[i].AimbotAngle, MyPlayer.Position, PlayerList[i].Position);

        //Increment to advance the array for the next iteration
        targetLoop++;
    }

    //ONLY AIM if we have any enemies
    if (targetLoop > 0)
    {
        //SORT ENEMIES ARRAY BY DISTANCE by using our sort predicate
        std::sort(TargetList, TargetList + targetLoop, CompareTargetEnArray());

        //AIM at the closest ent, by default aim at ALL times, if you right click hold it switches it off
        if (!GetAsyncKeyState(0x2))
        {
            WriteProcessMemory(fProcess.__HandleProcess, (BYTE*)(fProcess.__dwordEngine + dw_m_angRotation), TargetList[0].AimbotAngle, 12, 0);
        }

    }
    //reset the loop counter
    targetLoop = 0;

    delete[] TargetList; //DELETE OUR ARRAY and clear memory
}

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

    //Exit if the F6 key is pressed
    while (!GetAsyncKeyState(F6_Key))
    {
        MyPlayer.ReadInformation();
        Aimbot();
    }
}
 

Attachments

Last edited:
Jul 19, 2013
1
1,908
0
Great tutorial! Very interesting stuff.

To clarify the angle computation portion, delta[0] and delta[1] correspond to distances with respect to the plane surface (i.e., the ground), while delta[2] corresponds to the difference in heights with respect to some "ground level." The angle between your position with respect to ground level and the enemy's position with respect to ground level is given by angles[0]. The quantity labeled "hyp" is the distance between you and the enemy on the plane surface. Thus, sin(angles[0]) = delta[2]/hyp, and angles[0] = asin(delta[2]/hyp). The quantity "angles[1]" is the angle you must rotate on the plane surface to point at the player. So clearly, delta[1]/delta[0] = tan(angle[1]), and angle[1] = atan(delta[1]/delta[0]). Of course, angles[2] will always be zero, as a change in this angle would correspond to spinning your player about his bellybutton (while upright, no less!).

The 57.295779513082 constant is a conversion from units of radians to degrees. Since 180 degrees = PI * C, C = 180 degrees / PI, the constant in question.

The final if statement, which checks angle[1] for correctness, is caused by the ever-present ambiguity when computing the arctangent of a quantity; it is checking to see if the computed angle has landed in the correct quadrant. Numerically, this "if" statement could be avoided using the "atan2" function in the computation of angles[1] instead of the simple "atan" (i.e., "atan2" automatically computes the angle in the proper quadrant).
 
Last edited:

till0sch

Respected Hacker
Dank Tier VIP
Dank Tier Donator
Oct 14, 2012
1,104
12,593
51
Thanks for the tutorial, just downloaded the source to take a look. Compiled it and it said that something with the allocate size was wrong (std::bad_alloc?!)

Any suggestions?
 

Fleep

Founder
Meme Tier VIP
May 20, 2012
572
11,023
6
Great tutorial! Very interesting stuff.

To clarify the angle computation portion, delta[0] and delta[1] correspond to distances with respect to the plane surface (i.e., the ground), while delta[2] corresponds to the difference in heights with respect to some "ground level." The angle between your position with respect to ground level and the enemy's position with respect to ground level is given by angles[0]. The quantity labeled "hyp" is the distance between you and the enemy on the plane surface. Thus, sin(angles[0]) = delta[2]/hyp, and angles[0] = asin(delta[2]/hyp). The quantity "angles[1]" is the angle you must rotate on the plane surface to point at the player. So clearly, delta[1]/delta[0] = tan(angle[1]), and angle[1] = atan(delta[1]/delta[0]). Of course, angles[2] will always be zero, as a change in this angle would correspond to spinning your player about his bellybutton (while upright, no less!).

The 57.295779513082 constant is a conversion from units of radians to degrees. Since 180 degrees = PI * C, C = 180 degrees / PI, the constant in question.

The final if statement, which checks angle[1] for correctness, is caused by the ever-present ambiguity when computing the arctangent of a quantity; it is checking to see if the computed angle has landed in the correct quadrant. Numerically, this "if" statement could be avoided using the "atan2" function in the computation of angles[1] instead of the simple "atan" (i.e., "atan2" automatically computes the angle in the proper quadrant).

Thanks its always great to get some get good explanations, especially when my maths isn't great.

Fleep
 

fightergf

Newbie
Jul 13, 2013
2
152
0
Trying to determine the values ​​in Warface! find 3 values ​​(2 health - 1 armor) but can not determine the coordinates! a link to the manual with video how to find it in Warface Sorry for my english
 

xCordillia16x

Newbie
Jul 4, 2013
2
152
0
so im watching the video on the C++ aimbot tutorial and not that i cant do the address finding, but someone just posted the pointers and offsets for TF2 (which is the game i would like to make an aimbot for).
-------------------------------------------------------------------------------------------------------------
BaseEntity : client.dll+0xFCC27C
EntityList : client.dll+0xFD9C2C (+0x10 for each iteration)

Offsets for both BaseEntity and EntityList:
Health: 0xA0 (e.g.: (BaseEntity + 0xA0) = Health)
Team: 0xA8
Position: x = 0x35C, z = 0x360, y = 0x364

CrosshairID: BaseEntity + 0x1750
ViewAngles: BaseEntity + 0x2F0
-------------------------------------------------------------------------------------------------------------

i don't know what "client.dll" is, and i'm not really great at this finding addresses and pointers yet so it would be easy if i could just use this information that he got yesterday (just saying that it's up to date info) and make the hack with this.
But, like i said, i don't know what client.dll is so, was wondering if you could help a little
 

squeenie

Hacker
Meme Tier VIP
Dank Tier Donator
Mar 6, 2013
677
5,478
37
so im watching the video on the C++ aimbot tutorial and not that i cant do the address finding, but someone just posted the pointers and offsets for TF2 (which is the game i would like to make an aimbot for).
-------------------------------------------------------------------------------------------------------------
BaseEntity : client.dll+0xFCC27C
EntityList : client.dll+0xFD9C2C (+0x10 for each iteration)

Offsets for both BaseEntity and EntityList:
Health: 0xA0 (e.g.: (BaseEntity + 0xA0) = Health)
Team: 0xA8
Position: x = 0x35C, z = 0x360, y = 0x364

CrosshairID: BaseEntity + 0x1750
ViewAngles: BaseEntity + 0x2F0
-------------------------------------------------------------------------------------------------------------

i don't know what "client.dll" is, and i'm not really great at this finding addresses and pointers yet so it would be easy if i could just use this information that he got yesterday (just saying that it's up to date info) and make the hack with this.
But, like i said, i don't know what client.dll is so, was wondering if you could help a little
You have all the info needed to convert it from css to a tf2 hack. If you can't do that you need to practice a bit more (seeing as you don't even know what client.dll is I'm assuming this is the case).
 

SourceHost

Newbie
Jul 17, 2013
1
152
0
The aimbot only works with bots for me... :( wtf. Good tutorial by the way, thanks Fleep.
The reason the aimbot only works with bots is because CS has blocked WriteProcessMemory instead of just banning people for using it. We all need to find another way of moving our mouse to the coords. Same with the triggerbot, we need to find a way to shoot the mouse when we receive the info that the enemy has crossed our crosshairs instead of using WriteToMemory
 

darklord92

Newbie
Full Member
Mar 5, 2013
6
172
0
Fleep your amazing, I have made it just the way you have :)
I am eager to learn how to fix the aimbots, ehh,, aiming problem i guess,
i would LOVE for you to make a tut on how to make a no recoil/no spread and add it to the aimbot,
because i have researched for nearly 9 hours trying to figure this out lol
thanks fleep :) your amazing
 

Obvi

Newbie
Aug 8, 2013
1
172
0
HI Fleep:) I've been whatching your tutorials for a while now, And it has really inspired me to actually start making some real hacks. Im here to say thank you for those amazing tutorials!:)
 
Status
Not open for further replies.
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