Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → Here be [programming] dragons!
Here be [programming] dragons!
2007-11-16, 8:25 PM #1
OK I have a bit of a programming problem. I am trying to read the memory of other processes. I can do it, but the problem is some memory is protected so I can't read it. The Windows API function I'm using, ReadProcessMemory, fails if the start point I give it is at protected memory, even if some of the total memory range isn't protected... so, I can't tell where the protected memory area ends.

I have a less confusing and more thorough explanation here, which you should read.

So basically I need to figure out what ranges of a process' memory are protected without using trial and error. I can't find an API function for it. Help?

Here are some pretty pictures:

[http://x.mzzt.net/0039.jpg]

This is what happens when I read an entire block which is unprotected.

[http://x.mzzt.net/0040.jpg]

The same block, but except I went back 0x10 bytes into a protected area... the entire read failed, and I have no way of knowing where the protected block ends (well, I mean in a general sense).

2007-11-16, 8:30 PM #2
no idea but that was a pretty good read
2007-11-16, 8:34 PM #3
pfft :p

I have now fixed the link so it jumps to my post there.

2007-11-16, 9:34 PM #4
What a cool... Prof?
2007-11-17, 6:11 PM #5
I figured it out myself. THANKS FOR NOTHING MASSASSI. :eng101:

2007-11-17, 6:13 PM #6
We do what we must because we can.
"If you watch television news, you will know less about the world than if you just drink gin straight out of the bottle."
--Garrison Keillor
2007-11-17, 6:22 PM #7
for the people that are...
2007-11-17, 7:30 PM #8
Originally posted by The Mega-ZZTer:
I figured it out myself. THANKS FOR NOTHING MASSASSI. :eng101:


Care to share?

I've always wanted a PTE analyzer, but never been able to find one. I really don't care what's in those protected pages, but I just want to know exactly how my memory is being managed.
"Well, if I am not drunk, I am mad, but I trust I can behave like a gentleman in either
condition."... G. K. Chesterton

“questions are a burden to others; answers a prison for oneself”
2007-11-17, 7:38 PM #9
Check out my link in the first post, I made a reply to myself there explaining in detail what I did.

ALSO PIX (right click -> view): :v:

[http://x.mzzt.net/0042.png]

One thing I didn't say is to help me figure out everything I used CheatEngine... it's a game trainer tool but you can point it to any process, and it gives you useful debug info too. EX: If you select a process and click the "show" button in the middle of the dialog, it shows you a dump of all the information VirtualQueryEx can give for that process. Then you can right click and select all of the readable pages... this helped me make an expression to use the VirtualQueryEx output to figure out which pages are readable in my own program.

2007-11-17, 7:51 PM #10
I've played with Cheat Engine. It was a blast but I never really had time to discover it's full potential.
"Well, if I am not drunk, I am mad, but I trust I can behave like a gentleman in either
condition."... G. K. Chesterton

“questions are a burden to others; answers a prison for oneself”

↑ Up to the top!