Results 1 to 4 of 4
  1. #1
    ~BlackMaster~'s Avatar
    Join Date
    May 2014
    Gender
    male
    Location
    ummm... :B
    Posts
    48
    Reputation
    10
    Thanks
    4
    My Mood
    Amused

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

  2. #2
    Nordiii's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    150
    Reputation
    61
    Thanks
    733
    My Mood
    Angelic
    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

  3. #3
    殺す必要がある唯一のものは殺されるために準備され人 々である。
    Premium Member
    Hitokiri~'s Avatar
    Join Date
    Oct 2012
    Gender
    female
    Location
    Cancer.
    Posts
    1,201
    Reputation
    24
    Thanks
    937
    My Mood
    Bitchy
    Try this instead of cin:

    Code:
    getline(std::cin, &string );
    Have you also verified the offset indeed contains a non-zero value?

  4. #4
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    https://msdn.microsof*****m/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.
    Last edited by MarkHC; 05-20-2014 at 10:19 PM.


    CoD Minion from 09/19/2012 to 01/10/2013

Similar Threads

  1. MW3? I think not!
    By Impakt in forum Call of Duty Modern Warfare 2 Discussions
    Replies: 28
    Last Post: 06-29-2010, 11:56 AM
  2. ReadProcessMemory
    By Void in forum C++/C Programming
    Replies: 17
    Last Post: 04-03-2010, 07:12 AM
  3. MW3
    By A⁴ in forum General
    Replies: 71
    Last Post: 03-07-2010, 07:47 AM
  4. Mw3 o.O
    By jmend736 in forum General
    Replies: 35
    Last Post: 11-24-2009, 10:50 PM
  5. Write/ReadProcessMemory errors
    By Dragonion in forum General Game Hacking
    Replies: 0
    Last Post: 09-23-2008, 08:11 AM