Home > Mobile >  Is it possible to get program start and end addresses using GetSystemInfo() in C?
Is it possible to get program start and end addresses using GetSystemInfo() in C?

Time:07-05

I'm currently learning windows.h lib. According to docs, it is possible to know the minimum and maximum program addresses by means of lpMinimumApplicationAddress and lpMaximumApplicationAddress fields of SYSTEM_INFO structure, GetSystemInfo() function. However, I'm wondering: is it possible to get program start and end address, using GetSystemInfo()? If possible, how? Thank you for advance.

CodePudding user response:

If you mean the actual address that program terminates on (or whether it terminates at all), no. That is just a variation on the famous halting problem. And that has been proven to not have a general solution.

Minimum and maximum address are just what memory has been assigned to a process, but there could be many places in it that the program would terminate at, depending on the exact run parameters. And it might not even reach any of them.

  • Related