[C++] Reading from program memory

Questions about programming languages and debugging
Post Reply
User avatar
JoGi86
Newbie
Newbie
Posts: 2
Joined: 04 Oct 2006, 16:00
17

[C++] Reading from program memory

Post by JoGi86 »

Hi
(I've been wondering if this belong to "newbie" of "coding" section... feel free to move if i've chosen wrong)


I'm looking for a source of simple program that looks for open proces "foo.exe" and if found reads content from $111111 and $222222 of this process memory and stores it in two variables.

This'd be great if you could provide me with sample code and some good .pdf's about this topic

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

In C++, this would probably be referred to as "pointers". Pointers point to a memory space where a variable is held, so i imagine you should start there, maybe? try http://cplusplus.com Have fun :)
¯\_(ツ)_/¯ It works on my machine...

User avatar
Nerdz
The Architect
The Architect
Posts: 1127
Joined: 15 Jun 2005, 16:00
18
Location: #db_error in: select usr.location from sucko_member where usr.id=63;
Contact:

Post by Nerdz »

Hmmm are you talking about a BufferOverflow?
Give a man a fish, you feed him for one day.
Learn a man to fish, you feed him for life.

pseudo_opcode
cyber messiah
cyber messiah
Posts: 1201
Joined: 30 Apr 2006, 16:00
17
Location: 127.0.0.1

Post by pseudo_opcode »

Correct me if i m wrong but if you are talking about getting the address of data from already running program by using another program, its not possible,even the compiler cannot create the code which can get the address of the variable it has not assigned itself.

This leaves you to direct addressing, but how will you know the content you are looking for is stored in which address?

I dunno but your question is not clear.

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

I think he's asking about how to perform similar functions as in the program Tsearch, which can be found here: http://en.wikipedia.org/wiki/Tsearch
¯\_(ツ)_/¯ It works on my machine...

pseudo_opcode
cyber messiah
cyber messiah
Posts: 1201
Joined: 30 Apr 2006, 16:00
17
Location: 127.0.0.1

Post by pseudo_opcode »

lol i was also about to mention that, and also about how trainers work etc, but i decided to restrict myself, as i tend to get out of scope and resulting posts are long and read by no one.

User avatar
JoGi86
Newbie
Newbie
Posts: 2
Joined: 04 Oct 2006, 16:00
17

Post by JoGi86 »

gogeta70 wrote:I think he's asking about how to perform similar functions as in the program Tsearch, which can be found here: http://en.wikipedia.org/wiki/Tsearch
That's exacly i want to do - i found adresess ( using Tsearch) where game stores hp, ammo, armor ect and i want to make program that displays those values in separate window...

Post Reply