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. 与焊接厂交流——从生产角度出发的PCB设计心得

    上周的时候,去了趟加工厂盯电路板的焊接进度.然后在闲余的时候,跟焊接厂的工程师交流了一下,工程师从生产的角度,说了几个值得注意的事项: 1.元件的焊盘应该要窄长,不能过宽.因为,在过机表贴时,焊盘上的 ...

  2. 文本过滤工具之AWK

    一.AWK简介 AWK三大文本处理工具之一,是一个非常强大的文本处理工具.它不仅是 Linux 中也是任何环境中现有的功能最强大的数据处理引擎之一.这种编程及数据操作语言(其名称来自于它的创始人 Al ...

  3. 一些pc端web事件移动端不再可行

    1.onkeyUp,onkeyDown,onkeyPress等事件不再管用,要用oninput代替   2.onclick事件会有延迟,因为手机需要等待判断是否是双击事件(ondblclick).所以 ...

  4. 有关javascript的性能优化(合理的管理内存)

    使用具备垃圾收集机制的语言编写程序,开发人员一般不必操心内存管理的问题.但是,Javascript在进行内存管理及收集时面临的问题是有点与众不同.其中最主要的一个问题是分配给Web浏览器的可用内存数量 ...

  5. 清除缓存,计算Sql Server查询效率

    --优化之前 DBCC FREEPROCCACHE DBCC DROPCLEANBUFFERS SET STATISTICS IO ON select Dtime,Value from dbo.his ...

  6. 你可能不知道的iOS冷知识——#pragma

    Mattt Thompson撰写. Zihan Xu翻译. 发布于2012年10月1日 #pragma 声明是彰显 Objective-C 工艺的标志之一.虽然 #pragma 最初的目的是为了使得源 ...

  7. ubuntu安装谷歌输入法

    1,sudo apt-get install fcitx-googlepinyin 2,在settings->Language Support里将keyboard input method sy ...

  8. java语法基本知识2

    对象的引用相当于C中的指针.对象存在于堆中,引用存在于栈中.引用在函数,可以称作局部变量.

  9. 可拖拽的ListView

    今天研究了一下可拖拽的ListView ,当ListView的数据不能充满整个模拟器的时候,系统自带的listview上拖下拽都不好使,显得很单调, 为了实现上拖下拽时也能实现滚动的效果,这时候就需要 ...

  10. 从log中分析Android wif连接状态的方法

    1.这里是从log中通过搜索关键字wpa_supplicant: wlan0: State过滤之后的log: Line 1: 11-25 20:10:14.968120  1104  1104 D w ...