I cannot figure out why GDB is returning different results when examining RAM addresses, depending on whether I examine my string beforehand or not:
Examining further addresses shows that 0x401111 is essentially 0x401110 shifted by 1 byte and so on. I'm wondering which one is accurate, whether 0x401110 is actually referring to 4 bytes or a single byte. Both results + x86_64 Assembly source code
help x
says:
Defaults for format and size letters are those previously used.
Apparently the s
format implicitly sets the size to byte size.
You can manually specify the size by adding a b
or w
size specifier:
x/xw 0x401110
(32-bit)
x/xb 0x401110
(8-bit)