So I have a address in %eax
I would like to jmp to but the code will not compile, is there a way around this?
movl 0xdeadbeef, %eax
jmp %eax ; <--- compile error: type mismatch for 'jmp'
In the x86 assembly language, the JMP instruction performs an unconditional jump. Such an instruction transfers the flow of execution by changing the program counter.
The jmp instruction transfers execution control to a different point in the instruction stream; records no return information. Jumps with destinations of disp[8|16|32] or r/m[16|32] are near jumps and do not require changes to the segment register value.
jmp *%eax is AT&T syntax for jmp eax , which is one form of jmp r/m32 . It will jump to the address contained in register eax : Jump near, absolute indirect, address given in r/m32. Another form of the same type of jump instruction is jmp *(%eax) which corresponds to jmp [eax] in Intel syntax.
Since nobody was able to provide you with the correct answer, here it is:
jmp *%eax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With