Solved WriteProcessMemory not working

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat
Status
Not open for further replies.

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
so about 4-5 days ago i somehow youtubewatching-writed fleep's triggerbot, i have been looking on internet for a while but im noobie yet, i understand code a bit but cant code on my own momentally,
my problem is -
C++:
WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_Attack), &i_Shoot, sizeof(int), NULL);
- i dont want to write memory to shoot, i want to use mouse_event like

C++:
 mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
  mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
how can i add this into the code so it will work properly? ( i know i havent updated all offsets yet but i iwll do it later [you might check the code if it will be working nor tell me what am i doing wrong])

note: i want not to use playercount offset but i want to use the number, 32 - is it writen fine or do i need to change something?
note2: i probably see vs like 4-5 days so i have to learn from somewhere, when i watch videos and do the same as they say like c++ basics its boring, this is fun because i learn something when trying to write it and find out whats wrong
 
Last edited by a moderator:

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
<insert main.cpp here>

hello first of all you will possibly think im mentally retarded because im newbie, so if you want to hurt my feelings please dont even read more


so about 4-5 days ago i somehow youtubewatching-writed fleep's triggerbot, i have been looking on internet for a while but im noobie yet, i understand code a bit but cant code on my own momentally,
my problem is -
C++:
WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_Attack), &i_Shoot, sizeof(int), NULL);
- i dont want to write memory to shoot, i want to use mouse_event like

C++:
 mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
  mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
how can i add this into the code so it will work properly? ( i know i havent updated all offsets yet but i iwll do it later [you might check the code if it will be working nor tell me what am i doing wrong])

note: i want not to use playercount offset but i want to use the number, 32 - is it writen fine or do i need to change something?
note2: i probably see vs like 4-5 days so i have to learn from somewhere, when i watch videos and do the same as they say like c++ basics its boring, this is fun because i learn something when trying to write it and find out whats wrong
In your Triggerbot function you just gonna change the WriteProcessMemory out with Mouse_event.
You will do like this :
C++:
void Triggerbot (void)
{
	if(HereYourCrosshairOffsetGonnaBe > 0 && HereYourCrosshairOffsetGonnaBe < 32)
         {
                    Sleep(5);
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
		    Sleep(5); // 
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
          }
}
And then call the new Triggerbot function in int main()
Like this :
C++:
Triggerbot();
I hope i could help u man just write if there is more problem you need help with :)
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
In your Triggerbot function you just gonna change the WriteProcessMemory out with Mouse_event.
You will do like this :
C++:
void Triggerbot (void)
{
	if(HereYourCrosshairOffsetGonnaBe > 0 && HereYourCrosshairOffsetGonnaBe < 32)
         {
                    Sleep(5);
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
		    Sleep(5); // 
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
          }
}
And then call the new Triggerbot function in int main()
Like this :
C++:
Triggerbot();
I hope i could help u man just write if there is more problem you need help with :)
C++:
#include <Windows.h>  
#include <iostream> 
#include "HackProcess.h" 

//Create our 'hooking' and process managing object
CHackProcess fProcess;  
using namespace std;  

//The player base is VERY important so we know where our player info is at
//including current jump status so we can use force jumping making our bHop
const DWORD Player_Base = 0xA6DA14;//0x00574560;
const DWORD teamOffset = 0xF0;
const DWORD healthOffset = 0xFC;
const DWORD EntLoopDist = 0x10;
//We use F6 to exit the hack
#define F6_Key 0x75
//used to alternate between shooting var
bool b_ShotNow = false;
//The ATTACK address BELOW, WE WRITE 5 TO SHOOT OR 4 TO 
const DWORD dw_Attack = 0x2E822F4;//client
const DWORD dw_mTeamOffset = 0xF0;//client

//Here we overwrite the value for +ATTACK1 and -ATTACK1
//so we can keep shooting at the enemy when crosshair ID changes
int i_Shoot = 5;
int i_DontShoot = 4;

//Here we store the num of players and update it regularly to know how many enemies we are dealing with
//this saves us doing loops unless their necessary e.g. we have 12 players and still loop 32 times wasting our great resources
//This makes our triggerbot MUCH faster in general
int NumOfPlayers = 32;
const DWORD dw_crosshairOffs = 0x23F8;//Client.dll

