1Ballad (09-03-2011),Anubiset (11-17-2011),BooYa (10-12-2009),giniyat202 (08-14-2011),lalakijilp (10-15-2009),Marsicano (10-18-2009),notcoolatall (10-09-2014),ShadowVL (11-03-2009),why06 (10-12-2009)
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!
Last edited by why06; 04-07-2010 at 08:59 AM. Reason: Lol.
Ah we-a blaze the fyah, make it bun dem!
1Ballad (09-03-2011),Anubiset (11-17-2011),BooYa (10-12-2009),giniyat202 (08-14-2011),lalakijilp (10-15-2009),Marsicano (10-18-2009),notcoolatall (10-09-2014),ShadowVL (11-03-2009),why06 (10-12-2009)
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 }
Last edited by Hell_Demon; 10-12-2009 at 11:02 AM.
Ah we-a blaze the fyah, make it bun dem!
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:
Why would those be 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);
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
to the top(since we want to make use of certain functions from there )Code:#include "bot/bot_util.h"
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 )
Now lets look at a way to get the coordinates of all players.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; }
By looking through alot of these files I found out you can acces all players the following way:
all players have the following members that we're going to use:Code:loopv(players) { players[i]; } }
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) :
now lets start on our target function(point based )Code:int lasttarget = -1; float lastdist = 0.0f;
Now scroll all the way down untill you find 'gl_drawhud', which is where you're going to do the actual targetting.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 }
At the end of gl_drawhud(just before the glMatrixMode(GL_MODELVIEW)) put this code:
You should add your favorite style yourself(for example only aim when right mouse button is down).Code:int tmptarget = GetBestTarget(); float rX, rY; if(tmptarget!=-1) { getyawpitch(player1->o,players[tmptarget]->o,rX,rY); player1->pitch = rY; player1->yaw = rX; }
Step 4
Have fun owning people/bots
Last edited by why06; 10-14-2009 at 05:38 PM.
Ah we-a blaze the fyah, make it bun dem!
Anubiset (11-17-2011)
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?!?!
Right click on guninfo and press go to definition, you should now end up in entity.h on the following line:Code:const struct guninfo &info;
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.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; };
now take a look at the stuff below that line, which is the actual gun info.
lets edit all recoil and spread related items: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 }, };
woot, no more pushback, no recoil, no spread, no visual recoil and spreadCode: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 }, };
Last edited by Hell_Demon; 10-12-2009 at 11:02 AM.
Ah we-a blaze the fyah, make it bun dem!
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:
That means there must be a similar line in weapons.cpp!Code:virtual bool attack(vec &targ) = 0;
so control+f in weapons cpp and type the following:
The first one you'll find is grenades::attack, which isn't the one we want at this moment, so search again.Code:attack(vec &targ)
Now you'll find gun::attack.
inside that function find the following:
Thats the part we want to edit.Code:attackphysics(from, to); hits.setsizenodelete(0); raydamage(from, to, owner); attackfx(from, to, 0); gunwait = info.attackdelay; mag--; sendshoot(from, to);
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):
That's it for the guns, now do the same for the knife(knife::attack).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
Note that the shotgun works differently because of multiple bullets.
Last edited by Hell_Demon; 10-12-2009 at 11:01 AM.
Ah we-a blaze the fyah, make it bun dem!
Akisuzi (04-27-2010),bontenshi7 (01-03-2010),BooYa (10-12-2009),why06 (10-12-2009)
Might be a really dumb question but where are these .h and .ccp files located?
Akisuzi (04-27-2010)
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
Ah we-a blaze the fyah, make it bun dem!
Akisuzi (04-27-2010)
Hey when I try to compile it i get:
This application has failed to start becase zlib1.dll was not found.
Akisuzi (04-27-2010)
You can download zlib1.dll here zlib1.dll free download - DLL-files.com
i guess placing it in the system32 folder would work
Ah we-a blaze the fyah, make it bun dem!
Akisuzi (04-27-2010)
Akisuzi (04-27-2010)
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++
Last edited by BooYa; 10-12-2009 at 03:12 PM.
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.
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
O this is cool...like super bullets for combat arms XD
dude you should really be a coder for combat arms They need some good hacks...