检查其他进程有多少内存可读
有没有办法知道我可以使用 ReadProcessMemory 从另一个进程读取多少内存?
如果我尝试从特定地址读取太多内存,它将返回错误代码 299,并且将读取 0 字节。
我猜这是因为我试图读取超出进程分配的缓冲区的内容。
Is there a way to know how much memory I can read from another process using ReadProcessMemory?
If I try to read too much memory from a specific address, it will return error code 299, and will read 0 bytes.
I'm guessing it's because I'm trying to read beyond the allocated buffer of the process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,唯一的方法就是尝试阅读它。如果要读取的内存块在进程中不能完全访问,例如,部分内存未分配,则
ReadProcessMemory
将返回0。使用较小的 nSize(1024 或 512 甚至 1)是一种解决方法。
As far as I know, the only way is trying to read it.
ReadProcessMemory
will return 0 if the memory block you want to read is not fully accessible in the process, e.g., part of it is not allocated.Use a smaller
nSize
(1024 or 512 or even 1) is a workaround.