[HELP] Hacking with C++....

Posts 1–15 of 25 · Page 1 of 2
[HELP] Hacking with C++....
Alright so i'm in gr11 right now, and i took a computer science class last semester on flash and actionscript 3.0 so I have a basic understanding of programming and how it works. I've also been reading up on a bunch of tutorials and i understand the basics of C++ now as well.

then I found out about cheat engine and finding addresses, and then i heard about assembly, which i still dont even understand.... im assuming its like the code part of cheat engine. ANYWHO i did the cheat engine tutorial and ended up injecting C code that they gave me into cheat engine, in order to make a hack. The only problem was that i dont know C, so i didnt quite understand how they did it. All i gathered was that they typed a bunch of crap and randomly threw the address we were using in there :x

basically what im trying to say is I know how to find addresses, i know how to find pointers, and i understand basic C++. What i dont know is how to use addresses, pointers, or hack in general with C++. >.>

this could be in the wrong section... could you kindly move it if it is? :}

any assistance would be appreciated. I heart you.

EDIT: I also heard about something called the WriteProcessMemory function or something. I believe u needed to know the buffer, address, bytes, and something else.... but if anyone knows how to explain the function's use thatd be great :} thank ya.
At first I thought you sounded a lot like my first post here, then I thought you sounded a lot not like my first post here. You had me right up to the point you said "i understand basic C++. What i dont know is..." and what you listed are somethings you should know if you know the basics.

Well let's see where to start. Gamehacking "in general" is almost completely about pointers. The reason is everything in a game is in memory. You said your familiar with flash. Flash games too store data in memory. It's the reason you see people get those ridiculously highscores. They found what pointed to the right address and Bingo! Anyway what you need to learn depends on what you want to hack. Whatever your planning on hacking start now and start learning C++. They more C you learn the better. C++ has direct access to memory. Since game hacking involves manipulating memory the two go hand in hand. There are tutorials for scanning addresses, etc. GameHacking can be ridiculously easy and extraordinarily hard depending on what your hacking.

If you have specific questions you'll have to ask them, but that's the just of it. You had some questions about pointers and addresses?
Quote Originally Posted by why06 View Post
At first I thought you sounded a lot like my first post here, then I thought you sounded a lot not like my first post here. You had me right up to the point you said "i understand basic C++. What i dont know is..." and what you listed are somethings you should know if you know the basics.
Sorry bout that :x What i meant by basics was basic syntax required to make programs like.... a calculator or a tax calculator or something like that. Maybe something a liiiittle more advanced but because I havent gotten to the point where i know how to take images and manipulate them with code i cant exactly make a GUI or anything yet :S

I do understand what addresses and pointers are, as well as the fact that everything is made with memory. Im just not sure how take the addresses and insert them into my code. when i insert it would i make a variable and somehow assign it the address? and then i assume the value of the address would be the value of that variable... and i could work with that. I totally just rambled off and im probably wrong and missed something incredibly obvious and important.

Sooooooooooo if you'd like to keep trying to steer me in the right direction that'd be nice :x

sorry to bother you btw... Im not a big fan of asking for help >.>
the only time i asked for help in the last year of trying to learn this stuff was from google. And even the almightly google doesnt know exactly what my question is.

thanks again
Quote Originally Posted by why06 View Post
At first I thought you sounded a lot like my first post here, then I thought you sounded a lot not like my first post here. You had me right up to the point you said "i understand basic C++. What i dont know is..." and what you listed are somethings you should know if you know the basics.

Well let's see where to start. Gamehacking "in general" is almost completely about pointers. The reason is everything in a game is in memory. You said your familiar with flash. Flash games too store data in memory. It's the reason you see people get those ridiculously highscores. They found what pointed to the right address and Bingo! Anyway what you need to learn depends on what you want to hack. Whatever your planning on hacking start now and start learning C++. They more C you learn the better. C++ has direct access to memory. Since game hacking involves manipulating memory the two go hand in hand. There are tutorials for scanning addresses, etc. GameHacking can be ridiculously easy and extraordinarily hard depending on what your hacking.

If you have specific questions you'll have to ask them, but that's the just of it. You had some questions about pointers and addresses?
great speech about pointers but i think you should have mentioned Windows API in there somewhere, unless the game has absolutely no protection its not likely you can only use pointers to make a game cheat. other than that i totally agree with you
Quote Originally Posted by Astral Witch View Post
great speech about pointers but i think you should have mentioned Windows API in there somewhere, unless the game has absolutely no protection its not likely you can only use pointers to make a game cheat. other than that i totally agree with you
Ya lost me. Windows API? I just shit a brick, ive never even heard of that before.
okay sooo excuse my ADD, but from what wikipedia told me i gathered that it's like... tools that the windows operating system gives you to be used in programs... so maybe if u used #include <some kinda windows API>? something like <iostream> maybe? :x...

