Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我有一个地址,%eax我想跳转到,但代码无法编译,有没有办法解决这个问题?
%eax
movl 0xdeadbeef, %eax jmp %eax ; <--- compile error: type mismatch for 'jmp'
由于没有人能够为您提供正确的答案,所以这里是:
jmp *%eax
如果没有其他方法,您可以随时使用以下技巧:
push eax ret
// target address in eax jmp *%eax // target pointer address in eax jmp *(%eax)
对于 x86_64,寄存器是:%rax
%rax