Archive

Posts Tagged ‘opengl’

MemSpyy

April 27th, 2009 pj4533 4 comments

memspyy

Recently over at If broken it is, fix it you should, Tess Ferrandez posted about a cool memory application that uses output gathered from windbg to show you information graphically. I have written a similar application a few months back, and thought I would scrub it, and share the source. I originally used VisualStudio 2003, but loaded it into 2008, and verified it all builds & runs. I did get a bunch of warnings.

The most interesting thing about this application is that it uses some DLLInjection code from Robert Kuster to run some heap walking code inside the process being viewed. This is the code in question:

MEMORYSTATUSEX statex;statex.dwLength = sizeof (statex);

GlobalMemoryStatusEx (&statex);

g_UncommittedSize = statex.ullAvailVirtual;

PROCESS_HEAP_ENTRY heapEntry;memset(&heapEntry,0,sizeof(heapEntry));

while(HeapWalk(GetProcessHeap(), &heapEntry))     g_UncommittedSize += heapEntry.cbData;        

Fairly straightforward code, but I can’t figure out how to get that information out of proc.

I thought this would be a good chance to try out CodePlex as well, so I uploaded the source there. CodePlex is pretty nice, basically very similar to GoogleCode and other sites. I was initially excited to try out some VisualStudio integration, but I couldn’t get it to install properly, and got frustrated. I ended up just using TortoiseSVN.

MemSpyy on CodePlex