简体   繁体   English

GDB检查命令混乱

[英]GDB examine command confusion

This might sound incredibly nooby, but I am really trying to understand the inner workings of code instead of just sticking to higher level concepts. 这可能听起来令人难以置信,但我真的想要了解代码的内部工作方式,而不仅仅是坚持更高层次的概念。

So my problem is this. 所以我的问题是这个。 I am currently reading the "Art of Hacking and exploitation" and while the author is explaining GDB command he comes to explain how to examine a certain memory address. 我目前正在阅读“黑客攻击和剥削艺术”,而作者正在解释GDB命令,他来解释如何检查某个内存地址。

My issue is with the output of the command 我的问题是命令的输出

(gdb) x/x $eip

I understand that x stands for hexadecimal, what I don't understand is why is it showing this: 我理解x代表十六进制,我不明白为什么它显示为:

0x8048384  <main+16>:  0x00fc45c7

If I run ir eip the output is 0x8048384, shouldn't then both outputs from x/x $eip be 0x8048384? 如果我run ir eip输出是0x8048384,那么不应该从x/x $eip两个输出都是0x8048384?

On a related topic, what is the purpose of something such as 在一个相关的主题上,诸如此类的东西的目的是什么

(gbd) x/2x $eip

He says that it is to examine multiple units at the same address, how can there be multiple units in one address? 他说,要检查同一地址的多个单位,一个地址中有多个单位? maybe I am misunderstanding the concept behind memory addresses. 也许我误解了内存地址背后的概念。 I thought that a memory location could hold 1 thing only. 我以为内存位置只能容纳1件事。

I apologize again if this seems like a dumb question. 如果这看起来像一个愚蠢的问题,我再次道歉。 I would gladly appreciate help and links to further study. 我很乐意感谢帮助和进一步学习的链接。 I really want to understand this. 我真的很想了解这一点。

In the first example (x/x $eip), the first value displayed (0x8048384) is the address of the next instruction to be executed, while the second value displayed (0x00fc45c7) is the value FOUND at that address, ie the binary value of the next instruction to be executed. 在第一个示例(x / x $ eip)中,显示的第一个值(0x8048384)是要执行的下一条指令的地址,而显示的第二个值(0x00fc45c7)是该地址的值FOUND,即二进制值要执行的下一条指令

As to your second example (x/2x $eip), the "multiple units" are not at the SAME address, but STARTING at the given address... for example, the first value shown (assuming $eip is the same as in your first example) at address 0x8048384 would still be 0x00fc45c7, but the next value would be whatever value is in the next address, 0x8048388. 至于你的第二个例子(x / 2x $ eip),“多个单位”不在SAME地址,而是在给定地址开始...例如,显示的第一个值(假设$ eip与你的第一个例子)在地址0x8048384仍然是0x00fc45c7,但下一个值将是下一个地址0x8048388中的任何值。 "x/x" is ideal for dumping the values of a RANGE of addresses, ie, the values in an array, etc. “x / x”非常适合转储RANGE地址的值,即数组中的值等。

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

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