C++ ReadProcessMemory issue - help menu

User Tag List

Results 1 to 4 of 4
  1. #1
    vaflata's Avatar Private
    Reputation
    1
    Join Date
    Feb 2014
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C++ ReadProcessMemory issue - help

    Hi guys,
    I'm trying to read some values off the d3 process. I've located the base address of the game via the getBaseAddress function. The problem is that I'm not reading any data, value stays a constant, and data read = 0. It doesn't matter what offset I give to the baseAddr. Thank you in advance!
    Code:
     ...
                            cout << "Handle success...\n";
    		 	DWORD baseAddr = getBaseAddress(processId, _T("Diablo III"));
    
    			printf("Base Address: 0x%p\n", baseAddr); 
    			
    			float hp = 0;
    
    			//void* value; // pointer to the current location
    			DWORD value;
    
    			unsigned int count = 4096;
    			SIZE_T read = 0;
    
    			DWORD baseAddrOffset = baseAddr + 4;
    
    			ReadProcessMemory(hProcessHandle, (LPCVOID)(baseAddrOffset), &value, count, &read);
    			
    
    			printf("Memory Address: 0x%p\n", baseAddrOffset);
    			cout << "Value: " << value << endl;
    			cout << "Read: " << read << endl;

    C++ ReadProcessMemory issue - help
  2. #2
    KillerJohn's Avatar TurboHUD HUDmaster CoreCoins Purchaser Authenticator enabled
    Reputation
    3693
    Join Date
    Jul 2012
    Posts
    2,532
    Thanks G/R
    46/3335
    Trade Feedback
    0 (0%)
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    be sure you are running your VS and/or your project as administrator.
    Do not send me private messages unless it is absolutely necessary or the content is sensitive or when I ask you to do that...

  3. #3
    enigma32's Avatar Legendary
    Reputation
    912
    Join Date
    Jan 2013
    Posts
    551
    Thanks G/R
    4/738
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You get an error?

    "If the function succeeds, the return value is nonzero.
    If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.
    The function fails if the requested read operation crosses into an area of the process that is inaccessible."

  4. #4
    vaflata's Avatar Private
    Reputation
    1
    Join Date
    Feb 2014
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I just tried running as administrator, same thing. I took enigma's advice and checked the returned value of ReadProcessMemory. Output:
    Handle success...
    8388608
    GetLastError returned 3e6


    I tried to see what does the error message means and it turns out this:
    ERROR_NOACCESS
    998 (0x3E6)
    Invalid access to memory location.


    Code:
    hProcessHandle = OpenProcess(PROCESS_VM_READ , FALSE, processId);
    is what I'm doing. Should I not set the process access to VM_READ ? :confused:

    Well, I figured it out. I took the base address and tried it in a new project and I successfully read the memory of this process. Seems I've had a bad handle to the process or something.
    Last edited by vaflata; 02-05-2014 at 05:36 AM.

Similar Threads

  1. Replies: 4
    Last Post: 07-19-2014, 07:28 AM
  2. Dank Cellar teleporting issues HELP PLEASE!
    By aff3ct in forum Diablo 3 Bots Questions & Requests
    Replies: 0
    Last Post: 06-28-2012, 06:30 AM
  3. [Technical Issue] Help me please
    By jdismeuc in forum World of Warcraft General
    Replies: 0
    Last Post: 02-12-2008, 03:56 PM
  4. glider issues... help?
    By TheBlackLotus in forum World of Warcraft General
    Replies: 0
    Last Post: 08-13-2007, 03:22 AM
All times are GMT -5. The time now is 05:13 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search