I need help from someone who knows whats going on.
I am starting on Shellcoders Handbook and I am already experiencing difficulties on chapter 2 overflow.c
The idea is that I have to put the adress of call to return_input into adress after function return_input ends.
0x08048422 <+0>:push %ebp
0x08048423 <+1>:mov %esp,%ebp
0x08048425 <+3>:and $0xfffffff8,%esp
0x08048428 <+6>:call 0x8048404 <return_input>
0x0804842d <+11>:mov $0x0,%eax
0x08048432 <+16>:leave
0x08048433 <+17>:ret
0x08048404 <+0>:push %ebp
0x08048405 <+1>:mov %esp,%ebp
0x08048407 <+3>:sub $0x28,%esp
0x0804840a <+6>:lea -0x1e(%ebp),%eax
0x0804840d <+9>:mov %eax,(%esp)
0x08048410 <+12>:call 0x8048310 <gets@plt>
0x08048415 <+17>:lea -0x1e(%ebp),%eax
0x08048418 <+20>:mov %eax,(%esp)
0x0804841b <+23>:call 0x8048320 <puts@plt>
0x08048420 <+28>:leave
0x08048421 <+29>:ret
Basically what I need to do is put "\x28\x84\x04\x08" at end of 36 A's as piped input to ./overflow. Whenever I do that I just get segmentation failure and it doesn't return the input twice but just once.
Am I putting too much/little of A's? Am I fuarrrking up something?
I already had to do -fno-stack-pointer to allow me to smash the stack, is there any other flag I need to put up?
Thanks in advance