如何从句柄中读取所有地址? [英] How Can I Read All Addresses From Handle?

查看:88
本文介绍了如何从句柄中读取所有地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在用C ++编写Memory Viewer软件,我想在项目中添加一些属性。其中一个是我的属性,读取进程内存地址。



示例;

用户选择一个应用程序,我的项目将列出所有地址(有值)所选应用程序。



我可以这样做吗?我该怎么做?



请帮助我,我正在等待你的帮助......

Hi everyone,

I'm writing Memory Viewer Software with C++ and I wanna add some properties to my project. One of them my properties, reading process memory addresses.

Example;
User select one application and my project will be list all of addresses(with values) for selected application.

Can I do this and How can I do this?

Please help me, I'm waiting for your help...

推荐答案

从你的说法来看,你似乎对现代操作系统如何管理内存感到困惑。

首先,我建议你阅读这个 [ ^ ]和这个 [ ^ ]阐明基础知识(在实际操作系统中,内存是虚拟的,每个可执行文件通常分配在相同的标准虚拟地址0x400000上)。

当你'你可以从 OpenProcess()开始有更明确的想法 [ ^ ]功能。由此,如果您具有足够的权限,则可以获取该进程的句柄。使用此句柄可以访问进程资源,内存就是其中之一。使用 ReadProcessMemory() [ ^ ]函数。

这些函数通常用于调试器中以访问调试进程内存,读取检查变量的位置是使用dbghelp [ ^ ] library。



Good运气! ;)



P.S.应该清楚的是,您通过ReadProcessMemory()读取的任何地址都是在进程内的指定逻辑地址处读取数据,而不是物理全局内存地址。
From what you say it seems that you have some confusion about how a modern OS manage memory.
First of all I suggest you to read this[^] and this[^] to clarify the basics (in an actual OS the memory is virtual and each executable generally is allocated on the same standard virtual address 0x400000).
When you'll have more clear ideas you can start from OpenProcess()[^] function. From this, if you have enough privileges, you can obtain an handle to the process. With this handle you can access the process resources, memory is one of them. Use function ReadProcessMemory()[^] function.
These functions are typically used in debuggers to access debugging process memory, the locations to read to inspect variables are obtained from debug info's using the functions from dbghelp[^] library.

Good luck! ;)

P.S. It should be clear that whichever address you read through ReadProcessMemory() you are reading data at the specified logical address inside the process, not a physical global memory address.


这篇关于如何从句柄中读取所有地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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