Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C++/C Programming › [ASSAULTCUBE] Hack Tutorials

[ASSAULTCUBE] Hack Tutorials

Posts 1–15 of 102 · Page 1 of 7
…
Hell_Demon
Hell_Demon
[ASSAULTCUBE] Hack Tutorials
Hell_Demon's AssualtCube Hack Tutorials


Flaghack
Aimbot
Remove spread and recoil
Shoot through walls
Get player entities
Client Hooking #1
Client Hooking #2
Aimbot Download



IF YOU DON'T KNOW WHAT ANY OF THIS MEANS LEARN C++ BASIC FIRST!
#1 · edited 16y ago · 16y ago
Hell_Demon
Hell_Demon
[ASSAULTCUBE] Flaghack
Download page
the download is version 1.0.2, you'll need to apply the 1.0.4 patch which can be found on the same page.

Download the sourcecode

Some information about assaultcube:
40mb in size
OpenGL
Opensource
No anticheats
No dev enforced builds(epic fail )

Since this game doesnt enforce dev builds, you can just recompile the source, replace the games exe and you're good to go

Other pieces of code:
Shooting through walls
No spread and Recoil
Aimbot
Teleport the flag to you(this page)

This code will teleport all flags to you, so as long as noone has it you'll get sick scores(around 100-200 flags per second)
Call every frame(gl_drawhud)
Code:
	if(gamemode==GMODE_CTF || gamemode == GMODE_HUNTTHEFLAG || gamemode == GMODE_TEAMKEEPTHEFLAG || gamemode == GMODE_KEEPTHEFLAG)
	{
		flaginfos[0].pos = player1->o; // teleport the flags to us
		flaginfos[1].pos = player1->o; // as long as noone from
		flaginfos[2].pos = player1->o; // our or the enemy team has it
	}
#2 · edited 16y ago · 16y ago
Hell_Demon
Hell_Demon
[ASSUALTCUBE] Aimbot
Download page
the download is version 1.0.2, you'll need to apply the 1.0.4 patch which can be found on the same page.

Download the sourcecode

Some information about assaultcube:
40mb in size
OpenGL
Opensource
No anticheats
No dev enforced builds(epic fail )

Since this game doesnt enforce dev builds, you can just recompile the source, replace the games exe and you're good to go

Other pieces of code:
Shooting through walls
No spread and Recoil
Aimbot(this page)
Teleport the flag to you

Step 1
Looking through the files.
The first thing I noticed when I opened the project in MSVC was the bot folder.
So lets open that, and take a look at the file names to see if we can find something interesting.
I'd say we open up bot_util.h.
By quickly reading through bot_util.h I found the following functions interesting:
Code:
bool IsVisible(vec v1, vec v2, dynent *tracer = NULL, bool SkipTags=false);
float GetDistance(vec v1, vec v2);
float Get2DDistance(vec v1, vec v2);
vec PredictPos(vec pos, vec vel, float Time);
Why would those be interesting?
IsVisible - Aimbot with visibility check
Get(2D)Distance - Distance based aimbot or prediction
PredictPos - Hmmm, now why could that be interesting? ^^

Since we'd want our aimbot code to execute alot(once per frame would be enough) we'll need to find the render functions, now if you'd go open the render folder you'd find renderhud.cpp.
since your HUD is rendered every frame that would be a good place to add our aimbot.

Step 2
Adding stuff to the game.
Open up renderhud.cpp and add
Code:
#include "bot/bot_util.h"
to the top(since we want to make use of certain functions from there )

Since i've been around with assaultcube(and some other cube mods) since they started I still have parts of the old bot code(the old aim angle code to be precise )
Code:
void getyawpitch(const vec &from, const vec &to, float &yaw, float &pitch)
{
	float dist = from.dist(to);
	yaw = -(float)atan2(to.x-from.x, to.y-from.y)/PI*180+180;
	pitch = asin((to.z-from.z)/dist)/RAD;
}
Now lets look at a way to get the coordinates of all players.
By looking through alot of these files I found out you can acces all players the following way:
Code:
loopv(players)
{
	players[i];
}
}
all players have the following members that we're going to use:
o - the origin
vel - the velocity(ill exclude this part of the aimbot for now since mines not perfect yet)
state - they're state(states are defined in headers/entity.h)

