I started learned windbg and I found this good post How to use WinDbg to analyze the crash dump for VC++ application?
Now I want to follow the instructions and do it
I used the code below when testing out WinDbg some time ago.
#include "stdafx.h"
#include "stdio.h"
#include "malloc.h"
void Function2(int * ptr2)
{
for(int i=0; i < (2 * 1024); i++)
{
*ptr2++ = 0xCAFECAFE;
}
}
void Function1()
{
int * ptr1 = (int *)malloc(1024 * sizeof(int));
Function2(ptr1);
}
int _tmain(int argc, _TCHAR* argv[])
{
printf("Press enter to allocate and corrupt.\r\n");
getc(stdin);
printf("Allocating and corrupting...\r\n");
Function1();
printf("Done. Press enter to exit process.\r\n");
getc(stdin);
return 0;
}