如何获得另一个进程的内存? [英] How can I get the memory of another process?

查看:65
本文介绍了如何获得另一个进程的内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像标题一样,我想获取另一个进程的内存(而不是父进程和子进程).我想在我的代码中管理另一个进程的内存

like the title,I want to get the memory of another process(not father process and child process).I want to manager the memory of another process in my code

推荐答案

进程是父进程还是子进程都没有关系.所有进程都在各自独立的内存空间中执行.某个地址,例如,如果一个过程中的变量可以与另一个过程中的变量有所不同,或者根本就不是有效地址.但是,出于调试和系统级目的,一个进程可以访问内存,甚至可以控制另一个进程.在Linux中,您可以使用ptrace:
http://www.linuxmanpages.com/man2/ptrace.2.php [ ^ ].

—SA
It does not matter if the process is parent or child. All processes are executed in their own memory spaces, isolated. Some address, say, if a variable in one process can be something different in another one, or it would not be a valid address at all. Nevertheless, for debugging and system-level purposes, one process can access memory and even control another process. In Linux, you can use ptrace:
http://www.linuxmanpages.com/man2/ptrace.2.php[^].

—SA


这篇关于如何获得另一个进程的内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