//Enemy Vars including the enemy loop
const DWORD EntityPlayer_Base = 0x4A10384;

//How far in memory is each enemy data
const DWORD EntityLoopDistance = 0x10;


//We will use this struct throughout all other tutorials adding more variables every time
struct MyPlayer_t  
{ 
	//Player base
	DWORD CLocalPlayer; 
	//Get our player's team
	int Team; 
	//stores our current entity in sight
	int CrosshairEntityID;
	void ReadInformation() 
	{
		// Reading CLocalPlayer Pointer to our "CLocalPlayer" DWORD. 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
		// Reading out our Team to our "Team" Varible. 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_mTeamOffset), &Team, sizeof(int), 0);

		//1478 IS THE CURRENT ENEMY/ENTITY IN CROSSHAIRS
		//this was found by scanning barrels and enemies constantly through Changed and Unchanged values in cheat engine.
		//then as usual address - base gave the offset answer
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0); 

		//Here we find how many player entities exist in our game, through this we make sure to only loop the amount of times we need
		//when grabbing player data
		//Note that this call could be even better at a regular 15 or so seconds timer but performance shouldn't vary a great deal
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine), &NumOfPlayers, sizeof(int), 0); 
	}
}MyPlayer; 


//Stores our enemy data
struct PlayerList_t 
{
	DWORD CBaseEntity; 
	int Team; 

	void ReadInformation(int Player) 
	{
		// Reading CBaseEntity Pointer to our "CBaseEntity" DWORD + Current Player in the loop. 0x10 is the CBaseEntity List Size 
		//"client.dll"+00545204 //0x571A5204
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + EntityPlayer_Base  + (Player * EntityLoopDistance)),
			&CBaseEntity, sizeof(DWORD), 0);
		// Reading out our Team to our "Team" Varible. 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_mTeamOffset), &Team, sizeof(int), 0);
 	}
}PlayerList[32];  


void TriggerBot()
{
	int TheResponse = 0; // speed of firing
	//disable the ATTACK1 so we can shoot again next time
	//just took a shot(+attack), we need to reset the var back to be able to shoot again

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

	//Everything is as we want so shoot
	//TAKE A SHOT once we know the +attack command has been reset
	if (b_ShotNow)
	{
		//SHOOT
		ReadProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_Attack), &i_Shoot, sizeof(int), NULL);
		b_ShotNow = !b_ShotNow;
	}
	

	//If we are not aiming at anyone or an unwanted entity such as a barrel then return
	if(MyPlayer.CrosshairEntityID == 0)
		return;
	
	//If player is on the same team we skip the triggerbot and DONT shoot
	//-1 because in game the crosshair entity Id's start from 1 instead of 0 in as in the array
	//we take 1 away so it accesses our correct Player Array
	if (PlayerList[MyPlayer.CrosshairEntityID-1].Team == MyPlayer.Team) 
		return;

	//if entity in crosshair is greater than OUR NUMBER of players it means its not an enemy
	if(MyPlayer.CrosshairEntityID > 32)
		return;

}


//Our main loop
int main() 
{   
	fProcess.RunProcess(); // Waiting for CSGO......
	cout << "Fleepisgod(csgorunning)" << endl; 

	//Exit if the F6 key is pressed
	while (!GetAsyncKeyState(F6_Key)) // or for(;;)
	{
		//Read player information into our struct so we know the player 
		//base and the bunny hop addresses
		MyPlayer.ReadInformation(); 

		//Loop through all our players and retrieve their information
		//we use this mainly here to find out what players are our enemies and what players are on our team
		for(int i = 0; i < NumOfPlayers; i ++)
		{
			PlayerList[i].ReadInformation(i);

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

		}

		//Perform our Triggerbot
		TriggerBot();
	}
}
im actually absolutly distracted, could you show me where did i do bad code and how should i change it to make it working? thanks in advance, i was expecting something like "go learn c++ kido"; or some like this, you surprised me!
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
C++:
#include <Windows.h>  
#include <iostream> 
#include "HackProcess.h" 

//Create our 'hooking' and process managing object
CHackProcess fProcess;  
using namespace std;  

