Source Code My First Triggerbot :D

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

sachamo2010

Newbie
Full Member
Mar 9, 2017
14
448
0
First release of anything, hopefully it doesn't suck too bad; hoping to help any fellow noobs who're just starting out. Thanks to @Rake for helping me out & answering my dumb questions, Traxin for the DLL injection tutorials (https://guidedhacking.com/showthread.php?8995-How-To-Call-Game-Functions-C-x64dbg-Hacking-Tutorial), Rawr123 for the InCrosshair() function (I did find this on my own but used his post (https://guidedhacking.com/showthread.php?8042-InCrosshair-function) to double-check myself), Lukor for ReClass (https://guidedhacking.com/showthrea...ss-2015-Updated-x86-and-x64&highlight=reclass) and Broihon for his DLL injector (https://guidedhacking.com/showthread.php?8417-GH-Injector-(Source-included))

With all that out of the way, this is an internal DLL triggerbot that uses the built-in function that we called InCrosshair(). It returns a pointer to the player you're aiming at, and with ReClass we're able to quickly check if that player is on our team or not. If not, it shoots.

Entity.h (this is everything I have for the player structure. We use hardly any of it here but I'm too lazy to crop the other stuff out :p)
C++:
// Generated using ReClass 2015

class Entity;

class Entity {
public:
	char pad_0x0000[0x4]; //0x0000
	Vector3 head; //0x0004 
	Vector3 velocity; //0x0010 
	Vector3 velocity2; //0x001C 
	Vector3 velocity3; //0x0028 
	Vector3 position; //0x0034 
	Vector2 mouse; //0x0040 
	char pad_0x0048[0xC]; //0x0048
	float width; //0x0054 
	char pad_0x0058[0x4]; //0x0058
	float height; //0x005C 
	float maxHeight; //0x0060 
	char pad_0x0064[0x4]; //0x0064
	unsigned char canJump; //0x0069 
	char pad_0x006A[0x18]; //0x006A
	unsigned char isDead; //0x0082 
	char pad_0x0083[0x75]; //0x0083
	__int32 health; //0x00F8 
	__int32 armor; //0x00FC 
	char pad_0x0100[0x14]; //0x0100
	__int32 pistolClip; //0x0114 
	__int32 carbineClip; //0x0118 
	__int32 shotgunClip; //0x011C 
	__int32 smgClip; //0x0120 
	__int32 sniperClip; //0x0124 
	__int32 arClip; //0x0128 
	char pad_0x012C[0x8]; //0x012C
	__int32 dualClip; //0x0134 
	char pad_0x0138[0x4]; //0x0138
	__int32 pistolAmmo; //0x013C 
	__int32 carbineAmmo; //0x0140 
	__int32 shotgunAmmo; //0x0144 
	__int32 smgAmmo; //0x0148 
	__int32 sniperAmmo; //0x014C 
	__int32 arAmmo; //0x0150 
	char pad_0x0154[0x4]; //0x0154
	__int32 grenades; //0x0158 
	__int32 dualAmmo; //0x015C 
	__int32 knifeCD; //0x0160 
	__int32 pistolCD; //0x0164 
	__int32 carbineCD; //0x0168 
	__int32 shotgunCD; //0x016C 
	__int32 smgCD; //0x0170 
	__int32 sniperCD; //0x0174 
	__int32 arCD; //0x0178 
	char pad_0x017C[0x4]; //0x017C
	__int32 grenadeCD; //0x0180 
	__int32 dualCD; //0x0184 
	__int32 knifeSwingsTaken; //0x0188 
	__int32 pistolShotsFired; //0x018C 
	__int32 carbineShotsFired; //0x0190 
	__int32 shotgunShotsFired; //0x0194 
	__int32 smgShotsFired; //0x0198 
	__int32 sniperShotsFired; //0x019C 
	__int32 arShotsFired; //0x01A0 
	char pad_0x01A4[0x4]; //0x01A4
	__int32 grenadesThrown; //0x01A8 
	__int32 dualShotsFired; //0x01AC 
	char pad_0x01B0[0x34]; //0x01B0
	__int32 ID; //0x01E4 
	char pad_0x01E8[0x14]; //0x01E8
	__int32 frags; //0x01FC 
	char pad_0x0200[0x4]; //0x0200
	__int32 deaths; //0x0204 
	char pad_0x0208[0x4]; //0x0208
	__int32 teammatesKilled; //0x020C 
	char pad_0x0210[0x14]; //0x0210
	__int8 isShooting; //0x0224 
	char name[16]; //0x0225 
	char pad_0x0235[0xF7]; //0x0235
	__int32 team; //0x032C 
	char pad_0x0330[0x8]; //0x0330
	__int32 state; //0x0338 
	char pad_0x033C[0x104]; //0x033C
}; //Size=0x0440
main.cpp
C++:
#include "Memory.h" // from Traxin's 2nd tutorial on DLL injection
#include "Entity.h"

typedef int*(__stdcall *_InCrosshair)();
_InCrosshair AC_InCrosshair;

DWORD WINAPI MainThread(LPVOID param) {
	uintptr_t moduleBase = (uintptr_t)GetModuleHandle(NULL);
	AC_InCrosshair = (_InCrosshair)((uintptr_t)moduleBase + 0x607C0);

	Entity *pLocalPlayer = (Entity*)*(DWORD*)((uintptr_t)moduleBase + 0x10F4F4);

	while (!GetAsyncKeyState(VK_END)) {
		int iGameType = *(DWORD*)((uintptr_t)moduleBase + 0x10F49C);
		Entity *pAimingAt = (Entity*)AC_InCrosshair();
		if (pAimingAt) { // if we're aiming at a player
			if (iGameType == 7 || iGameType == 20 || iGameType == 21) { // if game type is team-based
				if (pAimingAt->team != pLocalPlayer->team) { // if player is on other team
					pLocalPlayer->isShooting = 1;
					Sleep(50);
					pLocalPlayer->isShooting = 0;
				}
			} else { // not team game, shoot all the things
				pLocalPlayer->isShooting = 1;
				Sleep(50);
				pLocalPlayer->isShooting = 0;
			}
		}
	}

	FreeLibraryAndExitThread((HMODULE)param, 0);
	return 0;
}

BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) {
	switch (dwReason) {
		case DLL_PROCESS_ATTACH:
			CreateThread(0, 0, MainThread, hModule, 0, 0);
			break;
		default:
			break;
	}
	return TRUE;
}
I'm sure this can be made better but it does work and since this is my first ever triggerbot, I'm happy and wanted to share :) I'm open to any suggestions on how to improve it. More to come (I'm thinking aimbot + ESP next)
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
Yup! Nice, clean code.
Love that you're calling a function to get the entity instead of just using memory, ofc :p

