• 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
  • Sipping
  • 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!
       
      Hacking
       

      Join Date
      Mar 2013
      Posts
      5
      Thanks (-->)
      1
      Thanks (<--)
      0

      TrackMania Trainer

      How to Manual Map DLL
      Well i have been following fleeps tutorial for a trainer (the prompt one) and i was changing the code and address' correctly, This is for the beta of the new TrackMania game.
      Spoiler: Code
      Code:
      #include <iostream>
      #include <Windows.h>
      #include <string>
      #include <ctime>
      
      DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD offsets[], DWORD BaseAddress);
      void WriteToMemory(HANDLE hProcHandle);
      
      std::string GameName = "ManiaPlanet";
      LPCSTR LGameWindow = "ManiaPlanet";
      std::string GameStatus;
      
      bool IsGameAvail;
      bool UpdateOnNextRun;
      
      //Co-ordinate Vars
      bool XStatus;
      BYTE XValue[] = {0x1E};
      DWORD XBaseAddress = ((DWORD)GetModuleHandleA("ManiaPlanet.exe")) + 0x00F73C24;
      DWORD XOffset[] = {0x124, 0x88, 0x78, 0x1C, 0x28};
      
      int main()
      {
      	HWND hGameWindow = NULL;
      	int TimeSinceLastUpdate = clock();
      	int GameAvailTimer = clock();
      	int onePressTimer = clock();
      	DWORD dwProcID = NULL;
      	HANDLE hProcHandle = NULL;
      	UpdateOnNextRun = true;
      	std::string sXStatus = "OFF";
      
      	while(!GetAsyncKeyState(VK_INSERT))
      	{
      		if(clock() - GameAvailTimer > 100)
      		{
      			GameAvailTimer = clock();
      			IsGameAvail = false;
      
      			hGameWindow = FindWindow(NULL, LGameWindow);
      			if(hGameWindow)
      			{
      				GetWindowThreadProcessId(hGameWindow, &dwProcID);
      				if(dwProcID != 0)
      				{
      					hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcID);
      					if(hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
      					{
      						GameStatus = "Failed To Open Process For Valid Handle";
      					}
      					else
      					{
      						GameStatus = "ManiaPlanet Ready To Hack";
      						IsGameAvail = true;
      					}
      				}
      				else
      				{
      					GameStatus = "Failed To Get Process ID";
      				}
      			}
      			else
      			{
      				GameStatus = "ManiaPlanet Not Found";
      			}
      
      			if(UpdateOnNextRun || clock() - TimeSinceLastUpdate > 5000)
      			{
      				system("cls");
      				std::cout << "--------------------------------------------------------------------" << std::endl;
      				std::cout << "			ManiaPlanet Trainer" << std::endl;
      				std::cout << "--------------------------------------------------------------------" << std::endl << std::endl;
      				std::cout << "GAME STATUS: " << GameStatus << std::endl << std::endl;
      				std::cout << "[F1] X -> " << sXStatus << " <- " << std::endl << std::endl;
      				std::cout << "[INSERT] Exit" << std::endl;
      				UpdateOnNextRun = false;
      				TimeSinceLastUpdate = clock();
      			}
      
      			if(IsGameAvail)
      			{
      				WriteToMemory(hProcHandle);
      
      			}
      		}
      
      		if(clock() - onePressTimer > 400)
      		{
      			if(IsGameAvail)
      			{
      
      				if(GetAsyncKeyState(VK_F1))
      				{
      					onePressTimer = clock();
      					XStatus = !XStatus;
      					UpdateOnNextRun = true;
      					if(XStatus)sXStatus = "ON";
      					else sXStatus = "OFF";
      				}
      			}
      		}
      	}
      
      	return ERROR_SUCCESS;
      }
      
      DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD offsets[], DWORD BaseAddress)
      {
      	DWORD pointer = BaseAddress;
      	DWORD pTemp;
      
      	DWORD pointerAddr;
      	for(int c = 0; c < PointerLevel; c++)
      	{
      		if(c == 0)
      		{
      			ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
      		}
      		pointerAddr = pTemp + offsets[c];
      		ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, sizeof(pTemp), NULL);
      	}
      	return pointerAddr;
      
      }
      
      void WriteToMemory(HANDLE hProcHandle)
      {
      	DWORD AddressToWrite;
      	
      	if(XStatus)
      	{
      		AddressToWrite = FindDmaAddy(4, hProcHandle, XOffset, XBaseAddress);
      		WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &XValue, sizeof(XValue), NULL);
      	}
      }


      If someone could try and tell me what is wrong i would appreciate it a lot.
      Thank you in advance
      Last edited by JWNJWN; 05-01-2013 at 02:11 PM.

    2. #2
      The Future Hacker
      Learning to hack games!
       
      Feeling Normal
       
      jamesst20's Avatar
      Join Date
      Apr 2013
      Location
      Canada, Quebec, Quebec City
      Posts
      87
      Thanks (-->)
      14
      Thanks (<--)
      12
      I didn't test anything but I know in Fleep tutorial, he does if (GetAsyncKeyState(VK_INSERT)&1), could the &1 be the issue ? You didn't tell what the issue so it is pretty hard to guess ^^

    3. #3
      Newbie
      Learning to hack games!
       
      Hacking
       

      Join Date
      Mar 2013
      Posts
      5
      Thanks (-->)
      1
      Thanks (<--)
      0
      The issue is that is simply doesn't work, It is meant to change the X of the car to the XValue specified but it does nothing.
      Well nothing that i can tell

    4. #4
      The Future Hacker
      Learning to hack games!
       
      Feeling Normal
       
      jamesst20's Avatar
      Join Date
      Apr 2013
      Location
      Canada, Quebec, Quebec City
      Posts
      87
      Thanks (-->)
      14
      Thanks (<--)
      12
      Quote Originally Posted by JWNJWN View Post
      The issue is that is simply doesn't work, It is meant to change the X of the car to the XValue specified but it does nothing.
      Well nothing that i can tell
      Try to add some std::cout at some places to make sure it gets to that point

    5. #5
      RTFM
      Shootin Pool!
       
      Coding
       
      Syperus's Avatar
      Join Date
      Oct 2012
      Location
      127.0.0.1
      Posts
      436
      Thanks (-->)
      101
      Thanks (<--)
      131
      Cheat Engine Tutorials
      What does the status say when you load the game? Is it detecting the window? If it keeps saying "ManiaPlanet Not Found" then your game window name is wrong. Needs to be exactly as it looks in the window. If it's not that then double check your addresses. Check your offsets and make sure they're not backwards.

      @jamesst20 &1 prevents the key being pressed from spamming on/off while the key is being held down. Yes this could actually be an issue cause if it's held down for any amount of seconds it will have spammed the key on/off multiple times. Chances of it actually stopping at off every time is unlikely, but not impossible. @JWNJWN try this and see if it fixes your issue as well.
      Blacks Ops Zombies, BioShock Infinite Array of Bytes
      "People say I'm a bad influence. I say the world's already fucked, I'm just adding to it" -Eminem

    Similar Game Hacker Threads

    1. [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
    2. [Trainer+Source]Bioshock Infinite +17 Trainer
      By Syperus in forum Other Game Hacks
      Replies: 14
      Last Post: 05-26-2013, 09:45 PM