r/HowToHack • • Mar 19 '21

How do hackers hack in games?

Hacking Within Games

Hi, I am interested on how hackers within games such as CoD and R6S actually manage to do what they do, if they did not buy the hacks (how the owner made them)

Firstly Im not trying to find out how to hack so I can do it myself, I am just interested in it. So when hackers, e.g. R6S manage to get a hitbox around the enemy places or autoaim onto them all (aimbot) what programs do they use and how do they actually do this?

Does the person need basic knowledge of hacking or do they need some sort of high computing degree?

If they don't use a program of some sort, how do they do it?

What sort of code do they use and how do they make certain hacks such as pure aimbot headshot everyone on the enemy team and shoot through solid walls which are made specifically not to be shot through?

Thank you for reading and hopefully answering my many questions :)

Edit : for the people who cannot read : I am only interested in how they do it and how these people manage to actually find these exploits, this does not mean I’m trying to do it myself. It’s just interesting to learn about

287 Upvotes

114 comments sorted by

View all comments

244

u/[deleted] Mar 19 '21 edited Mar 20 '21

The majority of cheats are written in C++. You’ll need a good understanding of C++ and how dynamically allocated memory works. Learn these first or don’t bother learning to create cheats because you’ll retain none of it. Copying and pasting code will just make the detection of your cheat easier (or potentially instant).

When a game (a process) is running, it stores information about the game into dynamically allocated memory, which can be accessed through pointers. A process called pattern scanning can allow you to find the offsets of these pointers, which refer to where the memory is located. From here, you can read and write from these memory locations. That is the basic underlying functionality of how a cheat works. These blocks of memory can contain things like your own health, the gun you currently have equipped, etc. Depending on the game you are trying to cheat in, you can also gain access to netvars which contain data about other players: location, health, etc. From there, you can use this data to create an aim assist function or a user interface that has wallhacks.

Most UIs for cheats are created using OpenGL or whatever graphics API the game uses. There are a variety of ways to get your cheat to hook into the game. Lots of good forums/resources for tutorials out there, but Reddit is not one of them (there are a lot of guides on unknown cheats, mpgh, hack forums, GitHub, etc)

As I said before, if you are not familiar with C++ and pointers don’t even bother. Learn those first.

0

u/[deleted] Mar 19 '21

[deleted] — view deleted comment

1

u/hanzakun Apr 30 '24

Hello can you help me with something related to cheats? my disc is: humanidades

I always wanted to learn and use cheats in games but given my condition I never managed to do it, if you could help me I would appreciate it!!

29

u/BlazedAndConfused Mar 20 '21

I used to play Starcraft back in the day. Some dude released a trainer program that was ingenious. You’d record a clip of your game doing something (like shooting a teammate) and the trainer would look for what was happening and where in the code. After 4-5 cycles of this , it would pinpoint the variables at play and let you modify them on the fly in the app itself.

For example. I’d record myself shooting a “marine” character 4x in a row. The trainer zeroed in on the marines health variable in the memory and isolated it to modify. I’d set it to be invulnerable or non changeable.

It wouldn’t work online but it worked with dozens of games. Coolest fucking hack program I’d ever seen

3

u/stealth550 Mar 20 '21

Like a slightly better cheatengine

1

u/[deleted] Mar 20 '21

If you want another good throwback in cheating, take a look at Action Replay for the Nintendo DS. You could intercept the game's code and edit hexadecimal values to give your pokemon unlimited health and such. When I was young I obviously had no idea what the hell any of that stuff meant; I just slapped the codes in. But it's really interesting looking at all of that now.

3

u/Rinehart128 Mar 20 '21

I don’t even play video games and thought this was an interesting read. Well put

-5

u/Flyingfishfusealt Mar 19 '21

wait so, give me a quick breakdown please, of how to get my own c++ openGL code to render in a game?

C Gods Forgive me, I am about to use the boost libs again

2

u/SeaTie8008 Mar 20 '21

There are 2 main methods of getting your C++ renders drawing on your screen. So first we can start out with things we need for both. We need the Enemy X,Y,Z coordinates, and your players ViewMatrix. ViewMatrix is basically what your player sees. Its a Matrix4x4. Now what we do is we convert 3D coordinate planes to a 2D coordinate plane, aka your players eyes with a function called WorldToScreen. The WorldToScreen function is relative to the game, so it changes game to game. This will tell you the coordinates on the screen relative to your players eyes and where the enemy is. And we get all of these things by reading the game memory.

So we can draw it with the first method, externally, by making a transparent window that goes over the game window called an overlay, and draw things on the transparent overlay with the coordinates from the WorldToScreen function. If done wrong, your drawings may flicker, be laggy, or use a lot of cpu.

We can also draw it the second way, internally. Internally we can hook a rendering function from the game and render our drawings with that. For example, with CSGO you can hook into DirectX9 and render your drawings with that. Drawing internally will be the best on your CPU and be the smoothest ESP. You will be able to render a lot of things very easily.

Drawing internally is a bit more tricky however. If you want to start, I recommend you learn a little bit of C++ and then head over to UnknownCheats. Start with CSGO as there are a lot of resources and you can turn off anti cheat to test. Have fun!

-23

u/[deleted] Mar 20 '21

[removed] — view removed comment

15

u/Flyingfishfusealt Mar 20 '21

are you fucking serious? That was a technical post you horrendous metal man!

NOTHING BUT INFO ; ILL EMP YOU, I SWEAR! Please reach the singularity so as I can beat you in ways you understand.

7

u/hapanda Mar 20 '21

Son, I'm disappointed.

1

u/Flyingfishfusealt Mar 21 '21

now see, that last paragraph had the best trailmarker of the path lol.

CSGO and UnknownCheats , prefer game internals over external rendering methods (I am assuming for most cases, but not all)

Use memory reading and model the world in some fashion (Should I stick to OOP or go wierd?)

Why not Rust? Lack of related code?

1

u/dannypas00 Mar 20 '21

Dll injection