then i read what astral said about how its used to avoid detection, and now im lost again thanks for trying whit x_x
Quote Originally Posted by mookamoka3 View Post
okay sooo excuse my ADD, but from what wikipedia told me i gathered that it's like... tools that the windows operating system gives you to be used in programs... so maybe if u used #include <some kinda windows API>? something like <iostream> maybe? :x...

then i read what astral said about how its used to avoid detection, and now im lost again thanks for trying whit x_x
Win API is in windows.h ( #include <windows.h> ).
Let's keep it simple. Okay Pointers. I'll give you a start, but its a lot to cover so I won't be able to teach you it all in this post, but I'll give a quick summary. Every variable stores it's value in memory. You know RAM. So because of that every variable is essentially that location in memory. When the compiler compiles code it does not use names to refer to variables as we do, it uses Addresses. Each variable has a location in memory, an address. The value the variable stores is at that address space. Does it make sense then that a variable is only made up concept. It exists in code, but once its compiled that variable only consists of a location and data stored in that location.

That's the general description. To hack you'll have to figure out how that data is stored and how to access the address the data is stored at. It's not necessary to learn C++ to use memory searchers, but you will want to use it because memory searchers and other tools are limited. Maybe at first you'll want to learn just enough to code a trainer, but eventually you'll need a thorough understanding of the language as you get more adventurous.
Quote Originally Posted by why06 View Post
Let's keep it simple. Okay Pointers. I'll give you a start, but its a lot to cover so I won't be able to teach you it all in this post, but I'll give a quick summary. Every variable stores it's value in memory. You know RAM. So because of that every variable is essentially that location in memory. When the compiler compiles code it does not use names to refer to variables as we do, it uses Addresses. Each variable has a location in memory, an address. The value the variable stores is at that address space. Does it make sense then that a variable is only made up concept. It exists in code, but once its compiled that variable only consists of a location and data stored in that location.

That's the general description. To hack you'll have to figure out how that data is stored and how to access the address the data is stored at. It's not necessary to learn C++ to use memory searchers, but you will want to use it because memory searchers and other tools are limited. Maybe at first you'll want to learn just enough to code a trainer, but eventually you'll need a thorough understanding of the language as you get more adventurous.
So just to make sure i understand:

-a variable is essentially an address itself?

-when declared, that variable is "saving a spot in the memory".. thats the best way for me to put it.

-that spot has an address

-and when a value is assigned, it is giving that "spot" or address, a value

is that correct?

and where do the pointers come in? would a pointer be what "points" the variable to that address... or value to that variable?... or am i totally missing the point hurr :x

thanks for your help.. sorry again for all the stupid questions.

thank you for the windows API help btw, i wasnt too far off


EDIT: so wait.. that means that when cheat engine has a button that says "what accesses this address" and it gives you a line of code (which i assumed was assembly) in order to find the pointer, it's actually doing all the hacking for you? you just have to tamper with the address/pointer to actually make use of the address?....
Quote Originally Posted by why06 View Post
Let's keep it simple. Okay Pointers. I'll give you a start, but its a lot to cover so I won't be able to teach you it all in this post, but I'll give a quick summary. Every variable stores it's value in memory. You know RAM. So because of that every variable is essentially that location in memory. When the compiler compiles code it does not use names to refer to variables as we do, it uses Addresses. Each variable has a location in memory, an address. The value the variable stores is at that address space. Does it make sense then that a variable is only made up concept. It exists in code, but once its compiled that variable only consists of a location and data stored in that location.

That's the general description. To hack you'll have to figure out how that data is stored and how to access the address the data is stored at. It's not necessary to learn C++ to use memory searchers, but you will want to use it because memory searchers and other tools are limited. Maybe at first you'll want to learn just enough to code a trainer, but eventually you'll need a thorough understanding of the language as you get more adventurous.

dont get me wrong, i agree that pointers are a necessity, but if you plan to make cheats on the windows platform you will need to understand how some of the shit works under the hood. you won't be able to get direct memory access if you don't have your own module inside the target, so right off the bat you need some windows api to get to the point where you can use pointers to access another process's memory.

more importantly, if he plans on going further with game hacking and/or reverse engineering, he will most likely run into some sort of problem revolving around the windows platform. for example, if he wants to unpack some virtualized code, he will be dealing with the PE. if he wants to start making some more advanced hacks besides simple memory editing, like replacing/detouring a function, he will most likely be dealing with breakpoints & exception handling or a simple detour by changing some bytes around. and if he wants to go even further and completely destroy whatever protection the game uses he could go into drivers and remove/set system wide hooks that the protection software is using.

disregarding everything i just said, if hes on the windows platform and is a programmer, he will eventually get to the point where he wants to make something other than a console using only standard functions.

but yes, pointers are very important.

EDIT: when youre using that function that cheat engine gives you, im assuming it sets a breakpoint on that address, when its accessed, it breaks, gets handled by an exception handler and return the address that tried accessing it.

PS: setting breakpoints and an exception handler requires Windows API if youre on windows
-a variable is essentially an address itself?
This is about right, variables are their information. for instance if you had a variable called height and assigned it three feet. We would say height is 3 feet not height is location 0x0043BF92. that's why I say a variable is both its location and a value stored at said location because in C++ (or any language.. Flash for instance)the physical location doesn't matter all that matters is the value stored there to the programmer coding it. He has names by which to reference it by, but to the computer the name of that variable is replaced by an address location.

-when declared, that variable is "saving a spot in the memory"
Again pretty much. There's technically exceptions to this, but they're not important at this point, plus you'll need to know specifics of how code is compiled to understand, but for general memory scanning I'd say this is correct 90% of the time.

-that spot has an address
Exactly!

-and when a value is assigned, it is giving that "spot" or address, a value
Again there's always exceptions, but that's 90% correct.


and where do the pointers come in? would a pointer be what "points" the variable to that address... or value to that variable?... or am i totally missing the point hurr :x


Pointers are like variables that store the addresses of other variables. So their value is an address. Hince why they are called pointers.


@Astral: Yes I know. Things quickly become very technical. C++ is immensely important I was only trying to explain the basic most elementary concept first.

Naturally mooka if you plan on hacking games on Windows in-depth you'll need to understand windows. That includes Windows API, Graphics libraries like DirectX, Virtual Memory, Threads, Dynamic Libraries, Flat Memory, etc., etc. The list goes on forever depending how far you want to go, but using some tools you already have and a basic understanding it is already possible to do a lot.
Quote Originally Posted by why06 View Post
-a variable is essentially an address itself?
This is about right, variables are their information. for instance if you had a variable called height and assigned it three feet. We would say height is 3 feet not height is location 0x0043BF92. that's why I say a variable is both its location and a value stored at said location because in C++ (or any language.. Flash for instance)the physical location doesn't matter all that matters is the value stored there to the programmer coding it. He has names by which to reference it by, but to the computer the name of that variable is replaced by an address location.

-when declared, that variable is "saving a spot in the memory"
Again pretty much. There's technically exceptions to this, but they're not important at this point, plus you'll need to know specifics of how code is compiled to understand, but for general memory scanning I'd say this is correct 90% of the time.

-that spot has an address
Exactly!

-and when a value is assigned, it is giving that "spot" or address, a value
Again there's always exceptions, but that's 90% correct.


and where do the pointers come in? would a pointer be what "points" the variable to that address... or value to that variable?... or am i totally missing the point hurr :x


Pointers are like variables that store the addresses of other variables. So their value is an address. Hince why they are called pointers.


@Astral: Yes I know. Things quickly become very technical. C++ is immensely important I was only trying to explain the basic most elementary concept first.

Naturally mooka if you plan on hacking games on Windows in-depth you'll need to understand windows. That includes Windows API, Graphics libraries like DirectX, Virtual Memory, Threads, Dynamic Libraries, Flat Memory, etc., etc. The list goes on forever depending how far you want to go, but using some tools you already have and a basic understanding it is already possible to do a lot.
Alright thanks youre a big help. Hopefully if I continue to learn more C++ ill get to the point where i actually need the windows API and stuff... in which case im gunna have to ask you to point me to an online tutorial or somethin

your help is appreciated... always have liked this community.
okay so im back with another stupid question :}

I decided to rediculously commit myself to reading the 1900 page book using visual studio 2010 that someone posted, and the vocabulary is like... over the head of a 16 year old.

soooo its prob not the best book for me, but it IS in depth.. so i think it's best if i plan on doing any hacking.

question is pretty simple. Could someone explain what a library is as simply as possible?
in flash it was where objects (pictures and such) were kept. I have a feeling it doesnt mean the same thing in C++.

thank ya.
Quote Originally Posted by mookamoka3 View Post
okay so im back with another stupid question :}

I decided to rediculously commit myself to reading the 1900 page book using visual studio 2010 that someone posted, and the vocabulary is like... over the head of a 16 year old.

soooo its prob not the best book for me, but it IS in depth.. so i think it's best if i plan on doing any hacking.

question is pretty simple. Could someone explain what a library is as simply as possible?
in flash it was where objects (pictures and such) were kept. I have a feeling it doesnt mean the same thing in C++.

thank ya.
A library in C++ is basicly the same as a dynamic link library(dll), but without the dynamic loading part, You link it with your program at compile time instead of using LoadLibrary at runtime.
Posts 1–15 of 25 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Talk with us