简体   繁体   English

检查gdb中的命令?

[英]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. 我知道第二个检查命令返回eip当前正在定位的内存地址。 What about the first one which returns two memory address? 那么第一个返回两个内存地址的地址呢?

The examine command of gdb has the following syntax: gdb的inspect命令具有以下语法:

x/[n][f][u]

where n , f and u are optional and n is the length, f the format and u the unit size. 其中nfu是可选的, n是长度, f是格式, u是单位大小。

Possible formats are: 可能的格式为:

  • s (null terminated string) s(以空终止的字符串)
  • i (machine code instruction) 我(机器代码指令)
  • x (hexadecimal value) x(十六进制值)

If no unit size can be one of the following values: 如果没有单位大小,则可以是以下值之一:

  • b (bytes) b(字节)
  • h (2 bytes) h(2个字节)
  • w (4 bytes) w(4个字节)
  • g (8 bytes) g(8个字节)

where w is the default. 其中w是默认值。

Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment. 因此, x/2x从您的代码段中打印2个十六进制值,大小为4个字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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