我有以下基本问题:
-
何时我们应该在调试中涉及反汇编
-
如何解释反汇编,例如下面每个段代表什么
00637CE3 8B 55 08 mov edx,dword ptr [arItem]
00637CE6 52 push edx
00637CE7 6A 00 push 0
00637CE9 8B 45 EC mov eax,dword ptr [result]
00637CEC 50 push eax
00637CED E8 3E E3 FF FF call getRequiredFields (00636030)
00637CF2 83 C4 0C add
语言:C++
平台:Windows
估计编译器发出的代码的效率非常有用。
例如,如果您使用std::vector::operator[]
在没有反汇编的循环中,很难猜测每次调用operator[]
事实上需要两次内存访问,但使用迭代器则需要一次内存访问。
在你的例子中:
mov edx,dword ptr [arItem] // value stored at address "arItem" is loaded onto the register
push edx // that register is pushes into stack
push 0 // zero is pushed into stack
mov eax,dword ptr [result] // value stored at "result" address us loaded onto the register
push eax // that register is pushed into stack
call getRequiredFields (00636030) // getRequiredFields function is called
这是调用函数的典型顺序 - 参数被推入堆栈,然后控制权转移到该函数代码(call
操作说明)。
在参与有关“编译后如何工作”的争论时,使用反汇编也非常有用 - 例如caf点在他对这个问题的回答.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)