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. 借用Google API在线生成网站二维码地址方法

    二维码其实很早就出现了,在国外很多年前就已经在应用了,国内这两年才开始异常的火爆,智能手机的发展,以及微博.微信等移动应用带动了二维码的普及.那么,如果为网址在线生成二维码呢?下面我们就来介绍一下Go ...

  2. 设置DIV块元素在浏览器页面中垂直居中

    任务目标 实践HTML/CSS布局方式 深入了解position等CSS属性 任务描述 实现如 示例图(点击打开) 的效果 灰色元素水平垂直居中,有两个四分之一圆位于其左上角和右下角. 任务注意事项 ...

  3. linux下打包工具

    InstallAnyWhere  IzPack  InstallJammer; installshield 也支持rpm打包 Advanced Installer

  4. 关于HttpURLConnection.setFollowRedirects

    public static void HttpURLConnection.setFollowRedirects(boolean followRedirects)public void HttpURLC ...

  5. QM UML状态机建模实例之移植 cortex-m0

    ---恢复内容开始--- 在上一期“Blinky for cortex-m0”中我们介绍了如何在QM中建立一个工程和生成代码,如何使生成的代码在我们的工程师运行起来,为此这一期要介绍如何将QP-NAN ...

  6. 2016 - 3 - 12 SQLite的学习之SQL语言入门

    1.SQL语句的特点: 1.1 不区分大小写 1.2 每条语句以;结尾 2.SQL语句中常用关键字: select,insert,update,from,create,where,desc,order ...

  7. 【笔记】ListView的使用

    1.0 ListView三要素 1.0.1  创建基本步骤 1.在布局文件中创建一个ListView组件,并在Activity中声明这个组件. 2.在Activity中,创建一个合适的Adapter. ...

  8. Varnish介绍

    “Varnish是一款高性能的开源HTTP加速器,挪威最大的在线报纸 Verdens Gang (http://www.vg.no) 使用3台Varnish代替了原来的12台squid,性能居然比以前 ...

  9. Unable to run app in Simulator

    xcode6 beta出现 “Unable to run app in Simulator” 错误提示,之前一直用着好好的,重启xcode就可以了. xcode6 beta出现 “Unable to ...

  10. Spring MVC之视图解析器和URL-Pattern的配置方案

    上期讲解了第一入门案例之后接下来了解一下视图解析器与URL-Pattern的配置方案 先来说视图解析器,在上次博客文章中我们完成了入门案例,接下来我们就在上一个例子中完善一下体出视图解析器 <? ...