//The player base is VERY important so we know where our player info is at
//including current jump status so we can use force jumping making our bHop
const DWORD Player_Base = 0xA6DA14;//0x00574560;
const DWORD teamOffset = 0xF0;
const DWORD healthOffset = 0xFC;
const DWORD EntLoopDist = 0x10;
//We use F6 to exit the hack
#define F6_Key 0x75
//used to alternate between shooting var
bool b_ShotNow = false;
//The ATTACK address BELOW, WE WRITE 5 TO SHOOT OR 4 TO 
const DWORD dw_Attack = 0x2E822F4;//client
const DWORD dw_mTeamOffset = 0xF0;//client

//Here we overwrite the value for +ATTACK1 and -ATTACK1
//so we can keep shooting at the enemy when crosshair ID changes
int i_Shoot = 5;
int i_DontShoot = 4;

//Here we store the num of players and update it regularly to know how many enemies we are dealing with
//this saves us doing loops unless their necessary e.g. we have 12 players and still loop 32 times wasting our great resources
//This makes our triggerbot MUCH faster in general
int NumOfPlayers = 32;
const DWORD dw_crosshairOffs = 0x23F8;//Client.dll

//Enemy Vars including the enemy loop
const DWORD EntityPlayer_Base = 0x4A10384;

//How far in memory is each enemy data
const DWORD EntityLoopDistance = 0x10;


//We will use this struct throughout all other tutorials adding more variables every time
struct MyPlayer_t  
{ 
	//Player base
	DWORD CLocalPlayer; 
	//Get our player's team
	int Team; 
	//stores our current entity in sight
	int CrosshairEntityID;
	void ReadInformation() 
	{
		// Reading CLocalPlayer Pointer to our "CLocalPlayer" DWORD. 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
		// Reading out our Team to our "Team" Varible. 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_mTeamOffset), &Team, sizeof(int), 0);

		//1478 IS THE CURRENT ENEMY/ENTITY IN CROSSHAIRS
		//this was found by scanning barrels and enemies constantly through Changed and Unchanged values in cheat engine.
		//then as usual address - base gave the offset answer
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0); 

		//Here we find how many player entities exist in our game, through this we make sure to only loop the amount of times we need
		//when grabbing player data
		//Note that this call could be even better at a regular 15 or so seconds timer but performance shouldn't vary a great deal
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine), &NumOfPlayers, sizeof(int), 0); 
	}
}MyPlayer; 


//Stores our enemy data
struct PlayerList_t 
{
	DWORD CBaseEntity; 
	int Team; 

	void ReadInformation(int Player) 
	{
		// Reading CBaseEntity Pointer to our "CBaseEntity" DWORD + Current Player in the loop. 0x10 is the CBaseEntity List Size 
		//"client.dll"+00545204 //0x571A5204
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + EntityPlayer_Base  + (Player * EntityLoopDistance)),
			&CBaseEntity, sizeof(DWORD), 0);
		// Reading out our Team to our "Team" Varible. 
		ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_mTeamOffset), &Team, sizeof(int), 0);
 	}
}PlayerList[32];  


void TriggerBot()
{
	int TheResponse = 0; // speed of firing
	//disable the ATTACK1 so we can shoot again next time
	//just took a shot(+attack), we need to reset the var back to be able to shoot again

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

	//Everything is as we want so shoot
	//TAKE A SHOT once we know the +attack command has been reset
	if (b_ShotNow)
	{
		//SHOOT
		ReadProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_Attack), &i_Shoot, sizeof(int), NULL);
		b_ShotNow = !b_ShotNow;
	}
	

	//If we are not aiming at anyone or an unwanted entity such as a barrel then return
	if(MyPlayer.CrosshairEntityID == 0)
		return;
	
	//If player is on the same team we skip the triggerbot and DONT shoot
	//-1 because in game the crosshair entity Id's start from 1 instead of 0 in as in the array
	//we take 1 away so it accesses our correct Player Array
	if (PlayerList[MyPlayer.CrosshairEntityID-1].Team == MyPlayer.Team) 
		return;

	//if entity in crosshair is greater than OUR NUMBER of players it means its not an enemy
	if(MyPlayer.CrosshairEntityID > 32)
		return;

}


