Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible for a program to access another program's memory directly and read from (or write to) it, or to "inherit" the old contents of memory reclaimed from another program? (ie if it doesn't zero out memory before using it and just reads from unitialized memory directly)

share|improve this question

Ever since Windows XP and on, all major operating systems have this type of memory protection. One program will not be able to write to another program's memory.

It might be possible that a program could "reclaim" memory that was de-allocated from another program but it will not have the information that was previously stored within it.

share|improve this answer
Erm, such things predate Windows XP by quite some time. Every version of the Windows NT line has this. – Joey Sep 25 '09 at 19:47
Yeah you're right, I think this problem existed in Windows 9x, but was changed after. – Jordan L. Walbesser Sep 25 '09 at 21:16
Windows 9x is dead, its last gasp being Windows ME. Since then, all versions of Windows have been developments of Windows NT. So, whether or not the problem was later fixed in the Windows 9x codebase, it's fixed now. – David Thornley Sep 25 '09 at 21:50

I haven't written code for Vista nor Win7, but I can't imagine that their developer tool box doesn't include some type of shared memory mechanism.

share|improve this answer

I wouldn't be so sure that Windows 7 does implement memory protection because we can see that people are able to hack games (such as Diablo 2) or even programs developed on VB2008 to change the content of their variables. I tested it on a program I wrote in Visual Basic 2008 and attempted to change its variable's content with "Cheat Engine 5.6". It worked. So I guess either Windows 7 doesn't implement memory protection at all or it's disabled by default.

share|improve this answer
This is done using specialized debugging APIs. A process cannot access another process memory directly. – grawity Nov 25 '11 at 10:34

You must log in to answer this question.