ReadProcessMemory();

This is a discussion on ReadProcessMemory(); within the C++ Programming forums, part of the General Programming Boards category; k i went to msdn in search of a way to read a memory location and came up with that ...

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    57

    ReadProcessMemory();

    k i went to msdn in search of a way to read a memory location and came up with that function right there only one problem it has all the explanation at msdn but i don't get it all. So i was wondering if u guys could help.

    K so here is what i got

    for example the procces name is my.exe
    The adress is 3C2D74 at client.dll (from cheat engine adress thing)
    4 bytes if needed

    Ok so when ever i have that in the table and i go into the game and choose ther process from cheat engine, then i do what ever i do in the game and i can see it is a boolean cause it is 0 or 1.

    So if i was using
    ReadProcessMemory();
    can something please tell me what it would look like to acces that, i spend more then 2 hours trying but no luck. thanks

    O and if there are better ways to get a value from an andress i am listening.

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    That address makes no sense. and is probably an offset in the executable file. An executable should load that DLL, which you should find out about. This will give you two things to help you use that API. You can get a handle to the process which loads the DLL. And you can get the RVA of that variable, once it is loaded at some base address.

  3. #3
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    K i think i am getting somethign mixed up... If u ever used program called tsearch it is a memory editor ok well i searched for a value and got adress 3C2D74 and it said in client.dll. k if someine could explain how to get it right and what does RVA stand for?
    Thanks

  4. #4
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Isn't this against the rules? (wait.. wtf? 'guidelines'?)
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  5. #5
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    All i did is brought up and example because i really don't get the way memmory works and how to get the readproccesmemmory to work cause if i get taht one to work normally i can get the rest pretty easy thanks

  6. #6
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    First, this probably belongs in the Windows forum.
    Second, I don't think using ReadProcessMemory() the way the OP uses it violates the rules. This can, of course, be debated all day.

    OP: First, your post is written in such poor English answering it is guesswork. But we'll try. You mention BOOL, and being only 1 or 0. ReadProcessMemory returns a BOOL, and all the return value means is if the function suceeded or not. You should be passing (parameter #3) a buffer to store the data that is to be read from the other process. The value that was at that location is copied to your buffer. How are you calling ReadProcessMemory?
    Reword your post into English, and perhaps provide a code example to aid the forum in finding your problem.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    If you don't understand how memory in a modern OS works, then ReadProcessMemory is not for you. Too little to get right, too much to get wrong.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    K then any guides i can search up. Even some kind of keywords i can use

  9. #9
    adr
    adr is offline
    Registered User
    Join Date
    Dec 2005
    Posts
    155
    I know how this works b/c i've ask befor... I think you if search on the forum you will find a post by me. If not just say and I can tell you more about it.

    and CornedBee right... if you do mass up you can mass up your computer really bad.

  10. #10
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,581
    How about... just thinking here, don't mind me. I'm not even here, really... but how about you first tried to learn C++ and how your operating system works, before trying to mess with it?

    Just a thought.

    EDIT: I just think the best way to learn about ReadProcessMemory() and how it works is to start with std::cout.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #11
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    There can't be guides for every function in the Win32 API. (Our heads would spin.) Instead, get good with C or C++, learn how the language works, and after a bit of intro to Win32, you learn to read the manual pages which describe how to call the function, what to pass to it, and how/what it will return. (All easier said than done. Takes a few years, start to finish.)

    Quote Originally Posted by adr
    if you do mass up you can mass up your computer really bad.
    Actually, I can do quite a bit of damage and my computer masses just about the same every time. And I try not to mass up too much - massing down is much more rewarding.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  12. #12
    Registered User
    Join Date
    Sep 2005
    Posts
    57
    Well i think i know most of C++ just the way the language works. I ave done 2 years of C++ in my high school and we started doing Allegro but i have no clue about win32 and it be cool to learn a bit about it. Any place i can start?

  13. #13
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,762
    One that is commonly cited around here.
    http://www.winprog.org/tutorial/
    and one that a mod from CProg made himself; it will teach you how to code Windows consoles in API, and a few other things.
    http://www.adrianxw.dk/SoftwareSite/index.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with ReadProcessMemory function
    By MattZimmerer in forum C Programming
    Replies: 16
    Last Post: 10-30-2008, 10:21 PM
  2. ReadProcessMemory Error
    By Scarvenger in forum Windows Programming
    Replies: 10
    Last Post: 05-28-2008, 05:47 PM
  3. ReadProcessMemory
    By brietje698 in forum C++ Programming
    Replies: 2
    Last Post: 10-14-2007, 08:37 AM
  4. ReadProcessMemory() help
    By Anddos in forum C++ Programming
    Replies: 7
    Last Post: 08-08-2006, 11:55 AM
  5. ReadProcessMemory()
    By Josh Kasten in forum Windows Programming
    Replies: 2
    Last Post: 06-19-2003, 01:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21