//Our main loop
int main() 
{   
	fProcess.RunProcess(); // Waiting for CSGO......
	cout << "Fleepisgod(csgorunning)" << endl; 

	//Exit if the F6 key is pressed
	while (!GetAsyncKeyState(F6_Key)) // or for(;;)
	{
		//Read player information into our struct so we know the player 
		//base and the bunny hop addresses
		MyPlayer.ReadInformation(); 

		//Loop through all our players and retrieve their information
		//we use this mainly here to find out what players are our enemies and what players are on our team
		for(int i = 0; i < NumOfPlayers; i ++)
		{
			PlayerList[i].ReadInformation(i);

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

		}

		//Perform our Triggerbot
		TriggerBot();
	}
}
im actually absolutly distracted, could you show me where did i do bad code and how should i change it to make it working? thanks in advance, i was expecting something like "go learn c++ kido"; or some like this, you surprised me!
Full code :
C++:
#include <Windows.h>  
#include <iostream> 
#include "HackProcess.h" 
 
//Create our 'hooking' and process managing object
CHackProcess fProcess;  
using namespace std;  
 
//The player base is VERY important so we know where our player info is at
//including current jump status so we can use force jumping making our bHop
const DWORD Player_Base = 0xA6DA14;//0x00574560;
const DWORD teamOffset = 0xF0;
const DWORD healthOffset = 0xFC;
const DWORD EntLoopDist = 0x10;
//We use F6 to exit the hack
#define F6_Key 0x75
//used to alternate between shooting var
bool b_ShotNow = false;
//The ATTACK address BELOW, WE WRITE 5 TO SHOOT OR 4 TO 
const DWORD dw_Attack = 0x2E822F4;//client
const DWORD dw_mTeamOffset = 0xF0;//client
 
//Here we overwrite the value for +ATTACK1 and -ATTACK1
//so we can keep shooting at the enemy when crosshair ID changes
int i_Shoot = 5;
int i_DontShoot = 4;
 
//Here we store the num of players and update it regularly to know how many enemies we are dealing with
//this saves us doing loops unless their necessary e.g. we have 12 players and still loop 32 times wasting our great resources
//This makes our triggerbot MUCH faster in general
int NumOfPlayers = 32;
const DWORD dw_crosshairOffs = 0x23F8;//Client.dll
 
//Enemy Vars including the enemy loop
const DWORD EntityPlayer_Base = 0x4A10384;
 

const DWORD EntityLoopDistance = 0x10;
 
 

struct MyPlayer_t  
{ 
    DWORD CLocalPlayer; 
    int Team; 
    int CrosshairEntityID;
    void ReadInformation() 
    {
 
        ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0); 
        ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_mTeamOffset), &Team, sizeof(int), 0);  
        ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0); 
        ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine), &NumOfPlayers, sizeof(int), 0); 
    }
}MyPlayer; 
 
 
//Stores our enemy data
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];  
 
 
void Triggerbot (void) // THIS IS OUT TRIGGERBOT FUNCTION WE MADE.
{
    if(CrosshairEntityID > 0 && CrosshairEntityID < 32) // HERE WE KINDA SCAN/SEARCH FOR THE OFFSET VALUE GO UP, IF THE OFFSET GOES TO 1.2.3.. WE GOT AN PLAYER WE CAN SHOOT. YOU CAN ADD SO IT CHECK FOR YOUR TEAMMATES AND LIFE THAT MIGTH BE GOOD :)
         {
                    Sleep(5);
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); // THE KEY WILL BE PRESS DOWN LIKE U WILL DO WHEN U PLAY.
            Sleep(5); // 
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); // THE KEY PRESS UP.
          }
}
 
 
int main() 
{   
    fProcess.RunProcess(); 
    cout << "Fleepisgod(csgorunning)" << endl; 
 

    while (!GetAsyncKeyState(F6_Key)) // or for(;;)
    {
    
        MyPlayer.ReadInformation(); 
 

        for(int i = 0; i < NumOfPlayers; i ++)
        {
            PlayerList[i].ReadInformation(i);
 
          
        }      
        TriggerBot(); // HERE WE CALL OUR TRIGGERBOT FUCNTION AS I SAID :)
    }
}
Check what i written in the code.
I can tell you might have the wrong offset/address.
Hope that helped u out. As u may see my English is not so good. x)
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
well for some reason it just crashes on start, dont you know why? only thing i've edited in hackprocess.h was

