Did any of you face the following problem when you try to overwrite the $esp
pointer?
Of course trying a legit buffer size always works! But, when you try to increase the buffer size to overwrite the $esp
and you manage to success to touch the first byte, second byte, or third byte of $esp
it works perfectly. But, as soon as you try to overwrite the whole 4 bytes of the $esp
it totally changes the content of it as well as the address. It doesn't show 41
s any more as I used "A"s to fill the buffer. I've attached a screen shot maybe it will explain in more details. Thanks all.
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv)
{
char buffer[500];
strcpy(buffer, argv[1]);
return 0;
}