ReadProcessMemory in MW3

Posts 1–4 of 4 · Page 1 of 1
ReadProcessMemory in MW3
Hi,


I wanted to read the XUID and the Steam ID in MW3 and I used the offsets from the MW3 Addresses/source code thread. But it always return a 0 value for both.
Can someone help?

Code:
/*Value Reader by BlackMaster*/

#include <iostream>
#include <Windows.h>
#include <string>

using namespace std;

DWORD _address_XUID = 0x05A7B1D8;
DWORD _address_STEAMID = 0x05CCB272;
DWORD processID;
HWND hwnd;

DWORD player_STEAMID;
DWORD player_XUID;


bool isEnabled(){
	

	std::cout << "=================================\n" << "Value Reader by BlackMaster\n" << "=================================\n";

	Sleep(500);
	std::cout << "Open the MW3 Window and press [ENTER]..\n";
	std::cin.ignore();

	/* Begin */
	hwnd = FindWindow(NULL, L"Call of Duty®: Modern Warfare® 3 Multiplayer");

	if (!hwnd)
	{
		// failed.
		std::cout << "Could not find window. \n";
		std::cin.get();
		return false;
	}

	std::cout << "Trying the MW3 Process..\n";
	GetWindowThreadProcessId(hwnd, &processID);
	std::cout << "Done!\n" << "Reading from Memory..\n";
	HANDLE pHandle = OpenProcess(PROCESS_VM_READ, 0, processID);

	if (!pHandle)
	{
		std::cout << "Unable to read from memory..\n" << "Try restarting as Admin..\n";
		std::cin.ignore();
		return false;
	}

	std::cout << "Reading complete [100%] \n" << endl;

	return true;
}

int main()
{
	isEnabled();
	if (isEnabled)
	{

		while (true)
		{
			std::cout << ">>\n";
			string input;
			cin >> input;

			if (input == "XUID")
			{	
				// print the GUID.
				ReadProcessMemory(hwnd, (void*)_address_XUID, &player_XUID, sizeof(player_XUID), 0);
				std::cout << "XUID ===> " << player_XUID << "\n";
			}

			if (input == "STEAM")	
			{
				ReadProcessMemory(hwnd, (void*)_address_STEAMID, &player_STEAMID, sizeof(player_XUID), 0);
				std::cout << "STEAM ID ===> " << player_STEAMID << "\n";
			}

		}

	}
	else {
	
		std::cout << "ENABLED..\n";

	}

	return 0;
}
Hm my c++ isn't the best but as far as i can see it's nothing wrong.

Did you check the addresses with CheatEngine (when possible)? or find them by your self ^^ the address forum isn't uptodate most of the time as I know may this have change?!
May it help when you check the address there

Sincerely Nordiii
Try this instead of cin:

Code:
getline(std::cin, &string );
Have you also verified the offset indeed contains a non-zero value?
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.
GetLastError exists for a reason. See what it returns.

PS: FYI, You also need PROCESS_VM_OPERATION in addition to PROCESS_VM_READ to get access to a process. That may be the error cause.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us