C++ Game Hacking Tutorial Ep.1 | Reading/Writing Memory
Vložit
- čas přidán 16. 07. 2024
- The absolute basics of reading/writing memory in C++.
For those of you who want to make an aimbot, or walhack: This is the place to start. You need to learn to walk before you can run.
ALSO forgot to note: If you are having errors that you don't understand, make sure you go to project / properties / Configuration Properties / General / Character Set. Change it to multi byte.
its been 4 years and im still waiting for the Ep.2 ...
@@R00kTruth well anything really... I’m learning c++ and this is interesting but I would love to see some more tutorials on visual studio code and how to use it better or anything really that has to do with watching someone explain what there doing while writing c++... what about making your own game in c++... What about useing unreal engine to make stuff... unreal engine uses c++ and unity game engine uses C#... I basically just need someone to show me how the code works and how it links together... blender is a free tool that uses c++ and you can make anything you want.. I would like to see some new content..
He Disappeared Like Zer0 Mem0ry CZcams Channel
He has adhd , so he is procastinating
@@myownthoughts969 So hows going,its been almost year.
Any progress?
Keep waiting 😂
This is genuinely great, as a beginner C++ coder (I've used C# before) this is very helpful. It isn't too late to recontinue this series
Hands down, the best tutorial ive watched and extremely beginner friendly, thank you.
OMG, your explanation was so chill and easy to understand, you showed me that this memory-stuff isn't that hard at all
Finally a real tutorial that shows the basics so you are able to understand it. Thanks for doing it =) Im subscribing to hopefully learn more from you
to be honest you are one of the few people who can explain it understandable in a short period of time. I understood it the first time i saw the video :) thumbs up !
Can it need to add readprocessmemory script please reply
@@shreeshind8388 what do you mean ?
@@sunnisun36 can u tell me that u just coded and the code is working know sorry for bad eng.
@@shreeshind8388 to be honest i can`t remember anymore but i am pretty sure. But keep in mind that the address will change every time you restart the game and if you want that it always works you have to find the base pointer with the offsets or just modify the function which is used in the game for counting up and down the gems in the memory.
@@sunnisun36 thank u very much for your comment.
that was awesome. I've been programming for over a decade and never realized how much you can do.
Great video, I spent all day trying to figure out simple way to read/write in C#, then your video easily explaining how to do it in c++ in a few lines.
please make an episode 2, i really loved the vid and learned alot from it. i would appreciate it if there would be a part 2 soon
Omg you explain c++ better than all of my comp sci professors. I would love to see more videos from you. Pls make more.
I was about to say the exact same thing! This is so easy to follow!
Well unless its mario 64 they cant help further hacking
So the less clearly you're able to explain C++, more universities are willing to hire you and give you tenure.
Sorry guys. As much as I love the video and the explanations provided. This is not a C++ tutorial. This could have been made using barebone C.
@@manudelmarche I'd just like to interject for a moment. What you’re referring to as C, is in fact, ISO/IEC 9899:2018, or as I’ve recently taken to calling it, ISO plus IEC. C is not a specified language unto itself, but rather a group of languages sharing similar syntactic structures and rough interoperability on various compilers. Many computer users run a modified version of the ISO system every day, without realizing it. Through a peculiar turn of events, the version of ISO which is widely used today is often called “C”, and many of its users are not aware that it is basically the ISO version, standardized by the International Standards Organization.
Nice, good video for helping people understand memory. I had taken a C++ class before 1 of 2 & I didn't quite understand memory handling but this video helped me understand it a little better. Thanks!
That was one of the best tutorials ive seen so far on youtube, please upload more
This is the first, literally the first tutorial I've seen so far that maybe doesn't straight explain everything but at least leaves *reference* to the stuff one should look into. *Impossible...*
Can it need to add readprocessmemory script please reply
Bro this tutorial IS SO GOOD 10/10, explaining everything perfectly
Can it need to add readprocessmemory script please reply
i watched so mny videos about reading writing memory and your video helped me out a lot :)
You're the first one who did something I could understand.
From a clean coder POV, you could keep all that code on the same indentation block, helps reading and understanding. All those else were unnecessary since you exit in every ifs anyway :)
After those if statements where you check for bad outcomes and exit the application, you don’t need to use “else” for the continuation of the program. If you ended the if block with exit() or return false, the code after that block will only be executed in the else situation. This will save you a lot of indents, makes the code look a lot neater.
Wow.. Thank you. Finally a tutorial that explains everything well.
this is the best gamehacking tutorial, in the middle of 2021 and working normally congratulations for the effort
Man you are great !!!! You explain better than all the books i read... Plz make more videos.
Respect from Greece !
Finally a guy who speaks good english, AND understand how everything works! Kudos for this bro! Didn't learn anything new, but leaving my fotprint here anyway. Good job, more tuts would be nice! Maybe looking for base addresses and pointers? seen so many people don't understanding what it is, and why dynamic is not static etc.
xabo True
Usually, people who speak jaded English are more intelligent because they know more than just one language. And this is coming from someone who only speaks one language, though I am trying to learn Japanese. So give them more benefit of the doubt.
Wait wut? "people who speak jaded English are more intelligent because they know more than just one language" ? Jaded as in: "Bored or lacking enthusiasm, typically after having had too much of something"? Or does it mean something I can't find a dictionary for?
...maybe "jagged English" or "broken English" is what you were looking for.
I know some polyglots are smarter from personal experience, but being able to speak two languages badly isn't hard, and a lot of people do. Most people from around the world are passable in their own language and bad English. The only problem is when you're own language is bad English...
libumMendaciumEst most of the videos related to computer programming I have watched have from content creators from India or China. I wouldn't call it broken English, because they are fluent for the most part. Hence why I called it jaded English. Their content typically is hard to understand due to their delivery or it is very bland. But hey man, thanks for trying to take a Jab at me because you assumed that I am bad at English... "Wait wut" ;)
I'm not making any assumption about you being bad at English: "Jaded" doesn't have that definition in English, it's pretty solid proof :)
Also "Wait wut" wasn't the jab, is was however the last line: "The only problem is when you're own language is bad English"
...upon which I which to pontificate: Fairest of beasts Kyle Martin, be you so damned by the coarseness of your tongue? Eloquence like mine, from which you are denied, comes freely to me. Don't covet what you have not, but rejoice in your own language: Bad English.
I might be coming off as an arsehole, but I'm sobern't. Before I go, take this czcams.com/video/DamuE8TM3xo/video.html
it will give you the knowledge of C++, with the power of brilliant English forged in a soothing tone.
And this is to help you learn japanese: czcams.com/video/OFQQALduhzA/video.html
At 11:20 - that's some of the realest sh*t I've heard all day. It drives me mad when people just start copying & pasting code and then throwing a fit in the comments section complaining that it doesn't work. Thank you for exercising the whole "write it yourself" thing, I agree 100%.
When I was learning C, I copy-pasted SECTIONS of code from others, then re-named variables, and modified some fine details, and I was learning a LOT. I also do it when I'm learning a new library, and it helps a lot to understand new concepts.
Can't stress this enough.
Amen, it's also poor practice, as just memorizing code doesn't help people learn 'why' or 'how' the code works.
No, thats exactly how you learn how and why...
i copy paste code all the time. I get bored easy so typing is boring. I'd rather cut right into the meat and break the code apart testing each line, & play around with the code -then wasting time typing it all out.
Wow thank you so much for taking the time to share this, amazing practical example of C++
I learned a bit but this is more than enough for my coding journey, thanks a lot man
Triggered by that misspelled '==' :)
Luckily, in this case it only affects the branch that shouldn't be taken.
VioletGiraffe that’s why I always compile with -Wall -Wextra -pedantic
Lol i saw that and thinked the same
Damm where are his videos
Last ones 1 year ago
Hes dead
@@coprice94 don't be spreading false info man.
@@mryup6100 I'm not man
Man, Please Do More Tutorials!!! I learn more from you in 15 minutes than 2 hours of trying to understand what pro coders write on forums
thank you. i've been studying c++ for about 4 months now & wanted to get into game hacking, so thank you.
cmon dude wheres the part 2 :(
Please can you upload more? I actually understand from you :o
Sn6 lol salty
@Snn lmao
Can it need to add readprocessmemory script please reply
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
my love for c++ was ignited again , the hate is gone, love this video , tnx. I know it's from few years back but damn ... so well made.
That's neat! I avoid hardcoding a pointer, but it works ;) Dude, you need more videos like this. Seriously!
Awesome tutorial :D are these mx blue switches? I love their sound :D
THIS IS AMAZING!
Please make more, you explain it really well.. Make more c++ tutorials like this one, we beg you !!
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Im trying to learn c++ and you are honestly very good at teaching thank you for this
people that sound like they wanna die are my favourite type of people
THE GOVERNMENT would like to know your location
They already do
Alakazam ✨✨✨✨✨✨
Damn, you explained that shit well. I'm trying to get into C++, (currently learning javascript as a part of my computer science class in junior year of high school), and this tutorial was extremely easy to follow, especially given the fact that I had never even touch C++ before watching it.
I must agree with the comment someone left about finally someone that speaks english with no terrible foreign accent. Good Job, keep up the work. I have a bunch off apps no my phone that intend to teach all kind of languages for pc / scripting but I hardly have the time at the moment to brush through them.
if (procID == NULL) with two = not one at line 24
My ocd was bangin on the door from that. How didn't he notice it ahahaha
@@FabianKristoff its stuff you most ironically start missing more often when you already have had some experience and you just sorta code 'less consciously' in a way
What weirds me out is that it seems to compile and run fine lol
how would you do it if the address had an offset
You might as well just google the base address, see if someone already found it. Otherwise cheat engine can also help with that.
Thanks for making this video man, i'd love to see more from you,
this is the tutorial i was looking for for a long time thanks a lot
nice video, you have a small mistype where it says
'if (procID = NULL)'
rather than
' if (procID == NULL)'
ya, wouldn't the compiler throw up an error at you for that?
It's not strictly a syntax error, more of a logic error. You can assign values in if statement conditions
BJJOORRNN1 no it would just assign the value
Shaun Dreclin hey I got a question, so if the value I got from cheat engine is a string, what type of code do I write?
That's why it's a good practice to have rvalue on the left side in "if" statements. For example "if (nullptr = procID)". In this case, you will get an error.
dude, when's ep 2 coming?
this video was uploaded in 2016 :) so there will be no ep.2
actually you're right. didn't see that.
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
THANK YOU!!! You make it so understandable, subbed!!
2:42 Lol, no, that's actually ok xD i actually love it
Johnny_GR sweat 😂
if we open cheat engine with any mmorg f the game guard will detect it and close it, so how can we find any adress ? how can we bypass it ? nice vid dude and sry for my english
Write your own memory process scanner. Search "C memory scanner" on youtube and youll see what I mean.
EnduranceT thanks dude i will try it out
Maybe the memory you are trying to access in not in the stack or heap so you cannot directly change it using c++, however windows api allows you to access the game directly and all the memory its using(It's my opinion i don't know for sure, please do correct me if i'm wrong).
I want to make a wallhack for dead by daylight but i dont have any clue where and how to start. Can you maybe help with tips etc?
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Nice video! You could omit the "else" clauses after the error checking, because you always return in the "if" before. That would make the code much more linear and easy to follow.
Dude, you're amazing. I love your video! If you do stuff like coding and stuff, totally subscribing!
More, more, more. Next == Pattern Scanning, Offsets, writing things like float, 4 byte, byte and string.
you forgot bitwise operators . But yes ( Pattern Scanning, Offsets, writing things like float, 4 byte, byte and string.)
*I like your C++ skills its worth it i know C++ too*
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Very well explained video, great job!
One Of The Best Videos I Have Ever Seen
How do i Find the adress?
¯\_(ツ)_/¯
scan for it in cheat engine, but i wouldn't recommend just writing to the address as if it's static - it's most likely dynamic, as soon as you close the game the address will change. Do a pointer scan for the address with a pointer depth of 1 so that the results are just (Module + offset1) + offset2. Then read the contents of (Module + offset1) which will be a pointer, then write to the pointer + offset2. This way you don't have to worry about updating the addresses every time.
For C++ development, I recommend JetBrains CLion over Microsoft Visual Studio. Much better IDE in my opinion
VS is better
@@__3093 no its not
Hi man! Nice videos. Just what I needed, I am learning a lot from you!. BTW, as I studied this , one little classic typo I noticed on line 21. Namely, as I understand, procID from that moment will be NULL due single equation symbol witch becomes assignment instead of checking equality (as in line 9), and this if will be never true even if procID is NULL. Also, I think the handle should be set up after you make sure that procID is not NULL.
Best of luck and thanks for your stuff!
Please continue the series, fuck, I need it. You explain everything so fucking well.
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Why use else after an if statement with exit() in it?
Thank you! That redundancy is a pet peeve of mine. Drives me nuts.
Coz need app. The exit buttom xD
wat
Because that if statement only exists to check for an error that is necessary to get out of the way for the rest of the program to work. If the window it needs isn't found, it quits. Otherwise, it does its job.
@Zeyo, you don’t understand his point. If an if block ends with exit(), all the code after this block will only run in the “else” situation anyway. If you skip the else statement, you don’t have to go 5 indents deep which makes the code complicated to read.
several things:
> after exiting the program in the first if-statement you don't need the else-one.
> GetWindowThreadProcessId(hwnd, &procID); is not passing the variable by reference but rather passing a copy of the address of "procID"
> Initializing "handle" with an initializer list would be more efficient than initializing it as null and then assign the value of "OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID)" to it
> the else-branch after the above point is again unnecessary
> again &newValue doesn't tell the compiler to pass in a reference, but rather passes in the address of "newValue"
> all variables should be initialized with their value instead of initializing them and then assigning a value ("int readTest {0};" is superior to "int readTest = 0;")
> exit(-1); is not good either. return EXIT_FAILURE; would be better.
But wouldn't all variables that are initialized and then immediately assigned a value in code actually just get initialized already with its value when compiled? That's one of (the many) optimizations that are standard on modern compilers.
wow such pedantry for someone who thinks that ahahah wtf
the industry expert over here
Absoulutely AMAZING Video. I Learned How To Make A Trainer In C++ JUST BECAUSE OF YOU! ☺ You Are Truly Amazing.
I’m new to computer science and watching what I’m eventually going to learn about makes me so excited
yeah 😃
You do this
{
}
I do this {
}
thats ma man
{
}
is more readable
not if your code is more than 500 lines
yeah, i tend to make the } at the same column as the corresponding { .
Its indeed more readable that way, especially if the { } are nested.
ma man
Thanks you very much for all your videos you can't imagine how these videos help me a lot just keep doing a very good job.
My friends, please search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
czcams.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
great stuff. just a few hints:
- unlike return values, exit codes are usually positive
- there is no need for an "else" if your "if" exits the program anyways
- sizeof int and float is usually the same (4 bytes). it has nothing to do with the actual types. you could actually just put 4 on most systems.
Really nice tutorial, i like the way you explain the code.
i hope you make more.
2 month ago i watched your vid and i really liked it even though i didn't understand anything in the code and i didn't think i would be able to do anything like it
now i'm learning C++ i'm learning classes & and objects now
and i understand your code (not all of it but i got the idea and that's amazing ) now i could do stuff like that
and i was wondering if C++ had a sleep or a wait function or i would have to build one thanx to you I won't have to wait to learn about it
really loved your video if you didn't get that form my crazy talk
(btw i didn't start right a way to learn C++ it took me a long time to actually start ( and by a long time i mean 1 month give or take :D))
Thank you for this wonderful job !!!
It's been very useful !!
Great and simple tutorial! Thanks so much!
Great easy to understand video! Keep it up! :D
Thanks a lot man, you have no idea how much you helped me
i hate to bump this old vid but i sure would love a part 2 of everything
Awesome tutorial , i now know how to get process. Thank you !!
Thanks! CPP is all I learned in College. Took the web class before even CSS existed!
Understandable. Quite clear explanation.
One question: the address you had was a fixed value. Doesn't this change with every program start? And is there something like an address offset that tells you how far the value (or coins or whatever) is away from the start of the program, or does that change too every time?
Hello,
Found your video and its pretty cool, thanks for making it.
That's brilliant.
Thanks for the tutorial.
This is very nice! I have experience on PS3 but none on windows and this definitely helped. I'd really want to know how to run a thread from inside the process though, not write from external, so I gotta find a video on that now.
I wouldn't detect if a game or program is running via it's program title. Some games or programs have window titles that are constantly changing, like DOSBox for example. Just detect if the process itself is running via its process name as that will never change. In the event the process is not available, you should do a loop and keep checking so that way we can run the game/program at another time and the trainer will pick it up whenever you decide to open the game/program.
I learned so much from you here everyone else sucks
Wow i love you man, thanks for the tutorial.
Awesome! i wish you would have continued the series
Man u got mu subscribe! Really Nice vídeo!!
i like that keyboard sound its what every tutorial is missing
WoW. Amazing tutorial. Thx a lot!
Thx dude...something new learned
Subscribed too❤
heymurder, you are not coming back? we need you back here.
and this explanation of win32 and all was really good
Holy fuk that was awesome.. I am learning c++ and had no idea you could do cool shyt like this.
Nice one and maybe you should do one talking about How to make it Vac Secure or explain more about Vac search pattern and stuff
Vac scans signatures. In order to make it Vac secure you need to create your own memory class. Go onto a website like guided hacking and they explain a lot of things and go further into detail then this video.
lol if you wrote it yourself and dont have it named "...cheat..." then you will be good.
Will there be an episode two? Really interested, good tutorial!
Thanks. Easy to follow tutorial
Cool video :) - However, shouldnd you check the procID before getting the handle for it? (put the handle getter below the procID check) :P
While I don't like cheaters or people who use their knowledge for those kind of things, I do find your tutorial helpful for people getting into reading and writing memory.
Fun fact, started CS50 with edX and this makes so much sense now.
You are a fucking legend you explain every single thing so much better than others
Neat tutorial. I've got extensive C++ knowledge but I've never even bothered thinking about using it to cheat. Interesting idea.
Now I know everyone's shown you that 'procID = NULL' error, but I've got a couple of questions/comments with this code:
1. Why exit(-1) and not just return(1)? My background in C++ says it's generally not good practice to not finish with return statements. Why a syscall? Any specific reason?
2. Not really a question per say, but you don't need those else statements. The if statements will exit upon exit(-1), so you can just write code below them normally. Just a head's up.
Sorry for being late to the party, but how would you handle a game where your target value/s can change memory locations between game runs? It would not be practical to use cheat engine to find the address each time and hard-code it (especially for an online game), so how might you go about finding the address algorithmically?