First off, the size of a pointer is always the same.
I am assuming you want to find out how big the buffer on the stack is that is used in the strcpy()
.
You can not tell the exact size of the buffer. What you can tell is the following.
0x00000000004005d7 <+0>: push %rbp
0x00000000004005d8 <+1>: mov %rsp,%rbp
0x00000000004005db <+4>: add $0xffffffffffffff80,%rsp
After the function prologue the stackpointer is decremented by 128 (0xffffffffffffff80 = -128). So we have space for 128 bytes of local variables.
0x00000000004005e7 <+16>: lea eax, [epb-120]
0x00000000004005eb <+20>: mov %rdx,%rsi
0x00000000004005ee <+23>: mov %rax,%rdi
0x00000000004005f1 <+26>: callq 0x400480 <strcpy@plt>
Now, before the strcpy()
the address of %ebp-120
is loaded into %eax
which is moved to %rdi
which in turn is used to pass the argument to the call to strcpy()
.
%ebp-120
tells us that the buffer starts 120 bytes below %ebp
. So if there is no other variable between %ebp
and ebp-120
we can assume that the buffer is 120 bytes in size.
Please comment if this is unclear and i will try to improve the explanation.