I have the following code and I'm trying to buffer overflow it.
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv){
char buffer[10];
strcpy(buffer, argv[1]);
return 0;
}
When I run run AAAAAAAAAAAAAAAAAAAA on gdb I get the following output
Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()
When I try to give my string of As through a file or a python script I get the following
(gdb) run < attack.txt
Program received signal SIGSEGV, Segmentation fault.
0x08055718 in __strcpy_sse2 ()
I get the same output with the following command
(gdb) run <<< $(python -c 'print("\x41"*20)')
So what exactly is happening here?