I am working with this INE eCXD material and I am working on my basics of buffer overflow on Linux.
In the lab, there is supposed to be a binary that is using the strcpy()
function and it SEGFAULTS when it reaches that function.
I loaded the binary in GDB-PEDA and set a breakpoint at strcpy()
.
When I run the binary it pauses at my breakpoint.
but when I view the registers it shows up like the below image.
At this point I am supposed to investigate starting from the ESP.
What I don't get it is why does the ESP ( and of course the other registers) looks like that ?
ESP: 0xffffd2cc --> 0x8048493 (add esp,0x10)
Isn't the ESP supposed to hold one address, so what does it mean when in looks like that?
One more thing:
When I read the write up, I found that they examined the 0x8048493
as a return address which I didn't get, but I am going along with it at the moment.
They started examining the address using this instruction
x/20i 0x08048493-20
[Which basically means examine 20 instructions starting from the mentioned address].
The result was:
By mistake I entered the below instruction:
x/20i 0x08048493
[dropped the 20]
which resulted in the below results
I want to know why both of the results are different, isn't it supposed to mean to examine the next 20 instructions starting from the given address.