• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Depressed
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Sleeping
  • Steam Gaming
  • Trolling
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 5 of 5
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      thatnoobkid's Avatar
      Join Date
      May 2016
      Posts
      3
      Thanks (-->)
      1
      Thanks (<--)
      0

      Can use RPM to find a value but can't use WPM to edit it

      Cheats-n-Trainers
      Hello Guided Hacking! Recently I've tried to create my own game hack to try and learn the basics of game hacking. I have run into a problem that I can't figure out on my own through the use of google and this site's search bar. The problem I am having is I can use RPM to view a value stored inside of a game's address but I don't know how to use WPM to edit it. I tried experimenting on my own by trying to write to multiple addresses but had no success. The problem is on line 32:
      printf("\n%d", WriteProcessMemory(ac_game, (LPVOID) offset, (LPCVOID) &magAmmount, sizeof(DWORD), NULL));
      I can't for the life of me find the correct address to write to. I am hoping someone can explain how to use my hack to WPM to my base address + offsets.

      #include <windows.h>
      #include <stdio.h>
      #include "GetModBaseAddress.h"

      int main()
      {
      int pid = 2252;

      HANDLE ac_game = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_OPERATION |
      PROCESS_VM_WRITE | PROCESS_VM_READ, 0, pid);

      DWORD ac_game_address = getModBaseAddress(pid, "ac_client.exe");
      printf("\nBase address: 0x%x\nIf 0 then module could not be found.\n", ac_game_address);

      DWORD MagBaseAddress = { 0x109B74 };
      DWORD MagOffsets[] = { 0x36c, 0x18, 0x1e4, 0x50, 0x40 };
      int magAmmount = 1000;

      DWORD offset = MagBaseAddress + ac_game_address;
      printf("%d", ReadProcessMemory(ac_game, (LPCVOID) offset, (LPVOID) &offset, sizeof(DWORD), NULL));
      printf("\noffset: 0x%x", offset);

      int i;
      for(i=0; i<5; i++)
      {
      offset += MagOffsets[i];
      printf("\n%d", ReadProcessMemory(ac_game, (LPCVOID) offset, (LPVOID) &offset, sizeof(DWORD), NULL));
      printf("\noffset: 0x%x", offset);
      }

      printf("\nammo: %d", offset);
      printf("\n%d", WriteProcessMemory(ac_game, (LPVOID) offset, (LPCVOID) &magAmmount, sizeof(DWORD), NULL));
      printf("\nlast error: %d", GetLastError());

      CloseHandle(ac_game);
      }

    2. #2
      Administrator
      Hacked By Jesus
       
      Coding
       
      [GH]Rake's Avatar
      Join Date
      Jan 2014
      Location
      USA
      Posts
      2,751
      Thanks (-->)
      564
      Thanks (<--)
      840

      Re: Can use RPM to find a value but can't use WPM to edit it

      @thatnoobkid I rewrote it with code that I know works, I hope it is helpful:

      #include <windows.h>
      #include <tlhelp32.h>
      #include <tchar.h>
      #include <stdio.h>


      //credits to Solaire for his sexy function
      DWORD GetProcessID(const wchar_t * ExeName) {
      PROCESSENTRY32 ProcEntry = { 0 };
      HANDLE SnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);

      if (!SnapShot)
      return NULL;

      ProcEntry.dwSize = sizeof(ProcEntry);

      if (!Process32First(SnapShot, &ProcEntry))
      return NULL;

      do {
      if (!wcscmp(ProcEntry.szExeFile, ExeName)) {
      CloseHandle(SnapShot);
      return ProcEntry.th32ProcessID;
      }
      } while (Process32Next(SnapShot, &ProcEntry));

      CloseHandle(SnapShot);
      return NULL;
      }

      DWORD CalculateMultiLevelPointer(HANDLE hProcHandle, int NumberOfOffsets, DWORD Offsets[], DWORD FirstAddressOfPointer)
      {
      DWORD Pointer = FirstAddressOfPointer;
      DWORD TempBuffer;
      DWORD EndAddressOfPointer;
      for (int i = 0; i < NumberOfOffsets; i++)
      {
      if (i == 0)
      {
      ReadProcessMemory(hProcHandle, (LPCVOID)Pointer, &TempBuffer, 4, NULL);
      }
      EndAddressOfPointer = TempBuffer + Offsets[i];
      ReadProcessMemory(hProcHandle, (LPCVOID)EndAddressOfPointer, &TempBuffer, 4, NULL);
      }
      return EndAddressOfPointer;
      }

      int main()
      {
      int pid = GetProcessID(L"ac_client.exe");

      HANDLE ac_game = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);

      DWORD MagBaseAddress = { 0x509B74 };
      DWORD MagOffsets[] = { 0x36c, 0x18, 0x1e4, 0x50, 0x40 };
      int magAmmount = 1000;

      DWORD offset;
      printf("%d", ReadProcessMemory(ac_game, (LPCVOID)MagBaseAddress, (LPVOID)&offset, sizeof(DWORD), NULL));
      printf("\noffset: 0x%x", offset);

      DWORD DynamicAmmoAddress = CalculateMultiLevelPointer(ac_game, 5, MagOffsets, MagBaseAddress);

      printf("\nammo: %d", DynamicAmmoAddress);
      printf("\n%d", WriteProcessMemory(ac_game, (LPVOID)DynamicAmmoAddress, (LPCVOID)&magAmmount, sizeof(DWORD), NULL));
      printf("\nlast error: %d", GetLastError());

      Sleep(50000);
      CloseHandle(ac_game);
      }

    3. Thanks thatnoobkid thanked for this post
    4. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      thatnoobkid's Avatar
      Join Date
      May 2016
      Posts
      3
      Thanks (-->)
      1
      Thanks (<--)
      0

      Re: Can use RPM to find a value but can't use WPM to edit it

      Thank you for the reply and the code. I was wondering how it works because I've noticed that you have a different base address from me. Where did it come from? Also I noticed that you do not need to get the module base address. I thought you needed to find this address every time the game relaunches because it always changes where you need to write values to? I hope I am not being a bother and I look forward to any answers that you can give to me.

    5. #4
      Administrator
      Hacked By Jesus
       
      Coding
       
      [GH]Rake's Avatar
      Join Date
      Jan 2014
      Location
      USA
      Posts
      2,751
      Thanks (-->)
      564
      Thanks (<--)
      840

      Re: Can use RPM to find a value but can't use WPM to edit it

      Quote Originally Posted by thatnoobkid View Post
      I've noticed that you have a different base address from me. Where did it come from? Also I noticed that you do not need to get the module base address. I thought you needed to find this address every time the game relaunches because it always changes where you need to write values to?.
      All executables will have the same image base address everytime, unless ASLR is enabled. Therefore you can hardcode the address

      Read this http://guidedhacking.com/showthread....dress-Tutorial

    6. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      thatnoobkid's Avatar
      Join Date
      May 2016
      Posts
      3
      Thanks (-->)
      1
      Thanks (<--)
      0

      Re: Can use RPM to find a value but can't use WPM to edit it

      GuidedHacking Advertisements
      Alright. Thank you for all of your help.

    Similar Game Hacker Threads

    1. Replies: 8
      Last Post: 03-24-2015, 07:54 AM
    2. BL2 console Trainer (TriggerBot & Money/Eridium edit)
      By BeesKnees in forum Other Game Hacks
      Replies: 3
      Last Post: 03-21-2014, 11:04 PM