I want to call Windows' GetSystemInfo()
API function in C# in order to retrieve maximumApplicationAddress
and minimumApplicationAddress
for scanning the memory of the computer.
I wrote a simple program that outputs these value:
SYSTEM_INFO sys_info = new SYSTEM_INFO();
GetSystemInfo(out sys_info);
Console.WriteLine("Min Address: {0:X}", sys_info.minimumApplicationAddress.ToUInt64());
Console.WriteLine("Max Address: {0:X}", sys_info.maximumApplicationAddress.ToUInt64());
When I run this program, by the debugger(using the Start button), it shows this:
Min Address: 10000
Max Address: 7FFEFFFF
But when I build it, and run the executable file, it shows this:
Min Address: 10000
Max Address: FFFEFFFF
The difference between Max Addresses is a little strange to me. Can you please explain the reason?