Assembly MOV Instruction

最后都变了- 提交于 2019-12-24 10:47:09

问题


Hi guys im working on a CTF challenge and don't quite understand this asm command:

mov    %edx,0x20(%esp,%eax,4)

Im assuming its: move $edx into (0x20 + $esp + $eax + 4)

However when I checked this with gdb it isn't correct. Anyone mind explaining how this instruction works?

Thanks for your help!


回答1:


AT&T syntax for x86 memory references goes like this:

displacement(base,index,scale)

giving the address of displacement+base+(index*scale).

That is, destination memory address for your instuction is %ESP+0x20+(4*%EAX).



来源:https://stackoverflow.com/questions/29419966/assembly-mov-instruction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!