LightbulbC++ Basic Radar Hack

Posts 1–15 of 19 · Page 1 of 2
C++ Basic Radar Hack
C++ Basic Radar Hack Function
Recently I have seen a lot of people asking how to create a basic radar hack. Let me know if you have any questions.

Code:
struct Offsets {
    DWORD dwLocalPlayer = 0xCBD6B4;
    DWORD dwEntityList = 0x4CCDBFC;
    DWORD m_iTeamNum = 0xF4;
    DWORD m_bSpotted = 0x93D;
    DWORD m_bDormant = 0xED;
} offsets;

void ToggleRadar() {
		if (Radar) {
			DWORD LocalPlayer = ReadMemory<DWORD>(mod.Client + offsets.dwLocalPlayer);
			int playerTeam = ReadMemory<int>(LocalPlayer + offsets.m_iTeamNum);
			for (int i = 0; i < 32; i++) {
				DWORD Entity = ReadMemory<DWORD>(mod.Client + offsets.dwEntityList + (i * 0x10));
				int entityTeam = ReadMemory<int>(Entity + offsets.m_iTeamNum);
				bool isEntityDormant = ReadMemory<bool>(Entity + offsets.m_bDormant);
				bool isEntitySpotted = ReadMemory<bool>(Entity + offsets.m_bSpotted);
				if (!isEntityDormant && entityTeam != playerTeam) {
					if (!isEntitySpotted) 
						WriteMemory<int>(Entity + offsets.m_bSpotted, 1);
				}
				else { continue; }
			}
                        Sleep(1);
		}
	}
A bit improved:

Code:
struct Offsets
{
    DWORD dwLocalPlayer = 0xCBD6B4;
    DWORD dwEntityList = 0x4CCDBFC;
    DWORD m_iTeamNum = 0xF4;
    DWORD m_bSpotted = 0x93D;
    DWORD m_bDormant = 0xED;
    DWORD m_iHealth = 0x100;
} offsets;

void Radar()
{
    for (;;)
    {
        DWORD localPlayer = ReadMemory<DWORD>(mod.Client + offsets.dwLocalPlayer);    
        int localPlayerTeam = ReadMemory<int>(localPlayer + offsets.m_iTeamNum);

        for (int i = 1; i <= 32; i++)
        {
            DWORD player = ReadMemory<DWORD>(mod.Client + offsets.dwEntityList + (i - 1) * 0x10);
            int playerTeam = ReadMemory<int>(player + offsets.m_iTeamNum);

            if (playerTeam == localPlayerTeam || playerTeam == 1)
                continue;

            bool isPlayerDormant = ReadMemory<bool>(player + offsets.m_bDormant);

            if (isPlayerDormant)
                continue;

            int playerHealth = ReadMemory<int>(player + offsets.m_iHealth);

            if (playerHealth <= 0)
                continue;

            bool isPlayerSpotted = ReadMemory<bool>(player + offsets.m_bSpotted);

            if (isPlayerSpotted)
                continue;

            WriteMemory<bool>(player + offsets.m_bSpotted, 1);
        }
        
        Sleep(200);
    }
}
Quote Originally Posted by Not Officer View Post
A bit improved:
Both will work perfect I just wanted to provide a basic function for anyone to use and improve upon.
Quote Originally Posted by Sandwich View Post
Both will work perfect I just wanted to provide a basic function for anyone to use and improve upon.
Well, you should check for health or lifestate too and dont write as integer to bspotted.
Quote Originally Posted by Not Officer View Post


Well, you should check for health or lifestate too.
Yeah, that would be a good idea to avoid any unnecessary exceptions.
help!! <3
how do i fix the errors get like 30 in vs 2017
Quote Originally Posted by iBloods View Post
how do i fix the errors get like 30 in vs 2017
The function is only meant to be used as a reference. You still need an external project and a function to read and write memory.
Actually, i've got a question about
Code:
DWORD LocalPlayer = ReadMemory<DWORD>(mod.Client + offsets.dwLocalPlayer);
int playerTeam = ReadMemory<int>(LocalPlayer + offsets.m_iTeamNum);
What's the point of using a DWORD for LocalPlayer but then using an integer for playerTeam, which uses LocalPlayer as input?
Why not using one or the other for both variables?


2nd question is about
Code:
DWORD Entity = ReadMemory<DWORD>(mod.Client + offsets.dwEntityList + (i * 0x10));
Like seriously, how can someone know that you have to use (i * 0x10)? Where does the 0x10 come from?

This might seem like "explain the whole code to me", but it's not LOL
I get the point of the generic function, it's just this practical stuff that gets me stopped sometimes.
Quote Originally Posted by KF1337 View Post
Actually, i've got a question about
Code:
DWORD LocalPlayer = ReadMemory<DWORD>(mod.Client + offsets.dwLocalPlayer);
int playerTeam = ReadMemory<int>(LocalPlayer + offsets.m_iTeamNum);
What's the point of using a DWORD for LocalPlayer but then using an integer for playerTeam, which uses LocalPlayer as input?
Why not using one or the other for both variables?


2nd question is about
Code:
DWORD Entity = ReadMemory<DWORD>(mod.Client + offsets.dwEntityList + (i * 0x10));
Like seriously, how can someone know that you have to use (i * 0x10)? Where does the 0x10 come from?

This might seem like "explain the whole code to me", but it's not LOL
I get the point of the generic function, it's just this practical stuff that gets me stopped sometimes.
Local Player is a DWORD / uintptr_t.
iTeam is an integer.
0x10 is the distance between entities.
Quote Originally Posted by Sandwich View Post


Local Player is a DWORD / uintptr_t.
iTeam is an integer.
Did some research. It turned out that I missed that it is also a uintptr_t, therefore good for using as a parameter of an int (if I am not mistaken here)

Quote Originally Posted by Sandwich View Post

0x10 is the distance between entities.
I was wondering how do we know this? And is 0x10 still considered an offset?
Quote Originally Posted by KF1337 View Post
I was wondering how do we know this?
Look for "source-sdk-2013" on Git***, your brain will explode.
Quote Originally Posted by Sandwich View Post

Look for "source-sdk-2013" on Git***, your brain will explode.
ERROR. Buffer Overflow. Exit...

No seriously, I found some of the stuff in the Source SDK, but not EntityList for example. Not sure waht to search for at this point.

But still i like that you are posting easy examples.
Quote Originally Posted by KF1337 View Post
I was wondering how do we know this? And is 0x10 still considered an offset?
If you lookup the data/structures in Cheat Engine you also can see that there is always a gap between players which is 10. You also should find more informations around that.

To reproduce this just search for your health. Decrease it. Search again for that value. Till you get a few less results. Then you need some knowledge how this tables are structured like. Memory View > Dissect Data/Structures > Follow the steps there.
pls i need some video tutorial how to make csgo cheats im new
Posts 1–15 of 19 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

Talk with us