I'm trying to understand the connection between the stack content at
call 0x555555554580 <printf@plt>
if you execute printf("%lx%lx%lx%lx%lx%lx"). Assume my stack looks like
0x00007fffffffd850│+0x0000: 0x0000000000000001
0x00007fffffffd858│+0x0008: 0x0000000000000002
0x00007fffffffd860│+0x0010: 0x0000000000000003
0x00007fffffffd868│+0x0018: 0x0000000000000004
before the call <printf@plt>, which value would i normally expect to get back? If i test it in gdb i normally get:
a b c d e 1 2 3 4 ...
where a,b,c,d,e where not on my stack before the call to printf. I assume they where values which where pushed on the stack during the execution of printf. But what is buffling me is that if i do one step into the call of printf@plt. The instruction pointer is pushed onto the stack, so that it will look like this:
0x00007fffffffd848│+0x0000: value of $rip
0x00007fffffffd850│+0x0008: 0x0000000000000001
0x00007fffffffd858│+0x0010: 0x0000000000000002
0x00007fffffffd860│+0x0018: 0x0000000000000003
0x00007fffffffd868│+0x0020: 0x0000000000000004
Now i would expect my output to contain this value of $rip at output e. But this is not the case. I would be grateful if you could tell my why i don't find this stack value on my output or some content that does go deeper how exactly printf("%x") access the stack.