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;
}