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()的更多相关文章

  1. dgango 报错: Timeout when reading response headers from daemon process

    问题: image = np.asarray(bytearray(f.read()), dtype="uint8")cv2_img = cv2.imdecode(image, cv ...

  2. Unity添加自定义快捷键——UGUI快捷键

    在Editor下监听按键有以下几种方式: 自定义菜单栏功能: using UnityEngine; using UnityEditor; public static class MyMenuComma ...

  3. java打印Jni层log

    在eclipse上新建jni工程可以参考:http://www.cnblogs.com/ashitaka/p/5953708.html 要在java层打印c的log必须引入这个头文件的宏定义: #if ...

  4. Android NDK 开发(三)--常见错误锦集合Log的使用【转】

    转载请注明出处:http://blog.csdn.net/allen315410/article/details/41826511  Android NDK开发经常因某些因素会出现一些意想不到的错误, ...

  5. Understanding postgresql.conf : log*

    After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...

  6. Reading or Writing to Another Processes Memory in C# z

    http://www.jarloo.com/reading-and-writing-to-memory/ Declarations [Flags] public enum ProcessAccessF ...

  7. SQL Server Log文件对磁盘的写操作大小是多少

    原文:SQL Server Log文件对磁盘的写操作大小是多少 SQL Server 数据库有三种文件类型,分别是数据文件.次要数据文件和日志文件,其中日志文件包含着用于恢复数据库的所有日志信息,SQ ...

  8. 大数据框架对比:Hadoop、Storm、Samza、Spark和Flink--容错机制(ACK,RDD,基于log和状态快照),消息处理at least once,exactly once两个是关键

    分布式流处理是对无边界数据集进行连续不断的处理.聚合和分析.它跟MapReduce一样是一种通用计算,但我们期望延迟在毫秒或者秒级别.这类系统一般采用有向无环图(DAG). DAG是任务链的图形化表示 ...

  9. RAC 性能分析 - 'log file sync' 等待事件

    简介 本文主要讨论 RAC 数据库中的'log file sync' 等待事件.RAC 数据库中的'log file sync' 等待事件要比单机数据库中的'log file sync' 等待事件复杂 ...

随机推荐

  1. 更新centos curl

    centos curl 默认使用nss,而不是openssl 升级curl让curl支持openssl rpm -Uvh http://www.city-fan.org/ftp/contrib/yum ...

  2. asp.net DataTable 修改列值

    /// <summary> /// 修改数据表DataTable某一列的类型和记录值(正确步骤:1.克隆表结构,2.修改列类型,3.修改记录值,4.返回结果) /// </summa ...

  3. iOS学习之git的使用

    SVN是集中式版本控制系统,版本库是集中放在中央服务器的,而干活的时候,用的都是自己的电脑,所以首先要从中央服务器哪里得到最新的版本,然后干活,干完后,需要把自己做完的活推送到中央服务器.集中式版本控 ...

  4. 构造一个简单的Linux系统MenuOS

    陈智威20135125 原创作品转载请注明出处 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 实验指导 ...

  5. uboot(二): Uboot-arm-start.s分析

    声明:该贴是通过参考其他人的帖子整理出来,从中我加深了对uboot的理解,我知道对其他人一定也是有很大的帮助,不敢私藏,如果里面的注释有什么错误请给我回复,我再加以修改.有些部分可能还没解释清楚,如果 ...

  6. javascript运动应用

    多物体运动框架: 1.多个盒子同时运动:move(obj,target)多一个参数 <!DOCTYPE html><html><head> <title> ...

  7. java集合类的学习(一)

    为何要用集合类:可以储存不同类型的数据,可以进行动态的删除和修改,不用考虑数组越界的问题. 软件开发常用的集合类:Vector,ArrayList,Stack,HashMap,Hashtable. 3 ...

  8. dreamweaver快捷键

    ---恢复内容开始--- 件菜单 新建文档 Ctrl+N 打开一个 HTML文件 Ctrl+O或者将文件从[文件管理器]或[站点]窗口拖动到[文档]窗口中 在框架中打开 Ctrl+Shift+O 关闭 ...

  9. linux 安装一些命令

    一.安装wget命令: debian 或者 ubuntu : sudo apt-get install wget centos : sudo yum -y install wget 二.安装rz.sz ...

  10. yii 初步安装

    第一步: window下点击>开始 >运行CMD命令. 第二步:进入Yiic文件的目录   (例如在D盘里面 D:/yii/framework) 第三步:D:\yii\framework& ...