The only way I can think of to get/set %rip under x86_64 is to use ptrace().
Below is copied from source of ltrace.
void* addr = ptrace(PTRACE_PEEKUSER, pid, (8 * RIP), 0);
ptrace(PTRACE_POKEUSER, pid, (8 * RIP), addr);
where RIP is a macro defined in /usr/include/sys/reg.h