Is there a way to access the value in the instruction pointer (RIP) without using a call
followed by a pop
in assembly language? Or is there a machine code opcode that can do it?
I have been googling with no clear results.
My problem is that I can't have any zeroes in the machine code, or else I get a SIGSEGV error. It's due to the way the server loads the code and executes it from a string of bytes. A near call has zeroes in the distance to the subroutine, so using call is not an option.
I'm on linux, 64-bit, and have nasm and yasm.