Is there a way to (read-only) access any arbitrary memory location without running into an access violation? I thought that each process has its own virtual adress space and that it can read all available memory locations…seems not to be the case, since my program hangs if I do something like
var
IntPtr : PInteger;
AnInteger : Integer;
...
IntPtr := $100;
AnInteger := IntPtr^;
I’m still trying to write my low-level recursive size-of function and try to detect if a data member is an object reference or not.
Thanks!
You can only access your own process’ memory via pointers, and even then it’s only those parts that have been mapped for your process. There are debugger hooks that will give you access to other processes memory; but they’re tricky to get right.
So if you really want to iterate through your process memory, you can probably find the functions that you need here: http://msdn.microsoft.com/en-us/library/ms878234.aspx
AFAIR in windows also part of kernel is mapped to your processes memory space (which is the reason to not have all of 4G available for your process).