View Full Version : Basic Aimbot/WallHack in VB/C++
10-09-2004, 02:46 PM
I program fluently in VB and know a little C++ and wish to make an aimbot/wallhack for SoF2. From what I've seen, I can't work out whether aimbots are written in a seperate IDE or in some game scripting language. Is there a tutorial somewhere that would teach me how to make a basic aimbot or wallhack?
Thanks in advance :)
10-09-2004, 03:37 PM
This is basically how aimbots work:
There are two types, graphics-based and engine based.
Graphics-based aimbots rely on using the graphics engines functions to determine what is being drawn. After figuring out that some object X is a player, they use setcursorpos (c++ function) to move the mouse to that object thus producing aimbot action.
Engine-based aimbots use the video games' engine to determine where entities (players, boxes, vehicles, weapons, etc.) are by using sound or other methods. After determining where the player entities are, they also use setcursorpos to move the mouse to the player (or they can do other ways of moving to the enemy, but setcursorpos is common). Since engine-based hacks have access to the games commands themselves, they can also fire for you for example (if you use graphics-based then you have to simulate a key-click to get it to fire).
To do either one you need to know a programming language. It is rarely the case that a hack is written in some game-specific language (but there are exceptions). C++ is the most common. Download a wrapgen to see an example of how a graphics-based wrapper works, and read the tutorials section to get an idea of how opengl-based aimbots function. If you're good enough, you can apply the ideas from all the HL/CS hackers to another game such as SoF2. Do realize however, than it will be much harder to find help for some other game due to the fact that there are far fewer cheat-coders for SOF2 than for HL. Good luck.
Alright, I'm in the same boat as this poster, I can program in english(aka, Visual Basic) along with c++. I don't get the big theory behind creating hacks though. I've read a lot of source, but can't tell why they do what they do. I've deduced that a hook creates an interface for communication to the engine, but what's a wrapper do? Is there a basic tutorial that explains all the outside things of cs hacks, rather than going into the indepth things (I've only found indepth tutorials).
edit: For example, what would all be needed for something as simply as changing your name via engine hooks? Would it be the whole entire library of the engine, or many less files?
10-23-2004, 11:16 AM
wrapper does what it says on the tin.
meaning it wraps each and every function with some user created code which means it more or less redirects each function in the same way as a hook but without hooking as the game calls the particular dll and of course when a game or program is looking for a dll it looks in its own directory first meaning it calls the wrapper first which then calls the dll in question.
hope that answers your question. :D
as for the other question - most of the engine files are linked to each other but you could pare them down to only the required functions but imo thats a waste of precious coding time. im sure someone more fluent in engfunc mechanics would be willing to explain how easy - or how hard - (hard for me but not everyone) it is to implement something like that. :D
gonna go have to read a lot on dlls
since it's most likely an incredibly easy task...think someone could whip up a .zip/.rar of everything including the actual function changing the name? I'm not asking for this because I don't want to learn, and just want it done, I'm asking because I can often learn best from the code, and if I know what parts of the code are REALLY getting done what I want done, that'd be badass.....of course I'll understand though that not everyone is as interested in getting me started as I am....but if you got some freetime, please? Thanks.
edit: Also, this wouldnt be just for me, this would be a great tool for anyone just starting out!
10-23-2004, 06:47 PM
Well if you learn best by reading code, why not just download an existing wrapgen (like wrapgenv2) for an example of how a wrapper works, and download a basehook (like a lot of them) to see how it works?
because im not getting the idea of what the objective is behind the code (as a whole).....does this mean I'm actually wrong in saying that I'm ot good at learning by reading the source? in the past I have been...this is just so different from my regular....
10-24-2004, 10:59 AM
imo if you cant understand that you need to get a book on cpp - thats what i ended up doing - once you get the basics the rest will fall into place. :D
Alright, looks like I gotta brush up on C++, I'm reading an opengl tutorial right now, the NeHe one...good stuff.
10-24-2004, 04:18 PM
yeah as long as you learn from it - the newbs here usually want c&p stuff.
it can be a good place to start tho if you have some grounding in programming. it may not be of use in understanding a wrapper however but its not to hard to learn.
it does sound as if you need to know how a wrapper actually does what it does.
basically for each function that a dll has, for a wrapper to work, it must intercept all calls to the dll. then it must replace each function with its own code each function of which then calls the corresponding function in the dll in question (the original)
game->wrapped function1->orig function1
game looks for function1 in orig dll - but finds a dll of the same name in its own dir so it looks for the same function in that dll first. it finds the function and uses it - this is our wrapped function, but for the game to function it must then call the original function in the original dll.
not 100% sure if it calls the original function first or last but i know this is how it works.
hope this is clear enough.
that makes sense, but why doesnt valve just hardcode it to look in one specific dll file(the one they made)
edit: Or is it a problem with OpenGL, and not Valve?
10-24-2004, 09:56 PM
Because when the game it designed, they didn't think people would be making wrappers like they are (it was a long time ago) so now it can autoload all these new opengl32.dlls and to fix it they would have to rewrite a major portion of the game's code (not worth the trouble).
nubs...(yeah, i'll note the irony in that its me saying that).....man this stuff is so interesting
edit: thanks to everyone who offered help!
Powered by vBulletin® Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.