Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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 = 0xAAD6E8;
- const DWORD m_dwAttack = 0x02F108C0;
- const DWORD m_dwTeamoffset = 0xF0;
- //const DWORD m_dwMaxPlayers = 0x00000308;
- const DWORD m_dwCrosshairOffset = 0xAA70;
- const DWORD m_dwEntityList = 0x4AD0884;
- const DWORD m_dwEntityLoopDist = 0x10;
- const DWORD m_dwPlayers = 0x308;
- DWORD m_dwClientState = 0x5CB524;
- DWORD dwClientState;
- 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);
- //client state
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + m_dwClientState), &dwClientState, 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), &CrosshairEntityId, sizeof(int), 0);
- //player num
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(dwClientState + m_dwPlayers), &i_playersnum, sizeof(int), 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;
- std::cout << "Other Ent!" << std::endl;
- }
- 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(VK_F4))
- {
- LocalPlayer.Read();
- for (int i = 0; i < i_playersnum; i++)
- {
- PlayerList[i].Read(i);
- //std::cout << PlayerList[i].Team << std::endl;
- }
- Trigger();
- }
- std::cout << "Check 2" << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement