Click to See Complete Forum and Search --> : Reading a Process Memory


sb101
November 24th, 2008, 06:51 PM
Hi folks,

I'm attempting to read memory of a specific Process. This works fine but the problem I'm having is that I would like to speed up the read and the main issue is that I'm doing a *massive* loop to read all the process memory and then keeping the information I require.

So, for example:


for (uint i = 0x00400000; i < 0x7FFFFFFF; i += buffer_count) {
memory = pReader.ReadProcessMemory((IntPtr)i, buffer_count, out bytesRead);
....... }


I think I can get the base address of the process using:


IntPtr startAddr = myProcess.MainModule.BaseAddress;


So I will replace 0x00400000 with startAddr but is there a way to tell where the Process memory ends? This would allow me to stop at a specific address rather than looping to 0x7FFFFFFF all the time.

Thanks all.
sb

sb101
December 2nd, 2008, 01:41 PM
I've had a look for any info on this with little success. Any thoughts would be appreciated.
Thanks.

Mutant_Fruit
December 2nd, 2008, 06:03 PM
Why do you want to do this?

sb101
December 3rd, 2008, 06:59 AM
I am attempting to write a trainer for a game. Basically change the process memory to have more "money" at the start of the game. I have found the memory location but it seems to change everytime a new game is started so I thought i could iterate through memory looking for the associated string and, once found, change the value.

This takes some time and I'm looking to reduce the area of memory I am searching if possible.

Jensecj
December 3rd, 2008, 09:13 AM
There's no need to do a "massive iteration", the reason the value changes is because its using a pointer to point to it, once you figure out the pointer its easy to write into the memory, you might want to check out this site (http://forum.cheatengine.org/), there's an entire tutorials section.