Hello
Can i calculate the memory size of a running process
I get The baseaddr and Basesize with Module32First
mov ecx,hModule.modBaseAddr ;00400000
add ecx,hModule.modBaseSize ;14000
mov [hEndOfMem],ecx ;result 00414000
my result is 7362A265 why this?
greets
Vaguely I remember this being a characteristic of the PE header and I gather here you are talking about the range from the start address 400000h to the end of the loaded executable module. For a DLL you will need to get the start address with GetModuleHandle().
show all your code. it's not making sense
If you're already enumerating the process why not use GetProcessMemoryInfo ?
http://msdn.microsoft.com/en-us/library/ms683219%28VS.85%29.aspx
Also are you talking about physical or total memory, working set or actual usage, average minimum or peak usage ? Are you looking for the usage of just the main module or all modules in the process, do you want to know the heap and stack allocations as well ? When it comes to memory in Windows (or any modern OS) you have to specify exactly what usage statistic you are looking for.