简体   繁体   中英

examine command in gdb?

A number can also be prepended to the format of the examine command to examine multiple units at the target address.

source: hacking the art of exploration

(gdb) x/2x $eip
0x8048384 <main+16>:   0x00fc45c7 0x83000000

(gdb) x/x $eip
0x8048384 <main+16>:   0x00fc45c7

I know that the second examine command returns the memory address that eip is currently locating. What about the first one which returns two memory address?

The examine command of gdb has the following syntax:

x/[n][f][u]

where n , f and u are optional and n is the length, f the format and u the unit size.

Possible formats are:

  • s (null terminated string)
  • i (machine code instruction)
  • x (hexadecimal value)

If no unit size can be one of the following values:

  • b (bytes)
  • h (2 bytes)
  • w (4 bytes)
  • g (8 bytes)

where w is the default.

Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM