• 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 7 of 7

    Thread: Trainer problem

    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      skygen's Avatar
      Join Date
      Mar 2013
      Posts
      7
      Thanks (-->)
      2
      Thanks (<--)
      0

      Question Trainer problem

      John Kittz
      I just don't know what is wrong with it!

      Code:
      #include <cstdlib>
      #include <iostream>
      #include <conio.h>
      #include <windows.h>
      
      
      using namespace std;
      
      
      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);
      			}
      			
      			pointerAddr = pTemp + Offsets[i];   
      
      		
      			ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, 4, NULL);
      	}
      	return pointerAddr;
      }
      
      
      int main()
      {
      DWORD ProcessId;
      DWORD buffer;
      HANDLE h1;
      BOOL R1;
      DWORD ADDY = 0x69E0FAC;
      DWORD ADDY2[3] = {0x54,0x14,0x7C};
      
          
      HWND hWnd = FindWindow(NULL,"Empire Earth II");
      if (hWnd) cout << "Window Found!" << endl;
      else cout << GetLastError();
      
      GetWindowThreadProcessId(hWnd,&ProcessId);
      
      h1 = OpenProcess(PROCESS_VM_READ,false,ProcessId);
      if (h1) {cout << "Process Opened!" << endl; }
      else { cout << "OpenProcess: " << GetLastError << endl; }
      
      cout << FindDmaAddy(3,h1,ADDY2,ADDY);
      
          getch();
          return 0;
      }
      Click image for larger version. 

Name:	40a5c80fbebc.jpg 
Views:	2 
Size:	39.4 KB 
ID:	1662
      It returns me 124!

    2. #2
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      Judging from a brief look.

      You are going off the grid with finding the address. You only have to call the FindDmaAddy with first 2 offsets. Then add the last offset (0x7C) to the address which FindDmaAddy returned and read a value from that address

      Edit:

      So its

      Code:
      int nData = 0; // buffer for whatever you are reading
      DWORD dwFinal = FindDmaAddy(2,h1,ADDY2,ADDY) + ADDY[2];
      ReadProcessMemory(h1, (LPCVOID)dwFinal, &nData, sizeof(int), NULL);
      Last edited by c5; 03-13-2013 at 02:30 PM.
      Trainer problem

    3. Thanks skygen thanked for this post
    4. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      skygen's Avatar
      Join Date
      Mar 2013
      Posts
      7
      Thanks (-->)
      2
      Thanks (<--)
      0
      Im doing it like this:
      DWORD dwFinal = FindDmaAddy(2,h1,ADDY2,ADDY) + ADDY2[2];
      ReadProcessMemory(h1, (LPCVOID)dwFinal, &pTemp, 4, NULL);
      but it returns me some wrong value like 1964351738!

    5. #4
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      Quote Originally Posted by skygen View Post
      Im doing it like this:

      but it returns me some wrong value like 1964351738!
      Calculate those offsets manually to be sure your DMA function works properly.
      Trainer problem

    6. Thanks skygen thanked for this post
    7. #5
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      skygen's Avatar
      Join Date
      Mar 2013
      Posts
      7
      Thanks (-->)
      2
      Thanks (<--)
      0
      Well, I obviously got problems with pointer reading. If I read 69E0FAC it should get me another pointer adress (07E20398), write?
      Last edited by skygen; 03-13-2013 at 03:49 PM.

    8. #6
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      491
      Get rid of the first if statement and expression in FindDMA and it should work I missed that one before
      Trainer problem

    9. #7
      Coder
      Learning to hack games!
       
      Feeling Normal
       
      Chuck E's Avatar
      Join Date
      Jan 2013
      Location
      United Kingdom
      Posts
      119
      Thanks (-->)
      30
      Thanks (<--)
      20
      Cheats'n'Trainers
      Quote Originally Posted by skygen View Post
      Im doing it like this:

      but it returns me some wrong value like 1964351738!
      I just tried it out and it came up with an excessively long number like that. It turned out my code was not getting the process' handle properly. Actually, it wasn't getting the handle at all, so I have no idea what value was in that variable.

      That FindDmaAddy function is exactly the same as from Fleep's tutorials, so should be fine.

      Therefore, my guess, is that it may be that it is not acquiring the thread's process GetWindowThreadProcessId() and/or the process' handle OpenProcess()

      I could be wrong, who knows
      Last edited by Chuck E; 03-13-2013 at 07:15 PM.

    Similar Game Hacker Threads

    1. [Help] C# Problem
      By xa84759x in forum Hacking Help
      Replies: 11
      Last Post: 02-07-2015, 02:00 PM
    2. [Help] CE Problem
      By ace0000 in forum GH Tutorials Help
      Replies: 4
      Last Post: 12-25-2013, 10:39 AM
    3. [Trainer+Source]Bioshock Infinite +17 Trainer
      By Syperus in forum Other Game Hacks
      Replies: 14
      Last Post: 05-26-2013, 09:45 PM
    4. [Help] Trainer C# ByteConverter problem
      By ORR in forum GH Tutorials Help
      Replies: 10
      Last Post: 11-21-2012, 06:49 AM
    5. Little Problem!
      By nico0 in forum Visual Basic
      Replies: 9
      Last Post: 07-24-2012, 04:54 AM

    Tags for this Thread