gdb - Examine
(gdb) help x
Examine memory: x/FMT ADDRESS.
ADDRESS is an expression for the memory address to examine. FMT is a repeat count followed by a format letter and a size letter. Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal), t(binary), f(float), a(address), i(instruction), c(char) and s(string). Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).
The specified number of objects of the specified size are printed
according to the format.
- o - Display in octal.
- x - Display in hexadecimal.
- u - Display in unsigned, standard base-10 decimal.
- t - Display in binary.
- f - Display in float
- a - address
- i - instruction
- c - char
- s - string
- b - A single byte
- h - A halfword, which is two bytes in size
- w - A word, which is four bytes in size
- g - A giant, which is eight bytes in size
(gdb) x/s $eip
0x8048415 <main+9>: "\307D$\034"
(gdb) x/o main
0x804840c <main>: 0125
(gdb) x/x main
0x804840c <main>: 0x55
(gdb) x/u main
0x804840c <main>: 85
(gdb) x/t main
0x804840c <main>: 01010101
(gdb) x/b
0x804840d <main+1>: 10001001
(gdb) x/h
0x804840e <main+2>: 1000001111100101
(gdb) x/w
0x8048410 <main+4>: 11101100100000111111000011100100
(gdb) x/g
0x8048414 <main+8>: 0000000000000000000000000001110000100100010001001100011100100000
(gdb) x/x
0x804841c <main+16>: 0x84d02404c711eb00
(gdb) x/b
0x8048424 <main+24>: 0x04
(gdb) x/h
0x8048425 <main+25>: 0xe808
(gdb) x/w