A log about Reading the memroy of Other Process in C++/WIN API--ReadProcessMemory()
Memory, is a complex module in Programing, especially on Windows.
This time, I use cpp with win windows api{
VirtualQueryEx(); //Get the available memory page(block)
ReadProcessMemory(); //Read the specific memory
LookupPrivilegeValue(); //Get the avalible Privileges in windows
AdjustTokenPrivileges();//Enable or disable privilege for specific process
}
Now, we skip the step of getting privilege, and directly talking about the detail of reading memories.
At first, we should understand that we cannot directly read memory at once by giving a big number of memory required.
Normally, we should make a loop to record the detail of every pages(blocks) of memory [VirtualQueryEx()] and Read them [ReadProcessMemory()].
while (true)
{
if (VirtualQueryEx(hProcess, (LPVOID)cur_addr, &meminf, dwInfoSize) == )
break;
if (!(meminf.State == MEM_COMMIT || meminf.State == MEM_IMAGE || meminf.State == MEM_MAPPED))
{
cur_addr = (DWORD)meminf.BaseAddress + meminf.RegionSize;
continue;
}
if ((dbg = ReadProcessMemory(hProcess, (LPCVOID)meminf.BaseAddress, memget, meminf.RegionSize, &ReadSize)) == false)
cout << "Failed to read memory at address:" << meminf.BaseAddress << endl;
else
memget += meminf.RegionSize;
cur_addr = (DWORD)meminf.BaseAddress + eminf.RegionSize;
}
A log about Reading the memroy of Other Process in C++/WIN API--ReadProcessMemory()的更多相关文章
- dgango 报错: Timeout when reading response headers from daemon process
问题: image = np.asarray(bytearray(f.read()), dtype="uint8")cv2_img = cv2.imdecode(image, cv ...
- Unity添加自定义快捷键——UGUI快捷键
在Editor下监听按键有以下几种方式: 自定义菜单栏功能: using UnityEngine; using UnityEditor; public static class MyMenuComma ...
- java打印Jni层log
在eclipse上新建jni工程可以参考:http://www.cnblogs.com/ashitaka/p/5953708.html 要在java层打印c的log必须引入这个头文件的宏定义: #if ...
- Android NDK 开发(三)--常见错误锦集合Log的使用【转】
转载请注明出处:http://blog.csdn.net/allen315410/article/details/41826511 Android NDK开发经常因某些因素会出现一些意想不到的错误, ...
- Understanding postgresql.conf : log*
After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...
- Reading or Writing to Another Processes Memory in C# z
http://www.jarloo.com/reading-and-writing-to-memory/ Declarations [Flags] public enum ProcessAccessF ...
- SQL Server Log文件对磁盘的写操作大小是多少
原文:SQL Server Log文件对磁盘的写操作大小是多少 SQL Server 数据库有三种文件类型,分别是数据文件.次要数据文件和日志文件,其中日志文件包含着用于恢复数据库的所有日志信息,SQ ...
- 大数据框架对比:Hadoop、Storm、Samza、Spark和Flink--容错机制(ACK,RDD,基于log和状态快照),消息处理at least once,exactly once两个是关键
分布式流处理是对无边界数据集进行连续不断的处理.聚合和分析.它跟MapReduce一样是一种通用计算,但我们期望延迟在毫秒或者秒级别.这类系统一般采用有向无环图(DAG). DAG是任务链的图形化表示 ...
- RAC 性能分析 - 'log file sync' 等待事件
简介 本文主要讨论 RAC 数据库中的'log file sync' 等待事件.RAC 数据库中的'log file sync' 等待事件要比单机数据库中的'log file sync' 等待事件复杂 ...
随机推荐
- React之Froms
In React, a <textarea> uses a value attribute instead. This way, a form using a <textarea&g ...
- AFN断点续传思路
- Schedule 学习
现在做的项目都有用到Schedule,现在用一点时间来总结. 一.首先要到Nuget中下载Quartz.net. 二.下载下来了,你需要对它进行配置,使它能给你正常的使用. 三.在Global.asa ...
- 类似qq的左滑菜单栏简单实现
代码托管到了Github https://github.com/cyuanyang/YYSlideView 主演实现代码: 1.滑动的viewController的初始化主要view -(instan ...
- android studio 2.2.2下fragment的创建和跳转
一,首先,Fragment是android应用中十分重要的一个功能,十分轻量化,也类似于activity一样,是一个个布局,可以相互跳转和传递参数.但是,它运行起来十分流畅,而且易于管理,下面是在学习 ...
- JAVA双列集合HashMap
HashMap 双列集合HashMap是属于java集合框架3大类接口的Map类, Map接口储存一组成对的键-值对象,提供key(键)到value(值)的映射.Map中的key不要求有序,不允许 ...
- query语句的拼接.
在外网服务器上的网页,不能排序了,原因是query语句拼接时,sort没有能拼上,. 小小的思路: 1.是不是网页请求出了问题: 和我本机上的的请求一一对比,并没有发现什么问题. 2.代码除了问题吗: ...
- mantis邮箱配置
1.修改/var/www/html/mantisbt-1.3.3/config下config_inc.php配置文件 以163邮箱为例 # --- Email Configuration --- $g ...
- js参数传递分析
需要明白,js基本类型存放在栈,对象存放在堆. 结论:基本类型变量作为参数,不会改变变量值.对象变量作为参数,不修改属性(访问原始对象的操作),也不会改变变量值 起因,是群里一个问题: var a = ...
- XML代码生成器——XMLFACTORY 简介(四)
XML代码生成器——XMLFACTORY 简介(四) 这一篇我们讲“类属性”页签的配置功能,您将了解到:如何为元素子值指定类属性的名称,数据类型,及容器类型. 如果,你没看过这个系列的第一篇文章,请先 ...