Just one thing, there's no real need to mix up DWORD and uintptr_t.
uintptr_t is either 4 or 8 bytes depending on your project settings.
So on a x86 build, uintptr_t and DWORD are essentially the same thing really.
 

lukaluka

Coder
Meme Tier VIP
Jul 6, 2015
285
1,213
3
if this source, can be done?
C++:
typedef int (__stdcall* CrossHair)();
CrossHair CrossHair_T = (Crosshair)(0x400000 + 0x607C0);
if(CrossHair_T() > NULL)
{
Shoot;
}
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
if this source, can be done?
C++:
typedef int (__stdcall* CrossHair)();
CrossHair CrossHair_T = (Crosshair)(0x400000 + 0x607C0);
if(CrossHair_T() > NULL)
{
Shoot;
}
Yeeeaaap.
 

sachamo2010

Newbie
Full Member
Mar 9, 2017
14
448
0
Yup! Nice, clean code.
Love that you're calling a function to get the entity instead of just using memory, ofc :p

Just one thing, there's no real need to mix up DWORD and uintptr_t.
uintptr_t is either 4 or 8 bytes depending on your project settings.
So on a x86 build, uintptr_t and DWORD are essentially the same thing really.
Good to know, thanks. Relatively new to C++ and VERY new to DLL injection so I have a long ways to go! I'll have to do some research since the next game I'm looking at will be x64 so I'll have to make sure I'm using DWORD and uintptr_t correctly

if this source, can be done?
C++:
typedef int (__stdcall* CrossHair)();
CrossHair CrossHair_T = (Crosshair)(0x400000 + 0x607C0);
if(CrossHair_T() > NULL)
{
Shoot;
}
For the crosshair function, you can do 0x4607C0 as well instead of adding anything to the base address, I just like the feel of base + 0x607C0 personally (I've tried it both ways and it worked fine). You can also set a function to Shoot() if you'd like as well.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Great work on this project m8 thanks for sharing
 

Luley

Newbie
Jun 18, 2017
1
12
0
Hi please help me , where can i put this Code to allow it Works in My CSS ? And Nice Work! :D
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,073
78,998
2,371
Hi please help me , where can i put this Code to allow it Works in My CSS ? And Nice Work! :D
You don't put this code anywhere friend. This is a injected dll hack triggerbot source code for Assault Cube. You can't put it in any other games. What you should do is, learn C++, learn Cheat Engine, then learn how to hack using our video tutorials. After 3-6 months of hard work and patience you might be smart enough (with our help that is) to make a basic hack for a game of your choosing.
 
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