C++:
while (!FindProcessName("csgo.exe", &__gameProcess)) Sleep(12);
+
C++:
__HWNDCss = FindWindow(NULL, "Counter-Strike: Global Offensive");
so i guess thats not it

it must be a an error in the code we are talking about ( btw you did mistake! you declared Triggerbot()) but in main() you used TriggerBot() :p
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
well for some reason it just crashes on start, dont you know why? only thing i've edited in hackprocess.h was

C++:
while (!FindProcessName("csgo.exe", &__gameProcess)) Sleep(12);
+
C++:
__HWNDCss = FindWindow(NULL, "Counter-Strike: Global Offensive");
so i guess thats not it

it must be a an error in the code we are talking about ( btw you did mistake! you declared Triggerbot()) but in main() you used TriggerBot() :p
I dont really understand what u mean but a guy on this site release a "hackprocess.h" version for csgo
Link : https://guidedhacking.com/showthread.php?4783-HackProcess-h-for-CS-GO-(supports-server-dll)

Check your offset, think csgo just updated in last week.
Glad to help you man :)
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
I dont really understand what u mean but a guy on this site release a "hackprocess.h" version for csgo
Link : https://guidedhacking.com/showthread.php?4783-HackProcess-h-for-CS-GO-(supports-server-dll)

Check your offset, think csgo just updated in last week.
Glad to help you man :)
thanks for your help, for some reason, the program crashes when i just open it so i will keep trying again as before.

// would need to help a bit -

CrosshairEntityID it says https://puu.sh/dyNcK/15824d0504.png and im not sure it should have been declared
 

Attachments

Last edited:

emilo0212

Newbie
Silenced
Aug 19, 2013
25
234
0
The program crashes because, you are using wrong Offsets. Check if the offsets are properly correct. Else, give me the error, and i will look at it
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
The program crashes because, you are using wrong Offsets. Check if the offsets are properly correct. Else, give me the error, and i will look at it
it does no errors, just a crash. try to start it yourself ad tell me if it works. if there are old offsets, it is my unexperience

i use dumper, so they should be working, lets go one by one.
C++:
const DWORD Player_Base = 0xA6DA14;  //LocalPlayer 0xA6DA14
const DWORD teamOffset = 0xF0; //  m_iTeamNum 0xF0
const DWORD healthOffset = 0xFC; // m_iHealth 0xFC
const DWORD EntLoopDist = 0x10; // this is pretty famous one, its stable and it doesnt change after any update

const DWORD dw_Attack = 0x2E822F4;//  attack = 0x02E822F4,  attack2 = 0x02E822B8
const DWORD dw_mTeamOffset = 0xF0; // uhhh i got this one twice - may this be the problem becuase of using 2 other vars with same value?

const DWORD dw_crosshairOffs = 0x23F8; // m_iCrossHairID 0x23F8

//Enemy Vars including the enemy loop
const DWORD EntityPlayer_Base = 0x4A10384; // EntityList 0x4A10384
const DWORD EntityLoopDistance = 0x10; // ..... the same one again, maybe the crash im not sure
i tried to change triggerbot to

C++:
void TriggerBot()
{

	if (MyPlayer.CrosshairEntityID == 0)
		return;

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

	if (MyPlayer.CrosshairEntityID > NumOfPlayers)
		return;


	if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32)
	{
		Sleep(5);
		mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
		Sleep(10);
		mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
	}
}
but still no change, if i just know what am i doing wrong i could learn it faster.
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
it does no errors, just a crash. try to start it yourself ad tell me if it works. if there are old offsets, it is my unexperience

i use dumper, so they should be working, lets go one by one.
C++:
const DWORD Player_Base = 0xA6DA14;  //LocalPlayer 0xA6DA14
const DWORD teamOffset = 0xF0; //  m_iTeamNum 0xF0
const DWORD healthOffset = 0xFC; // m_iHealth 0xFC
const DWORD EntLoopDist = 0x10; // this is pretty famous one, its stable and it doesnt change after any update

