How would I jump to a known memory address in intel assembly syntax (both x32 and x64).
I think I have the 64 bit syntax down. For example, if in x64 I wanted to jmp to the code at 0x75767
and I was located at 0000
, I would do:
0000: FF 25 01 00 00 00 jmp QWORD PTR [rip+0x75761]
Is that ^ correct? I thought I could dissemble those bytes that into x32 instruction using objdump objdump.exe -D -Mintel,i386 -b binary -m i386 test.bin
which results in:
jmp DWORD PTR 0x75761
Then just use clang++.exe -masm=intel -m32 -c test.o
to convert this instruction to x32 bytes but it says:
error: invalid operand for instruction
jmp DWORD PTR 0x75761
^
I want to avoid writing into any registers.
Is my x64 jmp instruction correct?
How would I accomplish something similar in x32? Let's say in x32 I need to jmp to 0x400107
and I'm at 0x400000
I'm messing around with tweaking running process memory on Windows. Forgive me if my question has inaccuracies, I'm learning.