内存地址中的位
在使用 immunity 调试器在 Windows XP 32 位上进行调试时,我在堆栈上看到以下内容:
_Address_ -Value_
00ff2254 ff090045
00ff2258 00000002
我的理解是每个地址位置都包含 8 位。
这是正确的吗?
While debugging on Windows XP 32-bit using the immunity debugger, I see the following on the stack:
_Address_ -Value_
00ff2254 ff090045
00ff2258 00000002
My understanding is that every address location contains 8 bits.
Is this correct?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果我正确理解你的问题,答案是肯定的,每个单独的内存位置都包含 8 位。
调试器一次显示 4 个字节(32 位),以使显示更加紧凑(并且因为许多数据类型占用 32 位,所以查看 32 位值通常很有用)。这就是左列中的地址相距 4 个位置的原因。
如果调试器一次显示一个字节(8 位),则显示将如下所示:(
假设您位于“little-endian”机器,大多数现代台式电脑都是这样。)
If I'm understanding your question correctly, the answer is yes, every individual memory location contains 8 bits.
The debugger is showing you 4 bytes (32 bits) at a time, to make the display more compact (and because many data types take up 32 bits, so it's often useful to see 32-bit values). That's why the addresses in the left column are 4 locations apart.
If the debugger showed one byte (8 bits) at a time, the display would look like this:
(assuming you're on a "little-endian" machine, which most modern desktop PCs are.)
我认为你的问题的主要问题是你要求一件事,但我发现在阴影中潜伏着另一个不同的问题。
首先,也是最重要的,计算机内存中的可寻址实体被组织为字节,每个字节有 8 位,所以是的,每个地址可以说是指 8 位或一个字节。
但是,您可以轻松地将更多字节组合在一起以形成更大、更复杂的数据结构。
如果您的问题确实是“为什么我在堆栈转储中的某个地址处看到 8 位值的内容”,那么原因是它转储 32 位(4 字节)值。
换句话说,您可以获取地址、地址+1、地址+2 和地址+3,从每个地址中获取字节,然后组合成一个 32 位值。
这真的是你的问题吗?
I think the main problem with your question is that you ask for one thing, but I detect a different question lurking in the shadows.
First, and foremost, addressable entities in the memory of a computer is organized as bytes, which are 8 bits each, so yes, each address can be said to refer to 8 bits, or a byte.
However, you can easily group more bytes together to form bigger and more complex data structures.
If your question is really "Why am I seeing an 8-digit value as the contents at an address in my stack dump", then the reason for that is that it dumps 32-bit (4 bytes) values.
In other words, you can take the address, the address+1, the address+2, and the address+3, grab the bytes from each of those, and combine to a 32-bit value.
Is that really your question?
为了完成 RH 的答案,您可能会惊讶于给定地址有这么多数字。
你应该考虑
(在XP使用的cpu架构上)
To complete the answer of RH, you may be surprised to have so many numbers for a given address.
You should consider
(On a cpu architecture used by XP)
内存位置指的是内存的一个位置,每个连续的内存位置指的是内存中的下一个字节。所以,你只能在单字节边界上寻址内存,每个人都应该知道一个字节是 8 位宽。
A memory location refers to a location of memory, and each consecutive memory location refers to the next byte in memory. So, you can only address memory on a one byte boundary, and everyone should know that a byte is 8 bits wide.