my doubt is the following: assuming Ubuntu 14.04 32bit and x_86 intel atom cpu how many bytes does the format %x read from stack? I know that I can read what's in the stack by using:
formatstring="%x";
printf(formatstring);
As I put more %x
in the formatstring, more data are read from the stack.
Since %x
takes 4 bytes
, every %x
should read 4 bytes
from the stack, so for example if the 1st %x
read what's written at the address 0x0
the 2nd
will read what's at address 0x4
and so on.. (obviously the numbers are just for me to make the explanation easier). Is this assumption correct? It seems not since when I tried in an exercise to calculate the address of a var doing known_address + (numberof %x untill_the_var_value_is_printed )* 4
I found a wrong address.