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

      C++ Writing Multi Level Pointer?

      John Kittz
      Hey everyone, so I am practically done a hack for a game but I am coming across a problem. I have a multi level pointer that is the enemy base address but I can't figure out how to write to it using C++. I can write to addresses with one offset but I dont know how to with two offsets and I have been searching for about 2 hours or so. On cheat engine the multi level pointer looks like this:

      C++ Writing Multi Level Pointer?

      The addresses for the enemy base and the other offsets are below:
      Code:
      DWORD ENEMY_BASE = 0x00400000 + 0x000E5F00; //The enemy base
      DWORD OFFSET_1 = 0x0; //First Offset to the enemy base
      DWORD HP_OFFSET = 0xF4 //Second offset
      The function I use to write to a pointer is below:
      Code:
      bool WritePointer(unsigned long ulBase, int iOffset, int iValue)
      {
        __try { *(int*)(*(unsigned long*)ulBase + iOffset) = iValue; return true; }
        __except (EXCEPTION_EXECUTE_HANDLER) { return false; }
      }
      I need the address of a pointer. So practically:
      Code:
      DWORD ENEMY = 0x00400000 + 0x000E5F00; //Base address
      DWORD ENEMY_OFFSET = 0x0;
      DWORD ENEMY_BASE = //Address of ENEMY with the ENEMY_OFFSET
      I need to get the address of the ENEMY with the ENEMY_OFFSET. So not the value, the address.

      If someone could pleaseee help me and provide a function it would be awesome. Thanks a lot!
      ~Baseball435

    2. #2
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      sakino's Avatar
      Join Date
      Aug 2012
      Posts
      4
      Thanks (-->)
      1
      Thanks (<--)
      0
      I am not an expert coder but i stumbled across this code a couple weeks back and it works with multilevel.
      Good luck.

      Code:
      #include <windows.h>
      #include <iostream>
      using namespace std;
      
      
      
      int main()
      {
          DWORD baseAddress = 0xFF1DAA38;//always changing
          DWORD offset1 = 0x18;
          DWORD offset2 = 0x20;
          DWORD pAddress1;
          DWORD pAddress2;
      
          float value = 0;
          DWORD pid;
          HWND hwnd;
      
          hwnd = FindWindow(NULL,"Minesweeper");
          if(!hwnd)//didn't find the window
          {
              cout <<"Window not found!\n";
              cin.get();
          }
          else
          {
              GetWindowThreadProcessId(hwnd,&pid);
              HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);//get permission to read
              if(!phandle)//failed to get permission
              {
                  cout <<"Could not get handle!\n";
                  cin.get();
              }
              else
              {
                  ReadProcessMemory(phandle,(void*)(baseAddress),&pAddress1,sizeof(pAddress1),0);
                  ReadProcessMemory(phandle,(void*)(pAddress1 + offset1),&pAddress2,sizeof(pAddress2),0);
                  while(1)
                  {
                      ReadProcessMemory(phandle,(void*)(pAddress2 + offset2),&value,sizeof(value),0);
                      cout << value << "\n";
                      Sleep(1000);
                  }
              }
          }
      }


      https://stackoverflow.com/questions/...s-of-a-process

    3. #3
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      BlackPitchPL's Avatar
      Join Date
      May 2012
      Location
      POLAND
      Posts
      171
      Thanks (-->)
      1
      Thanks (<--)
      14
      I think ill make a tut for this :P coz you r 3rd person asking same question. So lets go

      Code:
      #define DEF_PLAYERBASE     0x18FAA0 // your base
      #define off_1 0x022030
      #define off_2 0x33223
      //than
      in your hacks func 
      *(INT*)(DEF_PLAYERBASE+off_1+off_2)  = 100;
      But in your code i see that you dont need first address because base + 0 is still base :P try to add 0xf4 just after base and see if it works too

    4. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      TheTime's Avatar
      Join Date
      Jul 2012
      Posts
      3
      Thanks (-->)
      0
      Thanks (<--)
      3
      A very simple solution found in a public source code by Fleep :


      DWORD hackBaseAddress = {0x00000000};
      DWORD hackOffsets[] = {0x1, 0x2, 0x3}; //3 LEVEL pointer


      void WriteToMemory(DWORD addressToWrite, char* valueToWrite, int byteNum)
      {
      //used to change our file access type, stores the old
      //access type and restores it after memory is written
      unsigned long OldProtection;
      //give that address read and write permissions and store the old permissions at oldProtection
      VirtualProtect((LPVOID)(addressToWrite), byteNum, PAGE_EXECUTE_READWRITE, &OldProtection);

      //write the memory into the program and overwrite previous value
      memcpy( (LPVOID)addressToWrite, valueToWrite, byteNum);

      //reset the permissions of the address back to oldProtection after writting memory
      VirtualProtect((LPVOID)(addressToWrite), byteNum, OldProtection, NULL);
      }

      DWORD FindDmaAddy(int PointerLevel, DWORD Offsets[], DWORD BaseAddress)
      {
      //DEFINES OUR ADDRESS to write to
      //if statements are crucial to make sure that the address is valid to write
      //otherwise we crash. Address will not be valid when things like map changes or game loads are happening
      DWORD Ptr = *(DWORD*)(BaseAddress); //Base Address
      if(Ptr == 0) return NULL;//prevent crash

      //this is done to allow us to have pointers up to many levels e.g.10
      for(int i = 0; i < PointerLevel; i ++)
      {
      //if it = PointerLevel-1 then it reached the last element of the array
      //therefore check if that address plus the offset is valid and leave the loop
      if(i == PointerLevel-1)
      {
      //!!make sure the last address doesnt have the asterisk on DWORD otherwise incoming crash
      Ptr = (DWORD)(Ptr+Offsets[i]); //Add the final offset to the pointer
      if(Ptr == 0) return NULL;//prevent crash
      //we here return early because when it hits the last element
      //we want to leave the loop, specially adapted for offsets of 1
      return Ptr;
      }
      else
      {
      //if its just a normal offset then add it to the address
      Ptr = *(DWORD*)(Ptr+Offsets[i]); //Add the offsets
      if(Ptr == 0) return NULL;//prevent crash
      }
      }
      return Ptr;
      }


      Simple usage :


      if(GetAsyncKeyState(VK_F2))
      {
      WriteToMemory(FindDmaAddy(3, hackOffsets, hackBaseAddress), "\x0", 1); // Number of Levels, hackOffsets, hackBaseAddress, Value, Number of bytes
      }


      And don't forget to check for null / inexistent pointer to avoid game crashes :


      if(GetAsyncKeyState(VK_F2))
      {
      DWORD base = *(DWORD*)hackBaseAddress;
      if(base != 0)
      {
      WriteToMemory(FindDmaAddy(3, hackOffsets, hackBaseAddress), "\x0", 1);
      }
      }
      Last edited by TheTime; 09-11-2012 at 08:05 AM.

    5. Thanks Fleep, Glenox thanked for this post
    6. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Glenox's Avatar
      Join Date
      Sep 2012
      Posts
      7
      Thanks (-->)
      9
      Thanks (<--)
      3
      Cheats'n'Trainers
      if(GetAsyncKeyState(VK_F2))
      {
      DWORD base = *(DWORD*)hackBaseAddress;
      if(base != 0)
      {
      WriteToMemory(FindDmaAddy(3, hackOffsets, hackBaseAddress), "\x0", 1);
      }
      }

      im using this code!!! but the game is crash?? why?

    Similar Game Hacker Threads

    1. Replies: 8
      Last Post: 03-24-2015, 07:54 AM
    2. [Help] Pointer / Multi-Level Pointer in VB.NET
      By Vultrax in forum Visual Basic
      Replies: 1
      Last Post: 10-30-2014, 03:23 AM
    3. [Help] Base Address and Multi Level Pointer (TrackMania)
      By FlexXx1212 in forum GH Tutorials Help
      Replies: 12
      Last Post: 11-27-2013, 12:53 PM
    4. Replies: 10
      Last Post: 09-03-2013, 11:53 PM
    5. [TuT]BlackPitchPL - Multi Level pointer and reclass
      By BlackPitchPL in forum Tutorials and Snippets
      Replies: 4
      Last Post: 01-22-2013, 04:16 AM