汇编堆栈索引地址
我正在尝试使用 ollydbg 调试程序,但我对使用 SS 前缀索引模式地址有疑问。
截图如下:
此时,指令
MOV BYTE PTR SS:[EBP-1],BL
会将 8 位从 EBX
移至EBP(0012FDCC)
中指向的地址减去一 - 0012FDCB
。
如果以上不正确,请告诉我。
在ollydbg程序中,右下角有一个堆栈的表示,其中第一列指向地址。为什么没有 0012FDCB
的条目以及 0012FDCB
指向的位置?
I'm trying to debug a program with ollydbg and I have a doubt to index mode address using SS prefix.
Here's a screenshot:
At this point, the instruction
MOV BYTE PTR SS:[EBP-1],BL
will move the 8-bits from EBX
to address pointed in EBP(0012FDCC)
subtracted of one - 0012FDCB
.
If above is not correct, please, tell me.
In ollydbg program, lower right has a representation of the stack with the first column to the address. Why there is not a entry to 0012FDCB
an where is 0012FDCB
pointing to?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对ollydbg一无所知;希望熟悉的人也能发表答案。
您对向我们展示的指令将执行的操作的理解基本上是正确的:它将把 BL 的内容(即 EBX 的低 8 位)移动到指向的堆栈段中的地址通过 [EBP 减 1]。如果EBP为0012FDCCh,则该字节将存储在0012FDCBh。
我们通常不会说 0012FDCBh 指向任何地方,我们只是说它是一个内存位置,在这种情况下包含一个字节,尽管从技术上来说,说它是一个内存位置的地址会更正确,因此从某种意义上说,数字“指向”一个字节。但我们更愿意认为是指向内存的指针或寄存器,而不是纯数字。
我不知道为什么 ollydbg 不显示 0012FDCBh。你确定它没有显示吗?是否可能显示 0012FDCCh 和 0012FDC8h?如果是这样,那么它只是显示以 DWORD 分组的堆栈内存,因此不会显示 0012FDCBh,因为它对应于位于 0012FDC8h 的 DWORD 内的四个字节之一。查看存储在 0012FDC8h 中的 DWORD 值,单步执行 MOV 指令,您应该看到该字的最高有效字节更改为 BL 的值。 (如果该地址中的值与 BL 的值不同。)Ollydbg 也可能显示按行分组的内存,长度超过一个 DWORD,但同样的原则也适用。
I know nothing about ollydbg; hopefully someone who is familiar with it will also post an answer.
Your understanding of what the instruction you showed us will do is mostly correct: it will move the contents of BL, (which is the lower 8-bits of EBX,) to the address in the stack segment pointed by [EBP minus 1]. If EBP is 0012FDCCh, then the byte will be stored at 0012FDCBh.
We usually do not say that 0012FDCBh points anywhere, we just say that it is a memory location, which in this case contains a byte, even though technically it would be more correct to say that it is the address of a memory location, and therefore in a sense the number 'points' to a byte. But we prefer to think of pointers or registers pointing to memory, not pure numbers.
I have no idea why ollydbg is not showing 0012FDCBh. Are you sure it is not showing it? Is it perhaps showing 0012FDCCh and 0012FDC8h? If so, then it is simply showing stack memory grouped in DWORDs, so 0012FDCBh is not shown because it corresponds to one of the four bytes that live within the DWORD at 0012FDC8h. Look at the DWORD value stored in 0012FDC8h, single-step over the MOV instruction, and you should see the most-significant byte of that word changing to the value of BL. (If the value in that address differed from the value of BL.) Ollydbg may also be showing memory grouped in rows longer than just one DWORD, but the same principle applies.