read process memory of another process windows

1 Ansicht (letzte 30 Tage)
Jakob Reid
Jakob Reid am 11 Okt. 2017
Beantwortet: Walter Roberson am 11 Okt. 2017
Allows a person to open a handle to a specific external process. Allowing one to read information at specific points in memory. So my question is, is there a way to do something like this in matlab.
If opening a handle isn't possible would mapping / copying the memory of the second process to a new location (similar to how you can memory map a file), then read the information from this new mapped section.
Thanks!

Antworten (1)

Walter Roberson
Walter Roberson am 11 Okt. 2017
Generally speaking, the requirements to access the memory space of another process are, for both MS Windows and Unix type systems, that one of the following is true:
  1. the requesting process is the parent of the process being examined; or
  2. the requesting process is running as administrator (or "root" on Unix); or
  3. the requesting process has been granted more specific privileges that allow it to examine process memory
On some high-security versions of Unix, running as "root" is not enough and the process must have been granted the specific permission. Historically, "root" was always granted all permissions, but higher security version compartmentalize permissions, so that if an intruder somehow gets root access they are still restricted on what they can do.
The ability to read another process's memory is a relatively high security risk, since other process might be storing banking credentials or Classified information.
It is therefore better and more secure to arrange to have the target program and the monitoring program cooperate on sharing information, such as creating a shared memory segment that both sides can read and write, gaining access only to what is deliberately shared.
The File Exchange contribution sharedmatrix() uses operating system shared memory facilities to allow deliberate sharing.
MATLAB itself provides memmapfile(), which allows memory-like access to a file -- a file that a different process might also be mapping in similar ways, effectively using a file as a buffer to share memory between two processes.
If, somehow, you do have the correct permissions between the MATLAB session and the process to be monitored, then you could write a big of C or C++ code to make the appropriate MS Windows operating system calls. There is no Mathworks provided facility to directly do what you are asking for.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by