Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 使用GDB和Info Reg命令失败。Can';似乎找不到ebp、eip和esp值_Linux_Gdb_Overflow_Buffer_Eip - Fatal编程技术网

Linux 使用GDB和Info Reg命令失败。Can';似乎找不到ebp、eip和esp值

Linux 使用GDB和Info Reg命令失败。Can';似乎找不到ebp、eip和esp值,linux,gdb,overflow,buffer,eip,Linux,Gdb,Overflow,Buffer,Eip,我对GDB有问题。我现在正在研究缓冲区溢出,我需要运行命令$Info reg,以查找有关ebp、eip和esp的信息,但我没有得到任何结果。我尝试了Info reg$name,但只有ebp有效 基本上是这样的: (gdb) i r rax 0x7fffffffe180 140737488347520 rbx 0x0 0 rcx 0x7fffffffe570 140737488348528 rdx

我对GDB有问题。我现在正在研究缓冲区溢出,我需要运行命令
$Info reg
,以查找有关
ebp
eip
esp
的信息,但我没有得到任何结果。我尝试了
Info reg$name
,但只有
ebp
有效

基本上是这样的:

(gdb) i r
rax            0x7fffffffe180   140737488347520

rbx            0x0  0

rcx            0x7fffffffe570   140737488348528

rdx            0x7fffffffe1a6   140737488347558

rsi            0x6  6

...

...

...



es             0x0  0

fs             0x0  0

---Type <return> to continue, or q <return> to quit---+

gs             0x0  0
但是


如何获取这些内存部分的值?

在amd64 arch中没有名为
eip
的reg

让我来说明什么是
bp
/
ebp
/
rbp
,数据寄存器在amd64 arch上包含64位:

64 ---------------------------- 32 ---------- 16 ---- 8 ---- 0
| <--------------------------- rbp ------------------------> |
                                 | <--------- ebp ---------> |
                                               | <--- bp --> |
64------------------32-----------------16----8----0
|  |
|  |
|  |
因此,您可以使用不同的名称访问相应的位


但是您总是作为一个整体访问
rip
,因为没有理由访问
指令指针的低位,因此,amd64 arch中没有
eip
/
ip
寄存器

我还没有研究所有64位的内容,但是在i386中,bh和bl是bx的一部分,而不是bp。如果他们在amd64中改变这一点,我会感到惊讶。
(gdb) info reg $eip

Invalid register `eip'
64 ---------------------------- 32 ---------- 16 ---- 8 ---- 0
| <--------------------------- rbp ------------------------> |
                                 | <--------- ebp ---------> |
                                               | <--- bp --> |