3

At the moment I try to write a memory-hacking library for Unix. But I faced so many problems using ptrace/procfs so I decided to write a driver for that.

The problem is, I am unable to find a way to retrieve memory from a different virtual memory space (I only know copy_from_user() etc) than of the caller.

Does anyone know a good solution? Thanks :)

Regards, Flo

Flo
  • 31
  • 2
  • 1
    ptrace is messy but it is the approved way to mess around with other processes. Are you sure you cannot learn how to use it? – Zan Lynx Apr 08 '11 at 13:55
  • I know how to use ptrace, my problem is that I am forced to stop the process I am operating on to be able to read from /proc/[pid]/mem or write to it. Stopping a process to copy a few 100MB just creates an unacceptable delay. I know there's are reason the process has to be stopped, but in my case I don't have any issues with race-conditions or similar. – Flo Apr 08 '11 at 14:12

1 Answers1

2

You may map virtual memory pages from the two different memory spaces into kernel space, do a copy operation in the kernel address space, and then unmap the pages.

ZelluX
  • 69,107
  • 19
  • 71
  • 104