Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <iostream>
- #include "C:\Users\Cody\Desktop\HackProcess.h"
- const DWORD Player_Base = 0x9F4008;
- CHackProcess fProcess;
- using namespace std;
- #define F6_KEY 0x75
- bool b_ShotNow = false;
- const DWORD dw_attack = 0xA4711C;
- const DWORD dw_teamOffset = 0xF0;
- //console command attack 5=shoot 4=dont
- int i_shoot = 5;
- int i_DontShoot = 4;
- //How many players are on?
- int NumOfPlayers = 32;
- const DWORD dw_PlayerCount = 0x894B94;
- //What am i aiming at?
- const DWORD dw_crosshairOffs = 0x2370;
- //Other Players info
- const DWORD dw_entityBase = 0xA0D5AC;
- //Loop distance
- const DWORD dw_EntityLoopDistance = 0x10;
- struct MyPlayer
- {
- DWORD CLocalPlayer;
- int Team;
- int CrosshairEntityID;
- void ReadInformation()
- {
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
- //team
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer+dw_teamOffset), &Team, sizeof(int), 0);
- //crosshair mang
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer+dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0);
- //num of plays
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine+dw_PlayerCount), &NumOfPlayers, sizeof(int), 0);
- }
- }MyPlayer;
- struct PlayerList
- {
- DWORD CBaseEntity;
- int Team;
- void ReadInformation(int Player)
- {
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_entityBase + (Player * dw_EntityLoopDistance)), &CBaseEntity, sizeof(DWORD), 0);
- //What team u on brah
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity+dw_teamOffset), &Team, sizeof(int), 0);
- }
- }PlayerList[32];
- void TriggerBot()
- {
- //disable
- 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-1].Team == MyPlayer.Team)
- return;
- if(MyPlayer.CrosshairEntityID > NumOfPlayers)
- return;
- //Attack
- if(!b_ShotNow)
- {
- WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_shoot, sizeof(int), NULL);
- b_ShotNow = !b_ShotNow;
- }
- }
- int main()
- {
- fProcess.RunProcess();
- std::cout << "Found the game yo, enjoy the hax" << std::endl;
- while(!GetAsyncKeyState(F6_KEY))
- {
- MyPlayer.ReadInformation();
- for(int i = 0; i < NumOfPlayers; i++)
- {
- PlayerList[i].ReadInformation(i);
- }
- TriggerBot();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement