• 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
  • Page 1 of 2 12 LastLast
    Results 1 to 10 of 15
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      fiox's Avatar
      Join Date
      Oct 2012
      Posts
      9
      Thanks (-->)
      0
      Thanks (<--)
      0

      Help with this Code

      John Kittz
      Don't be harsh on me, I'm new to C++, I only learned C so far, so i tried to Adapt the AssaultCube code to another game though I'm having problems with LGameWindow.

      Code:
      #include <iostream>
      #include <Windows.h>
      #include <string>
      #include <ctime>
      void WriteToMemory(HANDLE hProcHandle);
      DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress);
      
      std::string GameName = "CABAL";
      LPCSTR LGameWindow = "CABAL";
      std::string GameStatus;
      
      bool GameAvail;
      bool UpdateOnNextRun;
      
      //Combo Vars
      bool ComboStatus;
      BYTE ComboValue[] = {0x1, 0x1, 0x0, 0x0};
      DWORD ComboBaseAdress = {0x065347E8};
      DWORD ComboOffsets[] = {0x73B0};
      
      int main()
      {
      	HWND hGameWindow = NULL;
      	int timeSinceLastUpdate = clock();
      	int GameAvailTMR = clock();
      	int onePressTMR = clock();
      	DWORD dwProcID = NULL;
      	HANDLE hProcHandle = NULL;
      	UpdateOnNextRun = true;
      	std::string sComboStatus = "OFF";
      
      	while(!GetAsyncKeyState(VK_INSERT))
      	{
      		if(clock() - GameAvailTMR > 100)
      		{
      			GameAvailTMR = clock();
      			GameAvail = false;
      
      			hGameWindow = FindWindow(NULL, LGameWindow);
      and it gives me this error,
      error C2664: 'FindWindowW' : cannot convert parameter 2 from 'LPCSTR' to 'LPCWSTR'

    2. #2
      Nick
      Learning to hack games!
       
      Feeling Normal
       
      ndani14's Avatar
      Join Date
      Aug 2012
      Location
      Australia
      Posts
      53
      Thanks (-->)
      11
      Thanks (<--)
      25
      Hey fiox, you have two choices you can either change the character settings in the project ("View" -> "Property Pages" -> "Configuration Properties" -> "General") and set the "Character Set" to "Use Multi-Byte Character Set"

      or change

      LPCSTR LGameWindow = "CABAL";
      to
      WCHAR LGameWindow[] = L"CAREL";

      good luck =)
      Last edited by ndani14; 10-14-2012 at 07:20 PM.

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      fiox's Avatar
      Join Date
      Oct 2012
      Posts
      9
      Thanks (-->)
      0
      Thanks (<--)
      0
      Quote Originally Posted by ndani14 View Post
      Hey fiox, you have two choices you can either change the character settings in the project ("View" -> "Property Pages" -> "Configuration Properties" -> "General") and set the "Character Set" to "Use Multi-Byte Character Set"

      or change

      LPCSTR LGameWindow = "CABAL";
      to
      WCHAR LGameWindow[] = L"CAREL";

      good luck =)
      THanks a lot, it's working .

    4. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      fiox's Avatar
      Join Date
      Oct 2012
      Posts
      9
      Thanks (-->)
      0
      Thanks (<--)
      0
      Having a new problem though, this time with the Hex's I think,
      I have the right code and offset since I used the same codes from a working CheatEngine Table,
      However I'm supposed to be able to freeze it at value 0, Though I duno how I assign a 0 in Hex.

      I tried in a few ways,
      Code:
      //Combo Vars
      bool ComboStatus;
      BYTE ComboValue[] = {0x0, 0x00, 0x00, 0x00};
      DWORD ComboBaseAdress = {0x00B8BBF0};
      DWORD ComboOffsets[] = {0x7384};
      Crash
      Code:
      //Combo Vars
      bool ComboStatus;
      BYTE ComboValue[] = {0x13, 0x53, 0x53, 0x53};
      DWORD ComboBaseAdress = {0x00B8BBF0};
      DWORD ComboOffsets[] = {0x7384};
      Doesn't Crash, but doesn't work either
      Code:
      //Combo Vars
      bool ComboStatus;
      BYTE ComboValue[] = {0xA3, 0x0, 0x0, 0x0};
      DWORD ComboBaseAdress = {0x00B8BBF0};
      DWORD ComboOffsets[] = {0x7384};
      Crash


      Full code below if it helps,

      Code:
      #include <iostream>
      #include <Windows.h>
      #include <string>
      #include <ctime>
      void WriteToMemory(HANDLE hProcHandle);
      DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD Offsets[], DWORD BaseAddress);
      
      std::string GameName = "CABAL";
      LPCSTR LGameWindow = "CABAL";
      std::string GameStatus;
      
      bool GameAvail;
      bool UpdateOnNextRun;
      
      //Combo Vars
      bool ComboStatus;
      BYTE ComboValue[] = {0x13, 0x53, 0x53, 0x53};
      DWORD ComboBaseAdress = {0x00B8BBF0};
      DWORD ComboOffsets[] = {0x7384};
      
      int main()
      {
      	HWND hGameWindow = NULL;
      	int timeSinceLastUpdate = clock();
      	int GameAvailTMR = clock();
      	int onePressTMR = clock();
      	DWORD dwProcID = NULL;
      	HANDLE hProcHandle = NULL;
      	UpdateOnNextRun = true;
      	std::string sComboStatus = "OFF";
      
      	while(!GetAsyncKeyState(VK_INSERT))
      	{
      		if(clock() - GameAvailTMR > 100)
      		{
      			GameAvailTMR = clock();
      			GameAvail = 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 = " Cabal Ready To Hack";
      						GameAvail = true;
      					}
      				}
      				else
      				{
      						GameStatus = " Failed to get Process ID";
      
      				}
      			}
      			else
      			{
      				 GameStatus = " CABAL NOT FOUND";
      			}
      
      
      			if(UpdateOnNextRun || clock() - timeSinceLastUpdate > 5000)
      			{
      				system("cls");
      				std::cout << "-----------------------------------------------------------" << std::endl;
      				std::cout << "		Cabal Combo Hack" << std::endl;
      				std::cout << "-----------------------------------------------------------" << std::endl << std::endl;
      				std::cout << "GAME STATUS:" << GameStatus << std::endl << std::endl;
      				std::cout << "[F1] Perfect Combo -> " << sComboStatus << " <- " << std::endl << std::endl;
      				std::cout << "[INSTER] Exit" << std::endl;
      				UpdateOnNextRun = false;
      				timeSinceLastUpdate = clock();
      			}
      
      			if(GameAvail)
      			{
      				//Write to memory
      				WriteToMemory(hProcHandle);
      			}
      		}
      
      		if(clock() - onePressTMR > 400)
      		{
      			if(GameAvail)
      			{
      				//Ammo
      				if(GetAsyncKeyState(VK_F1))
      				{
      					onePressTMR = clock();
      					ComboStatus =! ComboStatus;
      					UpdateOnNextRun = true;
      					if(ComboStatus)sComboStatus = "ON";
      					else sComboStatus = "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(ComboStatus)
      	{
      		AddressToWrite = FindDmaAddy(3,hProcHandle, ComboOffsets, ComboBaseAdress);
      		WriteProcessMemory(hProcHandle,(BYTE*)AddressToWrite, &ComboValue,sizeof(ComboValue),NULL);
      	}
      }
      Last edited by fiox; 10-15-2012 at 06:54 AM.

    5. #5
      Nick
      Learning to hack games!
       
      Feeling Normal
       
      ndani14's Avatar
      Join Date
      Aug 2012
      Location
      Australia
      Posts
      53
      Thanks (-->)
      11
      Thanks (<--)
      25
      Sorry but what is it in Cheat Engine?

    6. #6
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      fiox's Avatar
      Join Date
      Oct 2012
      Posts
      9
      Thanks (-->)
      0
      Thanks (<--)
      0
      Quote Originally Posted by ndani14 View Post
      Sorry but what is it in Cheat Engine?
      didn't really understood what you wanted so I took a SS from the code.
      Click image for larger version. 

Name:	cabal.jpg 
Views:	11 
Size:	84.9 KB 
ID:	1306

    7. #7
      Nick
      Learning to hack games!
       
      Feeling Normal
       
      ndani14's Avatar
      Join Date
      Aug 2012
      Location
      Australia
      Posts
      53
      Thanks (-->)
      11
      Thanks (<--)
      25
      I think the problem is down in WriteToMemory

      AddressToWrite = FindDmaAddy(3, hProcHandle, ComboOffsets, ComboBaseAdress);
      should probably be
      AddressToWrite = FindDmaAddy(1, hProcHandle, ComboOffsets, ComboBaseAdress); // you could also put sizeof(ComboOffsets)
      because the pointer level is only one

      the address and offsets should be

      BYTE ComboValue[] = {0, 0, 0, 0};
      DWORD ComboBaseAdress = 0x00B8BBF0;
      DWORD ComboOffsets[] = {0x73A1};

      if i read FindDmaAddy correctly

    8. #8
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      fiox's Avatar
      Join Date
      Oct 2012
      Posts
      9
      Thanks (-->)
      0
      Thanks (<--)
      0
      Quote Originally Posted by ndani14 View Post
      I think the problem is down in WriteToMemory

      AddressToWrite = FindDmaAddy(3, hProcHandle, ComboOffsets, ComboBaseAdress);
      should probably be
      AddressToWrite = FindDmaAddy(1, hProcHandle, ComboOffsets, ComboBaseAdress); // you could also put sizeof(ComboOffsets)
      because the pointer level is only one

      the address and offsets should be

      BYTE ComboValue[] = {0, 0, 0, 0};
      DWORD ComboBaseAdress = 0x00B8BBF0;
      DWORD ComboOffsets[] = {0x73A1};

      if i read FindDmaAddy correctly
      Thanks working now

    9. #9
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      fiox's Avatar
      Join Date
      Oct 2012
      Posts
      9
      Thanks (-->)
      0
      Thanks (<--)
      0
      I do have a questions though, its about the values, what if I wanted to freeze the value at 1629697 how would I do it in the Combo Value part?

    10. #10
      Nick
      Learning to hack games!
       
      Feeling Normal
       
      ndani14's Avatar
      Join Date
      Aug 2012
      Location
      Australia
      Posts
      53
      Thanks (-->)
      11
      Thanks (<--)
      25
      Cheats'n'Trainers
      you can change
      BYTE ComboValue[] = {0, 0, 0, 0};
      to
      int ComboValue = 1629697;

    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [Help] C++ ESP AIMBOT SOURCE CODE GDI Drawing Source Code Help Please
      By PimpinRice in forum GH Tutorials Help
      Replies: 10
      Last Post: 10-25-2014, 04:14 PM