I am going through a tutorial which shows you how to exploit a stack based buffer overflow in a sample C program. The C code is:
#include <string.h> void function(char *str) { char buffer[1024]; strcpy(buffer,str); } int main(int argc,char *argv[]) { char aaa[500]; function(argv[1]); } As per the author if we write 1032 'A's, we should be able to see 'AAAA' in the EIP register. I understand the theory behind it. However, running it on Windows 7 32 bit and debugging it with Immunity Debugger, it says "Process terminated exit code C0000409". EIP instead points to "ntdll.RT lUserThreadStart". Please advise.