Step 3
The aimbot logic.
A good aimbot won't jump from 1 player to another if more of them are visible. So we'll need a way to remember our last target, and we also want to keep the 'best' distance in memory.
so at the top under the includes put the following(I have added a small 'mistake' to prevent people like dylan from compiling it, asuming he's as stupid as he appears to be, read the comments and find the same error which appears in 2 places) :
Code:
int lasttarget = -1;
float lastdist = 0.0f;
now lets start on our target function(point based )
Code:
int GetBestTarget()
{
	int ttarget=-1;
	if(lasttarget != -1 && players[lasttarget]->state == CS_ALIVE && players[lasttarget] != NULL && player1 != NULL && player1->state == CS_ALIVE)
	{
		if(IsVisible(player1->o, players[lasttarget]->o)==true)
		{
			return lasttarget; // our old target is visible so lets keep aiming for him =D
		}
	}
	loopv(players)
	{
		if(players[i] == NULL || player1 == NULL || players[i] == player1) // if player or a possible target is null, or if our possible target is ourselves skip  it.
		{
			continue;
		}
		if(players[i]->state == CS_ALIVE && player1->state == CS_ALIVE) // if we're both alive.
		{
			if(isteam(player1->team, players[i]->team)) // if our target is on our team skip it.
			{
				continue;
			}
			float tDist = Get2DDistance(player1->o, players[i]->o); // assign tDist with the 2d distance between us and our temporary target
			if(IsVisible(player1->o, players[i]->o) && tDist<bestdist) //if he is visible and closer then the previous visible enemies
			{
				ttarget=i; // set him as our temporary target
				bestdist=tDist; // set the last distance as the best distance
			}
		}	
	}
	if(ttarget==-1)
	{
		lasttarget=-1;
		return -1;
	}
	lasttarget=ttarget; // assign the current target as last target
	bestdist=0.0f; //reset the best distance so we wont fuck up next time we call the target function
	return ttarget; // return the temp target
}
Now scroll all the way down untill you find 'gl_drawhud', which is where you're going to do the actual targetting.
At the end of gl_drawhud(just before the glMatrixMode(GL_MODELVIEW)) put this code:
Code:
	int tmptarget = GetBestTarget();
	float rX, rY;
	if(tmptarget!=-1)
	{
		getyawpitch(player1->o,players[tmptarget]->o,rX,rY);
		player1->pitch = rY;
		player1->yaw = rX;
	}
You should add your favorite style yourself(for example only aim when right mouse button is down).

Step 4
Have fun owning people/bots
#3 · edited 16y ago · 16y ago
Hell_Demon
Hell_Demon
[ASSAULTCUBE] Remove spread and recoil
Download page
the download is version 1.0.2, you'll need to apply the 1.0.4 patch which can be found on the same page.

Download the sourcecode

Some information about assaultcube:
40mb in size
OpenGL
Opensource
No anticheats
No dev enforced builds(epic fail )

Since this game doesnt enforce dev builds, you can just recompile the source, replace the games exe and you're good to go

Other pieces of code:
Shooting through walls
No spread and Recoil(this page)
Aimbot
Teleport the flag to you

Open up headers/weapons.h
The first struct you see when you open that up is the weapons struct.
Have a look at its content.

Ooh what is that?! :O guninfo?!?!
Code:
const struct guninfo &info;
Right click on guninfo and press go to definition, you should now end up in entity.h on the following line:
Code:
struct guninfo { string modelname; short sound, reload, reloadtime, attackdelay, damage, projspeed, part, spread, recoil, magsize, mdl_kick_rot, mdl_kick_back, recoilincrease, recoilbase, maxrecoil, recoilbackfade, pushfactor; bool isauto; };
By counting the items starting at modelname(which is 0) you'd see spread is the 9th item and recoil the 10th item, looking even further towards the end you see recoilincrease etc.

now take a look at the stuff below that line, which is the actual gun info.
Code:
static guninfo guns[NUMGUNS] =
{
    { "knife",      S_KNIFE,      S_NULL,     0,      500,    50,     0,   0,  1,    1,   1,    0,  0,    0,  0,      0,      0,    1,      false },
    { "pistol",     S_PISTOL,     S_RPISTOL,  1400,   170,    19,     0,   0, 80,   10,   8,    6,  5,    1,  40,     75,     150,  1,      false },
    { "shotgun",    S_SHOTGUN,    S_RSHOTGUN, 2400,   1000,   5,      0,   0,  1,   35,   7,    9,  9,    10,  60,    60,    100,  1,      false },
    { "subgun",     S_SUBGUN,     S_RSUBGUN,  1650,   80,     16,     0,   0, 70,   15,   30,   1,  2,    5,  15,     55,     250,  1,      true },
    { "sniper",     S_SNIPER,     S_RSNIPER,  1950,   1500,   85,     0,   0, 60,   50,   5,    4,  4,    10,  70,    70,    100,  1,      false },
    { "assault",    S_ASSAULT,    S_RASSAULT, 2000,   130,    24,     0,   0, 20,   40,   15,   0,  2,    2,  25,     60,     150,  1,      true },
    { "grenade",    S_NULL,       S_NULL,     1000,   650,    200,    20,  6,  1,    1,   1,    3,  1,    0,  0,      0,      0,    3,      false },
    { "pistol",     S_PISTOL,     S_RAKIMBO,  1400,   80,     19,     0,   0, 80,   10,   16,   6,  5,    6,  15,     30,     100,   1,      true },
};
lets edit all recoil and spread related items:
Code:
static guninfo guns[NUMGUNS] =
{
    { "knife",      S_KNIFE,      S_NULL,     0,      500,    50,     0,   0,  0,    0,   1,    0,  0,    0,  0,      0,      0,  0,      false },
    { "pistol",     S_PISTOL,     S_RPISTOL,  1400,   170,    19,     0,   0,  0,    0,   8,    6,  5,    0,  0,      0,      0,  0,      false },
    { "shotgun",    S_SHOTGUN,    S_RSHOTGUN, 2400,   1000,   5,      0,   0,  0,    0,   7,    9,  9,    0,  0,      0,      0,  0,      false },
    { "subgun",     S_SUBGUN,     S_RSUBGUN,  1650,   80,     16,     0,   0,  0,    0,   30,   1,  2,    0,  0,      0,      0,  0,      true },
    { "sniper",     S_SNIPER,     S_RSNIPER,  1950,   1500,   85,     0,   0,  0,    0,   5,    4,  4,    0,  0,      0,      0,  0,      false },
    { "assault",    S_ASSAULT,    S_RASSAULT, 2000,   130,    24,     0,   0,  0,    0,   15,   0,  2,    0,  0,      0,      0,  0,      true },
    { "grenade",    S_NULL,       S_NULL,     1000,   650,    200,    20,  6,  0,    0,   1,    3,  1,    0,  0,      0,      0,  0,      false },
    { "pistol",     S_PISTOL,     S_RAKIMBO,  1400,   80,     19,     0,   0,  0,    0,   16,   6,  5,    0,  0,      0,      0,  0,      true },
};
woot, no more pushback, no recoil, no spread, no visual recoil and spread
#4 · edited 16y ago · 16y ago
Hell_Demon
Hell_Demon
[ASSAULTCUBE] Shoot through walls
Download page
the download is version 1.0.2, you'll need to apply the 1.0.4 patch which can be found on the same page.

Download the sourcecode

Some information about assaultcube:
40mb in size
OpenGL
Opensource
No anticheats
No dev enforced builds(epic fail )

Since this game doesnt enforce dev builds, you can just recompile the source, replace the games exe and you're good to go

Other pieces of code:
Shooting through walls(this page)
No spread and Recoil
Aimbot
Teleport the flag to you

Ever wanted to shoot people on the other side of the wall? or knife the enemy team while you're on the other side of the map? here is your chance

The first things we want to open are headers/weapon.h and game/weapons.cpp
you'll notice the weapon struct has the following line:
Code:
virtual bool attack(vec &targ) = 0;
That means there must be a similar line in weapons.cpp!
so control+f in weapons cpp and type the following:
Code:
attack(vec &targ)
The first one you'll find is grenades::attack, which isn't the one we want at this moment, so search again.
Now you'll find gun::attack.
inside that function find the following:
Code:
attackphysics(from, to);

		hits.setsizenodelete(0);
		raydamage(from, to, owner);
		attackfx(from, to, 0);

		gunwait = info.attackdelay;
		mag--;

		sendshoot(from, to);
Thats the part we want to edit.
We want the bullets to go from where we shot them to our enemy, the way I chose to do it was by distance(closest enemy dies first)
So my new code would be(replaces the old):
Code:
	float tdist=9999999.9; //max distance we want
	int target=-1; // temporary target
	vec newto; // where our new hit location is
	loopv(players)
	{
		if(players[i]==NULL) continue; //if the pointer is not NULL
		if(!isteam(player1->team, players[i]->team) && players[i] != player1 && players[i]->state == CS_ALIVE) // and the team isnt the same, its not pointing to our own player and the enemy is alive
		{
			if(from.distxy(players[i]->o)<tdist) // check if the distance is below the best distance
			{
				tdist=from.distxy(players[i]->o);// if it is save our new distance as best distance
				target=i; // assign our target
			}
		}
	}
	newto = players[target]->o; // the new hit location is our enemys location
	attackphysics(from, newto);// send the attack physics

	hits.setsizenodelete(0);
	raydamage(from, newto, owner); // apply the damage
	attackfx(from, newto, 0); // apply the effects
		
	gunwait = info.attackdelay; // apply the gun wait time
	mag--; // decrease our ammo

	sendshoot(from, newto); // send our shot over to the server
That's it for the guns, now do the same for the knife(knife::attack).

Note that the shotgun works differently because of multiple bullets.
#5 · edited 16y ago · 16y ago
BO
BooYa
Might be a really dumb question but where are these .h and .ccp files located?
#6 · 16y ago
Hell_Demon
Hell_Demon
Not dumb at all, I forgot I had posted the DL link to the game and its source on the other thread. Give me a minute ill correct it
#7 · 16y ago
SC
scriptkiddy
Hey when I try to compile it i get:
This application has failed to start becase zlib1.dll was not found.
#8 · 16y ago
Hell_Demon
Hell_Demon
You can download zlib1.dll here zlib1.dll free download - DLL-files.com

i guess placing it in the system32 folder would work
#9 · 16y ago
ZH
Zhhott
Quote Originally Posted by BooYa View Post
Might be a really dumb question but where are these .h and .ccp files located?
.h = header files
.cpp = source files
#10 · 16y ago
BO
BooYa
Looks good i'll try it out tomorrow since i'm on my laptop. I guess u could change other variables as well like reloadtime, attackdelay, magsize, isauto and maybe even damage tho im not sure about damage since they are all at 0 for some reason

edit: What compiler did u use since i can't right click guninfo with devc++
#11 · edited 16y ago · 16y ago
why06
why06
HD. I just wanted to say I'm going to sticky quite a few of your posts, but it won't be in the way you expect it. just give me sometime to get things together.
#12 · 16y ago
pimpinallovertheworld666
pimpinallovertheworld666
O this is cool...like super bullets for combat arms XD
#13 · 16y ago
pimpinallovertheworld666
pimpinallovertheworld666
dude you should really be a coder for combat arms They need some good hacks...
#14 · 16y ago
Hell_Demon
Hell_Demon
Quote Originally Posted by pimpinallovertheworld666 View Post
dude you should really be a coder for combat arms They need some good hacks...
I don't dare to do that, once those VB ch00bs see C++ hacks are way better then those made with VB ill be flamed or even banned
#15 · 16y ago
Posts 1–15 of 102 · Page 1 of 7
…

Post a Reply

Similar Threads

  • [WEEKLY SHOWCASE] More [ASSAULTCUBE] Hack TutorialsBy Retoxified in C++/C Programming
    6Last post 16y ago
  • Warrock Hack - TutorialBy Dave84311 in WarRock - International Hacks
    667Last post 18y ago
  • Gunz Hack - TutorialBy Dave84311 in General Game Hacking
    12Last post 20y ago
  • Requesting: Hacking TutorialBy AthlaS in Hack Requests
    1Last post 20y ago
  • Hack Tutorial For Invicible HackBy $GHOST$ in WarRock - International Hacks
    23Last post 20y ago

Tags for this Thread

#aimbot#assaultcube#hack#hacks#recoil#remove#shoot#spread#tutorials#walls