I need a litle help to read a pmemory adress in c++ menu

User Tag List

Results 1 to 2 of 2
  1. #1
    [-gvd-]'s Avatar Member
    Reputation
    1
    Join Date
    Oct 2009
    Posts
    12
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I need a litle help to read a pmemory adress in c++

    I have a litle, propabely easy isue. i been readig this forums and google alot but i cant find answers.

    i have found some memmory adressess in cheatengine.
    00CBBBD0
    00CBBBD4
    00CBBBE0

    49D1D0E0
    39D1D0E4

    i placed the adressess seperated wich are related.
    do i need to find a base adress then and offsets? And how do i have to do that or can i simply read the adresses like that.

    that brings me to the next problem.
    how should i retrieve the value of these adresses and cout them with c++
    the adresses are from a game thus not from the application i try to make.

    i have used this code i found on the forum and i tryed to edit it some but i cant get it to work. i guess i go wrong with the propper adresses.

    Code:
    #include <windows.h>
    #include <iostream>
    #include <conio.h>
    
    using namespace std;
    
    int main()
    {
    	HWND WarWindow = ::FindWindow(0, "Warhammer: Age of Reckoning, Copyright 2001-2009 Electronic Arts, Inc.");
    	
    	DWORD pid;
        GetWindowThreadProcessId(WarWindow, &pid);
        
        /*
        Had some troubles with
        getting PROCESS_ALL_ACCESS
        work with Windows Vista.
        Should be working now though.
        */
    	HANDLE h_Proc = OpenProcess(PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, false, pid);
    
    	if(!WarWindow)
    	{
            cout << "Warhammer not found\n";
            cin.get();
            return 0;
        }
        
        /*
        addr is the adress where our player
        pointer is stored.
        */
    	int BaseAdress;
    	int addr = 13351888;
    
    	/*
    	Get the base adress from the player pointer adress
    	*/
    	if(ReadProcessMemory(h_Proc, (void*)(addr), &BaseAdress, sizeof(int), NULL) == 0)
    	    cout << "Could not read memory, sure WAR is running?" << endl;
    	    
        struct Waypoint{
            float X;
            float Y;
            };
        
        Waypoint myWaypoint;
        
        /*
        Read the memory at our
        X & Y adresses.
        */
        
        cout<<ReadProcessMemory(h_Proc, (void*)(BaseAdress+(int)0x2c), &myWaypoint.X, sizeof(float), NULL);
        cout<<ReadProcessMemory(h_Proc, (void*)(BaseAdress+(int)0x28), &myWaypoint.Y, sizeof(float), NULL);
    	cin.get();
    }
    i dont remember who was the author of this code.
    So can anyone help me out here how to convert my adresses into a base + offset or edit the code so it will work with the adresses i found.

    thanks in advance, greetings

    I need a litle help to read a pmemory adress in c++
  2. #2
    LongBow's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not exactly sure what you are having trouble with. If you have some specific questions I can try to answer them for you. It just looks like you posted a jumble of "I don't know what I'm doing! Here's some random code I copied!"...

    I would suggest first attempting to create a function which will read memory out of another process instead of trying to do all the intermediate steps inline with the rest of your code. It might make it easier for you to understand what you are doing. Your process will also need debug privileges before you can start to access another process.

    As far as privileges go, you might want to take a look at this: Enabling and Disabling Privileges in C++ (Windows)

Similar Threads

  1. Need help please read please!
    By Greenmane in forum World of Warcraft General
    Replies: 1
    Last Post: 08-31-2016, 04:31 AM
  2. Replies: 3
    Last Post: 07-30-2012, 12:17 PM
  3. Need help please read SIG and icon's
    By DatGuyShenmue in forum Art & Graphic Design
    Replies: 2
    Last Post: 04-24-2012, 05:56 PM
  4. NEED HELP plz read
    By Kazard123 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 03-05-2008, 06:08 AM
  5. Need Help, Please Read!
    By Fenarth in forum World of Warcraft General
    Replies: 5
    Last Post: 08-12-2007, 10:57 AM
All times are GMT -5. The time now is 01:43 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