Reading And Writing Memory in C++ | Game Hacking Tutorial Part 4

Sdílet
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

Komentáře • 130

  • @raphiell
    @raphiell Před 4 lety +5

    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!!

    • @casualgamer1791
      @casualgamer1791  Před 4 lety +2

      Tyvm :) not easy to balance between too much info and cover everything important. Glad to hear when it works out

  • @MadpolygonDEV
    @MadpolygonDEV Před 2 lety +10

    as someone discovering the power of c++, i must say this language can be quite limitless in the learned hands. Thanks for making these.

  • @saiko492
    @saiko492 Před 4 lety +5

    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 :)

  • @ai_coding
    @ai_coding Před rokem

    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.

  • @FrivckIt
    @FrivckIt Před rokem

    Your such a legend for putting code in description! u deserve atleast 85k for the good mic quailty and good explanation

  • @Mog-Ops
    @Mog-Ops Před 2 lety

    bro you are the real one man, i was looking for this everywhere and you had the solution. thanks bro

  • @marcus8619
    @marcus8619 Před 3 lety +3

    Thank you for this wonderful job!

  • @Tibor0803
    @Tibor0803 Před 3 lety

    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.

    • @casualgamer1791
      @casualgamer1791  Před 3 lety

      First time someone criticising me for going too slow. Guess I could make some shorts ^^

  • @alieeeeennnnnn
    @alieeeeennnnnn Před 4 lety +2

    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!

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      Thank you very much :) i'll get to it asap. Will also include some tips how to avoid/filter out those nasty pointers ^^

    • @alieeeeennnnnn
      @alieeeeennnnnn Před 4 lety

      @@casualgamer1791 Epic!

  • @bionix7580
    @bionix7580 Před rokem

    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

    • @bionix7580
      @bionix7580 Před rokem

      I'm sorry for my bad english I'm learning

  • @lucaslindgren3237
    @lucaslindgren3237 Před 3 lety +23

    When he talks and use the character "s", my ears go boom.

    • @sheoxger7083
      @sheoxger7083 Před 3 lety

      thats why i cant listen to his Tutorial .... idk but i am going crazy when im listen to him

    • @casualgamer1791
      @casualgamer1791  Před 3 lety +1

      :( it should be better in the more recent tutorials. I adjusted some filter

    • @lucaslindgren3237
      @lucaslindgren3237 Před 3 lety

      @@casualgamer1791 It's fine, I really like the video.

  • @chese2347
    @chese2347 Před 3 lety +1

    good. i didnt know what i was doing but good.

  • @tortotifa5287
    @tortotifa5287 Před 4 lety +1

    Thumbs up for that Borat scene 👍

  • @Andeiih
    @Andeiih Před 2 lety +1

    3:09 -> How do you know the offset to the entrypoint?

  • @codyrichard8053
    @codyrichard8053 Před 2 lety

    How would you add a other pointer and offsets without creating a New CreateThread?

  • @metalius9787
    @metalius9787 Před rokem

    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)

  • @lopo8000
    @lopo8000 Před 3 lety

    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????

  • @Linus-12345
    @Linus-12345 Před rokem

    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 ?

  • @karunanayakaeranda4218

    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?

  • @thedestroyer5234
    @thedestroyer5234 Před rokem

    how do i automatically find the title of the game? i heard it is possible right?

  • @coding9646
    @coding9646 Před 3 lety

    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.

  • @nicolascote8406
    @nicolascote8406 Před 4 lety +6

    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.

    • @valentin4941
      @valentin4941 Před 4 lety +2

      If you dont understand the code, it does not help to just copy a code from the Internet. Watch tutorials for the basics.

    • @anontmon8261
      @anontmon8261 Před 4 lety +6

      go to properties> advanced, and then change unicode to multibyte character set

    • @Mog-Ops
      @Mog-Ops Před 2 lety

      @@SimpleY_ you gotta make sure you have it applied for All configurations, not just the debug one

    • @blocksource4192
      @blocksource4192 Před rokem +1

      @@valentin4941 Ok? so explain it to him.. Most useless comment is just to say "I won't tell you, but figure it out yourself".

  • @ahmedgames9335
    @ahmedgames9335 Před rokem

    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

  • @aligamerable
    @aligamerable Před 3 lety +1

    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.

    • @casualgamer1791
      @casualgamer1791  Před 3 lety

      Compiler as x64 and use uintptr_t instead of DWORD

    • @aligamerable
      @aligamerable Před 3 lety

      @@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.

    • @CodeError
      @CodeError Před 2 lety

      @@casualgamer1791 When i do this I get an error saying argument of type "uintptr_t*" is incompatible with parameter of type "LPDWORD"

    • @CodeError
      @CodeError Před 2 lety

      @@casualgamer1791 GetWindowThreadProcessId(hGameWindow, &pID); I get an errir at &

  • @noobslayer3288
    @noobslayer3288 Před 3 lety +1

    Does this work with android games?

  • @patrickwildschut5750
    @patrickwildschut5750 Před 4 lety +3

    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?

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      Did you define GameName before that line?

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      I mean something like string GameName = "test";

    • @SimpleY_
      @SimpleY_ Před 3 lety +1

      @@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! :(

  • @yayane7716
    @yayane7716 Před 2 lety +1

    Please make a video about ESP hack in 2D games (CS2D)...

  • @VORP125
    @VORP125 Před rokem

    How to do it with double values?

  • @VindicatorMorty
    @VindicatorMorty Před 4 lety

    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?

    • @casualgamer1791
      @casualgamer1791  Před 4 lety +1

      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")

    • @VindicatorMorty
      @VindicatorMorty Před 4 lety

      @@casualgamer1791 thank you, i went further into finding pointer and also recognized that this is the normal behaviour. So inefficient xD

  • @sotgoodies
    @sotgoodies Před 2 lety +1

    I cant figure out, was this codded for a dll or a commend promt?

  • @youcool5630
    @youcool5630 Před 4 lety

    Good video

  • @majorduff3220
    @majorduff3220 Před 4 lety

    What's your IDE and settings? Doesn't work for me cause of IDE show me some Syntax errors 🙄

  • @anticipation7043
    @anticipation7043 Před 3 lety

    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

    • @casualgamer1791
      @casualgamer1791  Před 3 lety +1

      Only reason to use kernel drivers is to bypass AC. If there is no ac you can use the methods presented in the video

    • @anticipation7043
      @anticipation7043 Před 3 lety

      @@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

  • @ChrisDuhBestest
    @ChrisDuhBestest Před rokem

    Thank you for this. You need to de-ess the video though! High pitched ssss noises

  • @manishgurawalia7625
    @manishgurawalia7625 Před 3 lety +1

    Can u do some vidoes on dll injection and hooking

    • @casualgamer1791
      @casualgamer1791  Před 3 lety

      i did one on the most basic dll injection method. Yes I will definitely do at least one video dedicated to hooking

  • @ibty3041
    @ibty3041 Před 11 dny

    error: cast from 'BYTE*' {aka 'unsigned char*'} to 'DWORD' {aka 'long unsigned int'} loses precision [-fpermissive]
    19 | dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr;

  • @canalred3609
    @canalred3609 Před měsícem

    how to call gamefuction with external Cheat?

  • @SilentOnion
    @SilentOnion Před 2 lety

    if you already dont have a video on the threadstack pointers then please make it :3

    • @casualgamer1791
      @casualgamer1791  Před 2 lety

      Already done :)

    • @SilentOnion
      @SilentOnion Před 2 lety

      @@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"

    • @casualgamer1791
      @casualgamer1791  Před 2 lety

      Google "visual studio multi byte character set"

  • @SplatterHouseArchives
    @SplatterHouseArchives Před 2 lety

    Yeah how do I write it tho if my address has NO pointers.

    • @casualgamer1791
      @casualgamer1791  Před 2 lety

      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

    • @SplatterHouseArchives
      @SplatterHouseArchives Před 2 lety

      @@casualgamer1791 Thanks man got my tool working anyhow but will check it out non the less

  • @high-level-content-maker

    i have zeros in all offsets

  • @TukeShark
    @TukeShark Před 4 lety

    mine is a awt.dll instead of Zuma.exe do i have to put awt.dll instead?

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      exactly. The GetModuleBaseAddress function should work for all modules (meaning an exe and a dll)

    • @TukeShark
      @TukeShark Před 4 lety

      @@casualgamer1791 it doesnt work for some reason umm im confuzed

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      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

    • @TukeShark
      @TukeShark Před 4 lety

      @@casualgamer1791 ive tried a bunch of stuff idk whats wrong :/

    • @TukeShark
      @TukeShark Před 4 lety

      @@casualgamer1791 oh actualy leme try that i didnt see that messege

  • @dotdotdot7440
    @dotdotdot7440 Před 4 lety

    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.

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      Use uintptr_t for x64 pointers

    • @dotdotdot7440
      @dotdotdot7440 Před 4 lety

      @@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

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      code snipped pls. sounds like you are casting it to a int maybe? int has 4 bytes. Internal or External?

    • @dotdotdot7440
      @dotdotdot7440 Před 4 lety

      @@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?

    • @casualgamer1791
      @casualgamer1791  Před 4 lety

      easiest is a while(true){} loop and get user input inside

  • @sickendude4491
    @sickendude4491 Před 2 lety

    The program has 8 errors lol

  • @vlgrfvlgrf4007
    @vlgrfvlgrf4007 Před 2 lety +1

    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

    • @chofsdfrtss
      @chofsdfrtss Před 2 lety

      same here
      EDIT: GetLastError() after readprocessmemory() where you assign baseAddress a value errors with error code 299 for me

    • @deusz8998
      @deusz8998 Před 2 lety

      @@chofsdfrtss which game are you trying to read/write the memory of?

    • @chofsdfrtss
      @chofsdfrtss Před 2 lety

      ​@@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?