Reading And Writing Memory in C++ | Game Hacking Tutorial Part 4
Vložit
- čas přidán 27. 09. 2019
- This video explains how to use static addresses or pointers within your own C++ application.
This methods can be used to manipulate in-game values like health, lives, position etc. by reading and writing memory.
Support the channel:
- www.paypal.com/cgi-bin/webscr...
Discord: / discord
The core methods used are: ReadProcessMemory() and WriteProcessMemory()
Music Used: Pop Cap Game Zuma Deluxe - In Game Music Suite
Code can be found here: pastebin.com/N0ahjU2E
The first time I see this well explained, all the people I've seen who tried to explain this were hard to understand. Really appreciate this, keep the good job!!
Tyvm :) not easy to balance between too much info and cover everything important. Glad to hear when it works out
as someone discovering the power of c++, i must say this language can be quite limitless in the learned hands. Thanks for making these.
u didnt even promised that last video i watched i was like eh this guy wont upload it but what a surprise nice video keep it up man :)
I followed so many tutorials in the past & never got it to work. However this one worked! Thanks you so much. I did it on the zuma that steam has.
Your such a legend for putting code in description! u deserve atleast 85k for the good mic quailty and good explanation
bro you are the real one man, i was looking for this everywhere and you had the solution. thanks bro
Thank you for this wonderful job!
If I were not falling asleep during his speech it would make my day better in next level Cheat Engine usage. I would prefer an in a nutshell version of such tutorials.
First time someone criticising me for going too slow. Guess I could make some shorts ^^
I wanna see how to handle threadstack pointers, I always get them in my game and I can't do anything with them. And your video is really good, well-explained and nice editing. It is sad that you don't have that many subscribers and views, but you definitely will!
Thank you very much :) i'll get to it asap. Will also include some tips how to avoid/filter out those nasty pointers ^^
@@casualgamer1791 Epic!
Gracias por fin un video donde explican bien el código de direcciones dinámicas , in english Thanks finally a video where explain how to make a hack with memory dynamic
I'm sorry for my bad english I'm learning
When he talks and use the character "s", my ears go boom.
thats why i cant listen to his Tutorial .... idk but i am going crazy when im listen to him
:( it should be better in the more recent tutorials. I adjusted some filter
@@casualgamer1791 It's fine, I really like the video.
good. i didnt know what i was doing but good.
Thumbs up for that Borat scene 👍
3:09 -> How do you know the offset to the entrypoint?
How would you add a other pointer and offsets without creating a New CreateThread?
beginner dev here. Moving from python, what advanced c++ concepts should i understand before going into game hacking? do you have some resources to give? because i already know basics of pointers and the beginner c++ stuff (arrays, comparisons etc)
What does this do: PS3.SetMemory(0x000000, new byte[] { 0x80 }); if per example the life function is at 0x003b40 what shoul i change in , new byte [] {}) to have infinite life????
Hello thanks btw and i have a question, is it possible to like:
String GameName;
String Offsets;
String address;
And cin all this ? Like that anyone whos using my program can choide by him self which game he want to use ?
I tried this with an online game and I got the resources in the game but Soon as I spend my resources. The game lost the connection with server. Is there anyway to fix that?
how do i automatically find the title of the game? i heard it is possible right?
i came here to see the api to see how memory works for learning purpose, and not hack a game, but this looks fun thought.
I am confused only on one part. I was able to add all the code, but when it came down to the lines char gameName[] = "..."; DWORD gameBaseAddress(_T(gameName), pID); The builder does not like the use of _T. It says identifier LgameName not identified... I am a little lost here.
If you dont understand the code, it does not help to just copy a code from the Internet. Watch tutorials for the basics.
go to properties> advanced, and then change unicode to multibyte character set
@@SimpleY_ you gotta make sure you have it applied for All configurations, not just the debug one
@@valentin4941 Ok? so explain it to him.. Most useless comment is just to say "I won't tell you, but figure it out yourself".
Pro Please I Need Help, I Try To Inject Asm Code Using WriteProcessMemory But I Can Not I Face Some Problems , actuality I use THis Function In Flutter ,
I Just Need To Good Code With Inject Asm Code Into Specific Address In C++ And I Will Try To Use It In Flutter ???? Please
A really helpful tutorial but I wanna know how would I attach the same said program to a 64 bit process? I cannot seem to find an answer for this on the internet.
Compiler as x64 and use uintptr_t instead of DWORD
@@casualgamer1791 Thanks! It worked. The actual problem was the fact that this specific game has some sort of protection or something, other x64 games got attached instantly.
@@casualgamer1791 When i do this I get an error saying argument of type "uintptr_t*" is incompatible with parameter of type "LPDWORD"
@@casualgamer1791 GetWindowThreadProcessId(hGameWindow, &pID); I get an errir at &
Does this work with android games?
Nice vid! Only thing, for some reason _T gives me an error on this line: DWORD baseAddress = GetModuleBaseAddress(_T(GameName), pid); The error is: Identifier LGameName is undefined. Any idea?
Did you define GameName before that line?
I mean something like string GameName = "test";
@@casualgamer1791 Yes, I have "char gameName[] = "ac_clienet.exe";" in the line before where the error is and I still got the same error, please help! :(
Please make a video about ESP hack in 2D games (CS2D)...
How to do it with double values?
That escalated Quickly. So there isnt a way to avoid restarting the game over and over? Wouldnt it be enough to go back to the main menu? And how did u found the base Adress of the Pointer from last video?
U mean all the restarting when pointer scanning? No the game needs to be restarted. Thats because it has to be completely un- and reloaded into memory. There are other methods to find static pointers but have not made a video about that yet (yoi could google "cheat engine back tracing" or "trace and break")
@@casualgamer1791 thank you, i went further into finding pointer and also recognized that this is the normal behaviour. So inefficient xD
I cant figure out, was this codded for a dll or a commend promt?
Command promt (exernal)
Good video
ty :)
What's your IDE and settings? Doesn't work for me cause of IDE show me some Syntax errors 🙄
VS 2019, multibyte char set i believe
Hey bro. I am trying to use write and read memory so I dont have to use a kernel driver to read/write it. Would this be the right way? Thank you
Only reason to use kernel drivers is to bypass AC. If there is no ac you can use the methods presented in the video
@@casualgamer1791 okay. It was already build for a kernel driver. I got the hack from someone else, its complete. I'm trying to learn coding however, my first step is learning how to implement readprocessmemory into it. Do you have any idea where to start ? Please and thanks
Thank you for this. You need to de-ess the video though! High pitched ssss noises
Can u do some vidoes on dll injection and hooking
i did one on the most basic dll injection method. Yes I will definitely do at least one video dedicated to hooking
error: cast from 'BYTE*' {aka 'unsigned char*'} to 'DWORD' {aka 'long unsigned int'} loses precision [-fpermissive]
19 | dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr;
help pls
how to call gamefuction with external Cheat?
if you already dont have a video on the threadstack pointers then please make it :3
Already done :)
@@casualgamer1791 wonderful. just a problem with this im having.
my
HWND hGameWindow = FindWindow(NULL, "gamename");
gives the error "argument of type "const char *" is incompatible with parameter of type "LPCWSTR"
and
DWORD gameBaseAddress = GetModuleBaseAddress(_T(gameName), pID);
gives "identifier "LgameName" is undefined"
Google "visual studio multi byte character set"
Yeah how do I write it tho if my address has NO pointers.
every address has pointers.
alternative: use a pattern scanner, watch my video "Hacking Terraria in C++ | (2/3) | Internal Signature Scanning" if u need inspiration
@@casualgamer1791 Thanks man got my tool working anyhow but will check it out non the less
i have zeros in all offsets
mine is a awt.dll instead of Zuma.exe do i have to put awt.dll instead?
exactly. The GetModuleBaseAddress function should work for all modules (meaning an exe and a dll)
@@casualgamer1791 it doesnt work for some reason umm im confuzed
Try outputing the adresses to the consol and compare them to those in cheatengine. Its easy to mess up somewhere especially when its the first time
@@casualgamer1791 ive tried a bunch of stuff idk whats wrong :/
@@casualgamer1791 oh actualy leme try that i didnt see that messege
I really wish there was a tutorial to make this work for 64 bit... I compiled my project for 64 bit and changed DWORD to DWORD_PTR but the values equal 0 when I run the console application.
Use uintptr_t for x64 pointers
@@casualgamer1791 thanks for this, I managed to figure it out. So now it shows me the address but as 4 byte. I set everything from dword to uintptr_t, but my application reads out: "2445592896" which in hexadecimal value is "91C4C940" which is partial correct, but that is only showing me 4 bytes of the pointer address, the real 8 byte pointer address is "1F8" then "91C4C940"
so my actual one has 3 digits extra than the one my application is showing
code snipped pls. sounds like you are casting it to a int maybe? int has 4 bytes. Internal or External?
@@casualgamer1791 I finally found out how to do it now, thanks for trying to help, I appreciate it. But now when I get the user to input the value of what they want to change it to, the console application closes, but I don't them to have to open it up everytime they set a value, how do I keep them in the application while letting them change values?
easiest is a while(true){} loop and get user input inside
The program has 8 errors lol
it's not giving me results for some reason, any idea why?
i am getting:
Game base address = 927399936
debugginfo: baseaddress = 0
debugginfo: Value at offset = 0
debugginfo: Value at offset = 0
debugginfo: Value at offset = 0
debugginfo: Value at offset = 0
debugginfo: Value at offset = 0
debugginfo: Value at offset = 0
the pointer i gave and it's offsets were both correct
same here
EDIT: GetLastError() after readprocessmemory() where you assign baseAddress a value errors with error code 299 for me
@@chofsdfrtss which game are you trying to read/write the memory of?
@@deusz8998 Multiple games are the goal, but for the moment I started with cyberpunk. I got the correct pointer for money in the game (I can see when something changes and I can change it myself whenever I want; restarts of the game don't affect that). Actually managed to fix error 299, but now error 12b comes up. Could it be because I am inside a KVM that has HypverV enabled? and if so why does cheat engine work, but not my app?