You can't read (E|R)IP
because there's no x86(/64) instruction to read it directly.
The only way to "read" it is to make a call with the CALL
instruction. It will save the return address on the stack and that one you can read.
UPDATE: In 64-bit mode you can exploit the RIP
-relative addressing, so LEA RAX, [RIP]
will give you the address of itself in EAX
. Yet another workaround is MOV RAX, $
in assembly.