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

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? Commented Apr 8, 2011 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. Commented Apr 8, 2011 at 14:12

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.