const DWORD dw_Attack = 0x2E822F4;//  attack = 0x02E822F4,  attack2 = 0x02E822B8
const DWORD dw_mTeamOffset = 0xF0; // uhhh i got this one twice - may this be the problem becuase of using 2 other vars with same value?

const DWORD dw_crosshairOffs = 0x23F8; // m_iCrossHairID 0x23F8

//Enemy Vars including the enemy loop
const DWORD EntityPlayer_Base = 0x4A10384; // EntityList 0x4A10384
const DWORD EntityLoopDistance = 0x10; // ..... the same one again, maybe the crash im not sure
i tried to change triggerbot to

C++:
void TriggerBot()
{

	if (MyPlayer.CrosshairEntityID == 0)
		return;

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

	if (MyPlayer.CrosshairEntityID > NumOfPlayers)
		return;


	if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32)
	{
		Sleep(5);
		mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
		Sleep(10);
		mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
	}
}
but still no change, if i just know what am i doing wrong i could learn it faster.
Dont do :
C++:
if (MyPlayer.CrosshairEntityID == 0)
        return;
 if (MyPlayer.CrosshairEntityID > NumOfPlayers)
        return;
Because you already use CrosshairEntityid to see if there is an enemy in your crosshair.
C++:
if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32)
	{
		Sleep(5);
If u wanna check for health and see if its an enemy there is in your crosshair u gonna do somethings like this:
C++:
if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32 && PlayerList[i].Team != info.team && PlayerList[i].health < 1)
	{
		Sleep(5);
		mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
		Sleep(10);
		mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
	}
If there still an error on your CrosshairEntityID its maybe some where in your "MyPlayer" stucture.
Dont be afraid of using copy paste in your hacks, its a way of learning things. :)
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
Dont do :
C++:
if (MyPlayer.CrosshairEntityID == 0)
        return;
 if (MyPlayer.CrosshairEntityID > NumOfPlayers)
        return;
Because you already use CrosshairEntityid to see if there is an enemy in your crosshair.
C++:
if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32)
	{
		Sleep(5);
If u wanna check for health and see if its an enemy there is in your crosshair u gonna do somethings like this:
C++:
if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32 && PlayerList[i].Team != info.team && PlayerList[i].health < 1)
	{
		Sleep(5);
		mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
		Sleep(10);
		mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
	}
If there still an error on your CrosshairEntityID its maybe some where in your "MyPlayer" stucture.
Dont be afraid of using copy paste in your hacks, its a way of learning things. :)
what does info.team means in my code? its pretty hard now, btw i did copy paste for mouse event
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
what does info.team means in my code? its pretty hard now, btw i did copy paste for mouse event
Sorry my fault i meant "MyPlayer.Team" instead of info!
But info/MyPlayer is our structure we are using, there is all our readprocessmemory and info about "you" *Player base ex. health.
When we add the team into "info.team"/"MyPlayer.team" we tell the hack to go in under our Player base and found out what team we are on.

if u wanna make it easy to understand then see it as "me.team" and "enemy.team" in a function where we gonna find things about the enemy in the server.
Hope u understand that with structures now. U can research more about Structures on Google. Structure explanation.png
 
Last edited:

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
Sorry my fault i meant "MyPlayer.Team" instead of info!
But info/MyPlayer is our structure we are using, there is all our readprocessmemory and info about "you" *Player base ex. health.
When we add the team into "info.team"/"MyPlayer.team" we tell the hack to go in under our Player base and found out what team we are on.

if u wanna make it easy to understand then see it as "me.team" and "enemy.team" in a function where we gonna find things about the enemy in the server.
Hope u understand that with structures now. U can research more about Structures on Google.View attachment 2976

Ok i understand my coding, as i said higher, i understand mostly everything but i cant code on my own yet because i dont have enough musclememory so far i think


it says 4 IntelliSense: identifier "i" is undefined

but i have "i" defined just under TriggerBot(); , where is the problem?
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
Ok i understand my coding, as i said higher, i understand mostly everything but i cant code on my own yet because i dont have enough musclememory so far i think


it says 4 IntelliSense: identifier "i" is undefined

