Solved MaxPlayers value is way higher than it should be(cpp)

  • 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

suicidalemo666

Newbie
Silenced
Mar 12, 2017
5
11
0
I'm using code based of this, https://www.youtube.com/watch?v=yJX8i7qXf0s video,
C++:
// csgohacks.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "hackprocess.h"
#include <Windows.h>
#include <iostream>
#include <stdio.h>
#define INS_KEY 0x75
CHackProcess fProcess;

const DWORD m_dwLocalplayer = 0xAA66D4;
const DWORD m_dwAttack = 0x2F0917;
const DWORD m_dwTeamoffset = 0x000000F0;
const DWORD m_dwPlayers = 0x178;
const DWORD m_dwCrosshairOffset = 0xAA70;
const DWORD m_dwEntityList = 0x4AC91B4;
const DWORD m_dwEntityLoopDist = 0x10;

bool justShot = false;

int i_shoot = 5;
int i_dontshoot = 4;
int i_playersnum = 32;

struct LocalPlayer {
	DWORD CLocalPlayer;
	int Team;
	int CrosshairEntityId;
	void Read() {
		//me                         parse as byte                     
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + m_dwLocalplayer), &CLocalPlayer, sizeof(DWORD), 0);
		//team
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + m_dwTeamoffset), &CLocalPlayer, sizeof(int), 0);
		//who im aiming at
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + m_dwCrosshairOffset), &CLocalPlayer, sizeof(int), 0);
		//player num
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + m_dwPlayers), &i_playersnum, sizeof(DWORD), 0);
	}
}LocalPlayer;


struct PlayerList {
	DWORD CBaseEntity;
	int Team;

	void Read(int Player) {
		//where they are                                                                         times by loop dist each player has 0x10 sections of mem & store details
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + m_dwEntityList + (Player*m_dwEntityLoopDist)), &CBaseEntity, sizeof(DWORD), 0);
		//what team are they
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + m_dwTeamoffset), &Team, sizeof(int), 0);

	}
}PlayerList[32];

void Trigger() {
	//dont shoot conditions                                                                                             
	// if aiming at nothing(wall.. etc) go back                                                
	if (LocalPlayer.CrosshairEntityId == 0) {
		return;
	}
	// its a friendly go back
	if (PlayerList[LocalPlayer.CrosshairEntityId - 1].Team == LocalPlayer.Team) {
		std::cout << "Friendly!" << std::endl;
		return;
	}
	// if you're looking at an entity e.g gun on floor, barrel dont shoot. dont check above number of players exist
	if (LocalPlayer.CrosshairEntityId > i_playersnum) {
		return;
	}
	if (!justShot)
	{ //if just shot, call -attack so it shoots again
		WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + m_dwAttack), &i_dontshoot, sizeof(int), NULL);
		justShot = !justShot;
	}

	if (justShot) {
		WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + m_dwAttack), &i_shoot, sizeof(int), NULL);
		justShot = !justShot;
	}

}

int main() {
	std::cout << "Check 1" << std::endl;

	fProcess.RunProcess(); // make sure cs is running
	std::cout << "Running" << std::endl;

	while (!GetAsyncKeyState(INS_KEY))
	{
		LocalPlayer.Read();
		for (int i = 0; i < i_playersnum; i++)
		{
			PlayerList[i].Read(i);
			std::cout << "Check 1.1" << std::endl;
		}
	}
	std::cout << "Check 2" << std::endl;
	Trigger();
	return 0;
}
When it loops around Read() in Player List it shows i_playersnum as being 9383936 https://puu.sh/uFEHZ/245bcfafa1.png Is this an issue with the offset or have I done something wrong?
 
Last edited by a moderator:

Oneshot

Meme Tier VIP
Apr 4, 2015
232
190
13
okey you are lucky i saw this :) you need to do

DWORD m_dwClientState = 0x005CB524;
DWORD dwClientState;
const DWORD m_dwPlayers = 0x308;

ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + m_dwClientState), &dwClientState, sizeof(DWORD),
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(dwClientState + m_dwPlayers ), &i_playersnum, sizeof(int),
 
Last edited:

suicidalemo666

Newbie
Silenced
Mar 12, 2017
5
11
0
Вroihon;48145 said:
Sounds like a wrong offset to me.
Is it working for you? I'm using zed's offset

edit: downloaded yetis one which said it is 0x308, which now gives the number -858993460
 
Last edited:

suicidalemo666

Newbie
Silenced
Mar 12, 2017
5
11
0
okey you are lucky i saw this :) you need to do

DWORD m_dwClientState = 0x005CB524;
DWORD dwClientState;
const DWORD m_dwPlayers = 0x308;

ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + m_dwClientState), &dwClientState, sizeof(DWORD),
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(dwClientState + m_dwPlayers ), &i_playersnum, sizeof(int),
Thanks, that fixed the crazy number and it's now 64 which I guess is right, however, it still does nothing. My guess is its something to do with Trigger() at the end, since it never breaks out the while loop, trigger never gets ran. I put
std::cout << PlayerList.Team << std::endl;
in the loop to see what it came up with and it shows https://puu.sh/uQ10A/cc1c353d87.png I'm guessing theres something wrong there




edit: I changed
ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CLocalPlayer, sizeof(int), 0);
to
ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + m_dwCrosshairOffset), &CrosshairEntityId, sizeof(int), 0);
which I'm guessing was the right move, but everything in CrosshairEntityId is 0. Also updated my offsets
new code: http://pastebin.com/e9iUfyvH
 
Last edited:

Oneshot

Meme Tier VIP
Apr 4, 2015
232
190
13
hmm i would advice you to write your own trigger. this code is bad and over complicated.

here look how i code an simple trigger. you can just add a team check by using the id and then read( id * entityoffset) and then read the entity team.
then compare that to your team and if its same don't shot.

https://www.youtube.com/watch?v=8evwy1tiVtE&t=10s
 

Oneshot

Meme Tier VIP
Apr 4, 2015
232
190
13
here you have the modified version that checks team. :spoon:

just change addresses to css and it will work. you might wanna use send input or you can add m_dwAttack
that i hope you know how to do.
C++:
//-----------------------------------------------------------------------------------------------------------------------
//                                                        Made By OneShot.
//-----------------------------------------------------------------------------------------------------------------------

#include "Hprocess.h"
#include <Windows.h>

using namespace std;

CHackProcess fProcess;

DWORD LocalPlayerBase = 0xAAD704;
DWORD PlayerBase;
DWORD EntityBase = 0x4AD0884;
DWORD entity;
DWORD CrosshairId = 0xAA70;
DWORD m_iTeamNum = 0xf0;
int team;
int myteam;

int id;


void sendkeypress()
{

	//Structure for the keyboard event
	INPUT ip;
	//Set up the INPUT structure
	ip.type = INPUT_KEYBOARD;
	ip.ki.time = 0;
	ip.ki.wVk = 0; //We're doing scan codes instead
	ip.ki.dwExtraInfo = 0;
	//This let's you do a hardware scan instead of a virtual keypress
	ip.ki.dwFlags = KEYEVENTF_SCANCODE;
	ip.ki.wScan = 0x19; //code character to use(p)
	SendInput(1, &ip, sizeof(INPUT)); // sending the keypress
	Sleep(25);
	ip.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
	SendInput(1, &ip, sizeof(INPUT)); // sending the upkeypress

}

int main()
{
	fProcess.RunProcess();
	while (true)
	{
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + LocalPlayerBase), &PlayerBase, sizeof(DWORD), 0);
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(PlayerBase + CrosshairId), &id, sizeof(int), 0);
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(PlayerBase + m_iTeamNum), &myteam, sizeof(int), 0);
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + EntityBase + ((id - 1) * 0x10)), &entity, sizeof(DWORD), 0);
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(entity + m_iTeamNum), &team, sizeof(int), 0);
		
		if (GetAsyncKeyState(VK_MBUTTON) && id > 0 && myteam != team && team <= 3) 
		{
			sendkeypress();
		}

		Sleep(1);
	}
	
}
 

bimmerlegend

Newbie
Full Member
Mar 22, 2017
14
68
0
One thing is forgetting getting the pointer but why do you want MaxPlayers again? Unless you're on some corny shit you can just reference everything to a constant int equal to 64.
 
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