How does the jmp instruction work in att assembly in this instance

前端 未结 1 614
离开以前
离开以前 2020-12-10 23:07

I am stepping through a function in AT&T assembly right now and can\'t figure out how this specific jmp command works.

    jmp    *0x804a140(,%eax,4)
         


        
1条回答
  •  佛祖请我去吃肉
    2020-12-10 23:30

    If you are confused by at&t syntax, switch your tool to intel mode.

    The effective address you see is not specific to jumps, you could have encountered it with any instruction that takes a memory operand.

    In intel syntax this would look like: jmp [0x804a140 + 4 * eax]. It's an indirect jump that fetches the jump target from memory address 0x804a140 + 4 * eax. This is probably an item in a so-called jump table.

    0 讨论(0)
提交回复
热议问题