but i have "i" defined just under TriggerBot(); , where is the problem?
Add this :
C++:
void Triggerbot()
{


	for(int i = 0; i < 32; i ++)
	{

        if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32 && PlayerList[i].Team != MyPlayer.Team && PlayerList[i].health < 1)
        {
        Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
        Sleep(10);
        mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
    }
}
"i" is where we find how many people there in the server.

You can change it to :
C++:
for(int i = 0; i < NumOfPlayers; i ++)
	{
And add int NumOfPlayers = 32; in the top with all the address and offsets.
Should be working fine both :)


BTW* cannot guarantee u that your triggerbot will work after all my help! :)
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
Add this :
C++:
void Triggerbot()
{


	for(int i = 0; i < 32; i ++)
	{

        if (MyPlayer.CrosshairEntityID > 0 && MyPlayer.CrosshairEntityID < 32 && PlayerList[i].Team != MyPlayer.Team && PlayerList[i].health < 1)
        {
        Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
        Sleep(10);
        mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
    }
}
"i" is where we find how many people there in the server.

You can change it to :
C++:
for(int i = 0; i < NumOfPlayers; i ++)
	{
And add int NumOfPlayers = 32; in the top with all the address and offsets.
Should be working fine both :)


BTW* cannot guarantee u that your triggerbot will work after all my help! :)
im pretty sure it will work mate, i trust you.

ok, i guess last question for this thread is - how should i declare check PlayerList.health?

offset will be

C++:
const DWORD health = 0xFC;
const NumOfPlayers = 32;
now the harder part, how should i calculate the health?

C++:
ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + health), &???, sizeof(int), 0);
What's the correct meaning?
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
im pretty sure it will work mate, i trust you.

ok, i guess last question for this thread is - how should i declare check PlayerList.health?

offset will be

C++:
const DWORD health = 0xFC;
const NumOfPlayers = 32;
now the harder part, how should i calculate the health?

C++:
ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + health), &???, sizeof(int), 0);
What's the correct meaning?


Make an int Health in your structure :
C++:
int Health;
So the RPM looks somethings like this :
C++:
ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + health), &Health, sizeof(int), 0);
We put in the "Health" next to "&" so we kinda say .. CBaseEntity + health = Health
Like A + B = new word.
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
Make an int Health in your structure :
C++:
int Health;
So the RPM looks somethings like this :
C++:
ReadProcessMemory (fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + health), &Health, sizeof(int), 0);
We put in the "Health" next to "&" so we kinda say .. CBaseEntity + health = Health
Like A + B = new word.
thanks i have done it before you replied, it means i probably've learn something new! ok i just debugged it and its working fine but, when i shoot with it it always shoot 3 times, i think its because of health check, is it needed to use health check or i can remove it? // what does it actually do if i check health, because it was working just fine before

// ok it was because of the check in

for (int i = 0; i < PocetHracov; i++)
{


any other idea how to check health to make it work without using for int ?
 
Last edited:

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
If u check health u 100% sure that if there's an dead person it want shoot in him.

The problem of your hack shooting 3times is maybe because your Sleep() in the Triggerbot function u made.
If u lower your "Sleep(10)" it migth not shoot 3times.

Like :
C++:
Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
        Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
Hope u learned many things about this :)
 

dex73r

Newbie
Full Member
Jul 6, 2013
31
242
1
If u check health u 100% sure that if there's an dead person it want shoot in him.

The problem of your hack shooting 3times is maybe because your Sleep() in the Triggerbot function u made.
If u lower your "Sleep(10)" it migth not shoot 3times.

Like :
C++:
Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
        Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
Hope u learned many things about this :)
nah it isnt because of sleep function, i tried it, i just realised its because of the int, its like looping it while looking at someone then it stops but its too late so it is enough to shoot 3 times anyways, thanks for help. is there any tutorial which could learn me to read weapons equiped ?
 

simonpaa

Jr.Coder
Silenced
Oct 2, 2013
55
708
0
const DWORD WeaponID = offset;

If its because u dont wanna have it to press down the button if u have knife on.
You can do somethings like like maybe :
C++:
if(WeaponID == awp && MyPlayer.CrosshairEntityID > 0....)
 {
        Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
        Sleep(5);
        mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
    }
 
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