• 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 3 of 3
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1

      Reading/Writing to memory

      Silent VPN
      Hey guys, I have a question, migth be easy for the most, however, i'm getting confused with it.
      Can you explain, step by step, whats these functions below do? I mean, line by line..
      I understand some of the lines, but the whole thing.

      [HTML]DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress){
      DWORD pointer = BaseAddress;
      DWORD pTemp;
      DWORD pointerAddr;

      for(int i = 0; i < PointerLevel; i++){
      if(i == 0){
      ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, 4, NULL);
      }

      // Add 1st OFFSET to that address
      pointerAddr = pTemp + Offsets[i];

      ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, 4, NULL);
      }
      return pointerAddr;
      }

      void WriteToMemory(HANDLE hProcHandle){
      // AMMO
      DWORD AmmoAddressToWrite = FindDmaAddy(3, hProcHandle, AmmoOffsets, AmmoBaseAddress);
      WriteProcessMemory(hProcHandle, (BYTE*)AmmoAddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);

      // HEALTH
      DWORD HealthAddressToWrite = FindDmaAddy(1, hProcHandle, HealthOffsets, HeatlhBaseAddress);
      WriteProcessMemory(hProcHandle, (BYTE*)HealthAddressToWrite, &HealthValue, sizeof(HealthValue), NULL);
      }[/HTML]

      Thanks yall..

    2. #2
      Newbie
      Studying, Coding, Vacationing,
      Hacking
       
      Coding
       
      NebulaGrey's Avatar
      Join Date
      Jun 2014
      Location
      Kentucky
      Posts
      31
      Thanks (-->)
      1
      Thanks (<--)
      5
      DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress){ // looks to be a user-made method to loop through all the reads.
      DWORD pointer = BaseAddress; // The base address (used without any offsets)
      DWORD pTemp; // Temporary offset
      DWORD pointerAddr; // Another address + offsets

      for(int i = 0; i < PointerLevel; i++){
      if(i == 0){
      ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, 4, NULL); // Gets the value of the baseaddrPtr.
      }

      // Add 1st OFFSET to that address
      pointerAddr = pTemp + Offsets[i]; // Adds the offset

      ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, 4, NULL); // Finds the value of pointerAddr, and writes it to pTemp
      }
      return pointerAddr; // Returns the address used to read/write to the value you want.
      }

      void WriteToMemory(HANDLE hProcHandle){ // Writes to an open process
      // AMMO
      DWORD AmmoAddressToWrite = FindDmaAddy(3, hProcHandle, AmmoOffsets, AmmoBaseAddress); // Gets the address for Ammo to be written to.
      WriteProcessMemory(hProcHandle, (BYTE*)AmmoAddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL); // Writes to the address found above. with AmmoValue (if AmmoValue is 4 Bytes, it writes 4 Bytes)

      // HEALTH
      DWORD HealthAddressToWrite = FindDmaAddy(1, hProcHandle, HealthOffsets, HeatlhBaseAddress); // As above but for health
      WriteProcessMemory(hProcHandle, (BYTE*)HealthAddressToWrite, &HealthValue, sizeof(HealthValue), NULL); // As above but for health
      }

      I've added comments to every line, hope that helps
      Last edited by NebulaGrey; 06-10-2014 at 05:09 PM. Reason: Made it more readable via colors

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      zoratz's Avatar
      Join Date
      Jul 2013
      Posts
      47
      Thanks (-->)
      5
      Thanks (<--)
      1
      Silent VPN
      Thanks alot NebulaGrey, after I read your comments I realised that I was forgotting some thoughs over there..
      Thanks again

    Similar Game Hacker Threads

    1. [Help] C# Trainer Not Writing Memory
      By IMBredCrumbz in forum Hacking Help
      Replies: 4
      Last Post: 11-22-2015, 02:18 PM
    2. [Help] Writing to Memory, FLT Trainer
      By Tarolion in forum C#
      Replies: 5
      Last Post: 04-08-2015, 11:25 AM
    3. [Help] Question about a while loop, memory reading/writing
      By mattthhdp in forum Hacking Help
      Replies: 3
      Last Post: 02-16-2015, 07:07 PM
    4. Replies: 2
      Last Post: 03-18-2014, 04:33 PM
    5. Reading/Writing To Memory In .NET
      By Styx™ in forum Visual Basic
      Replies: 5
      Last Post: 11-13-2013, 09:37 PM

    Tags for this Thread