HelpCode Overview

Posts 1–12 of 12 · Page 1 of 1
Code Overview
Hey guys, I'm having trouble with a bit of code that I wrote, with some help with tutorials and some copy pasta, and for some reason it wont work.

Anyway checkout the code and any help would be great! Thanks for helping a noob out! (:

Main.cpp
Code:
#include "stdafx.h"
#include <iostream>

ProcMem Mem;

using namespace std;

void Trigger();

DWORD ClientDLL;
DWORD LocalPlayer;
DWORD LocalTeam;
DWORD CrossHairID;
DWORD EnemyInCH = NULL;
int EnemyHealth = NULL;
int EnemyTeam = NULL;

int main() {
    Mem.Process("csgo.exe");
    ClientDLL = Mem.Module("client.dll");
    //Player
     LocalPlayer = Mem.Read<DWORD>(ClientDLL + PlayerBase);
    //Players Team
     LocalTeam = Mem.Read<int>(LocalPlayer + TeamOffset);
    //Players Cross hair ID 
     CrossHairID = Mem.Read<int>(LocalPlayer + CrosshairOffset);

    while (true){
        Trigger();
    }
    system("pause");
    return 0;
}

void Trigger() {
     EnemyInCH = Mem.Read<DWORD>(ClientDLL + EntityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
     EnemyHealth = Mem.Read<int>(EnemyInCH + HealthOffset); // Enemy in crosshair's 
     EnemyTeam = Mem.Read<int>(EnemyInCH + TeamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
    if (LocalTeam != EnemyTeam && EnemyHealth > 0 )    {
        // Here you can add a delay before shooting, to make it look legit. This is done using Sleep()
        mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
        // use Sleep() here for shooting several shots with an ak for example. Not usable with pisto
        mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
        // use Sleep() here for a 'cooldown' between shots.
    }
}
stdafx.h
Code:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once


#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include <dwmapi.h>
#pragma comment(lib, "dwmapi.lib")
#include <string>
#include <TlHelp32.h>
#include <random>
#include <sstream>
#include <fstream>
#include <io.h>
#include <iostream>
#include <algorithm>
#include <future>
#include "D3D.h"
#include "Offsets.h"
#include "ProcMem.h"
Offsets.h
Code:
#pragma once
// Needs to be updated when counter strike is updated.
const DWORD PlayerBase = 0xA6D444;
const DWORD EntityBase = 0x4A5B8F4;
const DWORD CrosshairOffset = 0x0000C554;
// Does not change on updated, in other words, no need to update these! 
const DWORD TeamOffset = 0xF0;
const DWORD HealthOffset = 0xFC;
const DWORD EntLoopDist = 0x10;
And the procmem .h & .cpp.
That's because your crosshair ID offset is wrong.
Code:
DT_Local -> m_iCrossHairID: ____________________ 0x0000C550
I'm assuming you're using an outdated dumper. Google CS:GO Offset Dumper *small one* by Y3t1y3t and use the latest version. It works fine for me
Quote Originally Posted by phoenix8383 View Post
That's because your crosshair ID offset is wrong.
Code:
DT_Local -> m_iCrossHairID: ____________________ 0x0000C550
I'm assuming you're using an outdated dumper. Google CS:GO Offset Dumper *small one* by Y3t1y3t and use the latest version. It works fine for me
Hey thanks man, I will try it out and see if it works.
It's the beginning to a multihack.

Side note,
It now works but it's really laggy/glitchy.

- - - Updated - - -

Quote Originally Posted by phoenix8383 View Post
That's because your crosshair ID offset is wrong.
Code:
DT_Local -> m_iCrossHairID: ____________________ 0x0000C550
I'm assuming you're using an outdated dumper. Google CS:GO Offset Dumper *small one* by Y3t1y3t and use the latest version. It works fine for me
Yo man it seems like it's not grabbing the new values.


Update Just had to put my localplayer localteam and crosshairid in the while loop. Ez now. Thanks guys for all the help!
Quote Originally Posted by Buttars0070 View Post
It's the beginning to a multihack.

Side note,
It now works but it's really laggy/glitchy.

- - - Updated - - -



Yo man it seems like it's not grabbing the new values.


Update Just had to put my localplayer localteam and crosshairid in the while loop. Ez now. Thanks guys for all the help!
Remove that while loop or place them inside...



---update
~nvm you fixed it
Quote Originally Posted by Buttars0070 View Post
It's the beginning to a multihack.

Side note,
It now works but it's really laggy/glitchy.

- - - Updated - - -



Yo man it seems like it's not grabbing the new values.


Update Just had to put my localplayer localteam and crosshairid in the while loop. Ez now. Thanks guys for all the help!
It's okay for a first hack
Quote Originally Posted by Adrenaline View Post
It's okay for a first hack
Everyone has to start somewhere. Glad some people are really get into the whole thing.
Quote Originally Posted by 4nuoFZf9aE View Post
Everyone has to start somewhere. Glad some people are really get into the whole thing.
Yes, it takes some time but nice to see people improving their code
Hey man hit me up with a pm so I can get some help from you in the future if you would be ok with that.
Quote Originally Posted by 4nuoFZf9aE View Post
Everyone has to start somewhere. Glad some people are really get into the whole thing.
It's an honor even having you see my posts. The while loop is for testing purposes and will be removed in later versions.
Quote Originally Posted by Buttars0070 View Post
Hey man hit me up with a pm so I can get some help from you in the future if you would be ok with that.
Is this Solved then?
Using DirectX in triggerbot?
Posts 1–12 of 12 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us