Solved What is it that I'm doing wrong?

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

xheva

Newbie
Mar 2, 2013
1
152
0
C++:
#include <Windows.h>
#include <iostream>
#include "HackProcess.h"


CHackProcess fProcess;
using namespace std;



const DWORD Player_Base = 0x53BFC8;
const DWORD dw_jump = 0x569664;
const DWORD dw_JumpOffSet = 0x34C;
const DWORD dw_Attack = 0x569670;
const DWORD dw_mTeamOffset = 0x558;
const DWORD dw_PlayerCountOffs = 0x5C817C;
const DWORD dw_crosshairOffs = 0x14D1;
const DWORD EntityPlayer_Base = 0x5495B4;;
const DWORD EntityLoopDistance = 0x10;

// Her fortæller vi, hvad de forskellige tings værdi er.
#define FL_ONGRUND 257
#define SPACE_BAR 0x20
#define F6 = 0x75


/////////BunnyHop////////////////////////
bool b_true = true; // 5 - Hop		   //
bool b_false = false; // 4 - Ikke hop  //
bool BunnyHopStatus = false;           //
/////////////////////////////////////////

////////Triggerbot///////
bool b_ShotNow = false;//
int i_Shoot = 5;       // // Skyd
int i_DontShoot = 4;   // // Skyd ikke
int NumOfPlayers = 32; //
////////////////////////


// Her bygger vi vores struct MyPlayer_t
struct MyPlayer_t
{
	DWORD CLocalPlayer;
	int m_fFlags;
	int Team;
	int CrosshairEntityID;

	void ReadInformation()
	{
	ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient+ Player_Base), &CLocalPlayer, sizeof(DWORD), 0); // Bunnyhop
	ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer+ dw_JumpOffSet), &m_fFlags, sizeof(int), 0); // Bunnyhop
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0); // Tigger
	ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_mTeamOffset), &Team, sizeof(int), 0); // Trigger
	ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0); // Trigger
	ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + dw_PlayerCountOffs), &NumOfPlayers, sizeof(int), 0); // Trigger
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	}

}MyPlayer;

// Enemy
struct PlayerList_t 
{
	DWORD CBaseEntity; 
	int Team; 

	void ReadInformation(int Player) 
	{
		
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + EntityPlayer_Base  + (Player * EntityLoopDistance)),
			&CBaseEntity, sizeof(DWORD), 0);
		 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_mTeamOffset), &Team, sizeof(int), 0);
 	}
}PlayerList[32];  


// Og her lavet vi det der sker når vi trykker på spacebar.
void BunnyHop()
{
	if(GetAsyncKeyState(SPACE_BAR))
	{
		BunnyHopStatus = !BunnyHopStatus; // Hvis statussen er true, så laver den det om til false, og omvendt.
		Sleep(250);
	}

	if(!BunnyHopStatus)
		return;

	if(MyPlayer.m_fFlags == FL_ONGRUND) // Her siger vi, at hvis vi er på jorden så skal vi hoppe.
	{
		WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_true, sizeof(bool), NULL);
	}
	else if(MyPlayer.m_fFlags != FL_ONGRUND) // Og hvis vi ikke er på jorden, så skal vi selvfølgelig ikke hoppe.
	{
		WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_jump), &b_false, sizeof(bool), NULL);
	}
}

void TriggerBot()
{
	
	if(!b_ShotNow)
	{
		
		WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_Attack), &i_DontShoot, sizeof(int), NULL);
		b_ShotNow = !b_ShotNow;
	}

	
	if(MyPlayer.CrosshairEntityID == 0)
		return;
	
	
	if (PlayerList[MyPlayer.CrosshairEntityID-0].Team == MyPlayer.Team) 
		return;

	
	if(MyPlayer.CrosshairEntityID > NumOfPlayers)
		return;


	
	if(b_ShotNow)
	{
		//Skyd
		WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_Attack), &i_Shoot, sizeof(int), NULL);
		b_ShotNow = !b_ShotNow;
	}
}




// Start programmet, og hvis knapper F6 ikke er trykket, så kører vi MyPlayer.ReadInformation(); og BunnyHop();
int main() 
{   
	fProcess.RunProcess();
	cout << "Spil fundet! Loader snyd..." << endl; 

	
	while (!GetAsyncKeyState(0x75)) 
	{
		
		MyPlayer.ReadInformation(); 

		
		for(int i = 0; i < NumOfPlayers; i ++)
		{
			PlayerList[i].ReadInformation(i);

			//std::cout << PlayerList[i].Team << std::endl;

		}

		//Perform our Triggerbot
		TriggerBot();
		BunnyHop();
	}
}
What is it that I do wrong at : if (PlayerList[MyPlayer.CrosshairEntityID-0].Team == MyPlayer.Team) ?
 
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