Trigerbot error

Posts 1–4 of 4 · Page 1 of 1
Trigerbot error
Hi, i have created a simple triger bot for csgo and it works. But now i have changed the code a lot to organize and is giving me errors wich i can't solve.

The Errors:

gyazo.com/78f3153041bcc5c3884e5ba4ad980bce

GlobalVariables.h:
Code:
#pragma once

#include "stdafx.h"
#include "windows.h"
#include <string>

using namespace std;


/* Global Variables */
	string const MODULE_NAME = "client.dll";
	DWORD dwClient;
	DWORD dwPlayer;
	int myCrosshair;
	DWORD id;
	HANDLE CSHANDLE;


//Offsets
	DWORD const dwLocalPlayer = 0xAA5834;
	DWORD const dwEntityList = 0x4AC8014;
	DWORD const m_fFlags = 0x100;
	DWORD const m_iHealth = 0xFC;
	DWORD const oTeam = 0xF0;
	DWORD const m_iCrossHairID = 0xAA70;
	DWORD const EntityLoopDitance = 0x10;
Memory.h:

Code:
#pragma once
#include "stdafx.h"
#include <iostream>
#include "windows.h"
#include <tlhelp32.h>
#include <string>
#include "GlobalVariables.h"

using namespace std;

void get_module(string module);

template <class output>
output read_memory(DWORD adress);
triger.h:

Code:
#pragma once
#include "stdafx.h"
#include "windows.h"
#include "GlobalVariables.h"
#include "Memory.h"

class triger
{
public:
	void shoot(int *value);
	~triger();
};
main.cpp

Code:
#include "stdafx.h"
#include "Memory.h"
#include "triger.h"

using namespace std;


int main()
{
	int rnd = 1;
	get_module(MODULE_NAME);
	dwPlayer = read_memory<DWORD>(dwClient + dwLocalPlayer);
	triger tr;
	while (1)
	{
		tr.shoot(&rnd);
		Sleep(1);
	}
	system("pause");
}
This was the first time that i divide a program in more than 2 files, and i think the program as something wrong with the includes but i already mess with it a while and didn't manage to resolve the problem.

I will not post memory.cpp and triger.cpp (Unless is really necessary) just for the hack stays private.
Easy fix: Stop copying codes and write your own, so that you will know what's wrong and how to fix it
I've found your keyboard!

  • Some of your variables are being defined in multiple object files. Which causes multiple linker errors, only define your variables in one place (Meaning, know what the hell you're doing).
  • You cannot define the body of a templated function in your implementation file (in this case your *.cpp files). Unless they are specializations of an already defined template function.


And onto the variables, since you're defining them all in a header, with their initializations, I'd recommend to declare them static.
Lastly, you need to move the implementantion of your template functions into their respective header files.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us