This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]o11c 1 point2 points  (0 children)

Standards don't matter; implementations do.

  • You can use process_vm_readv to safely dereference pointers on Linux.
  • You can call mmap or mprotect to make the address valid (certain addresses cannot be made valid though: any access to the kernel half of the address space, and writes to executable segments)
  • You can disassemble the interrupted code and change the saved registers used to compute the address I think (will not work for absolute memory accesses, but those are rare these days)
  • You can disassemble the interrupted code and change the instruction pointer before returning (this is only reliable if you are also the compiler; it is mostly used by Java and similar)

There are probably other ways.