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' 等待事件复杂 ...
随机推荐
- pytho简单爬虫_模拟登陆西电流量查询_实现一键查询自己的校园网流量
闲来无事,由于校园内网络是限流量的,查询流量很是频繁,于是萌生了写一个本地脚本进行一键查询自己的剩余流量. 整个部分可以分为三个过程进行: 对登陆时http协议进行分析 利用python进行相关的模拟 ...
- Java 中Iterator 、Vector、ArrayList、List 使用深入剖析
标签:Iterator Java List ArrayList Vector 线性表,链表,哈希表是常用的数据结构,在进行Java开发时,JDK已经为我们提供了一系列相应的类来实现基本的数据结构.这些 ...
- 浅谈Android系统移植、Linux设备驱动
一.Android系统架构 第一层:Linux内核 包括驱动程序,管理内存.进程.电源等资源的程序 第二层:C/C++代码库 包括Linux的.so文件以及嵌入到APK程序中的NDK代码 第三层:An ...
- 《C++primer》v5 第8章 IO库 读书笔记 习题答案
8.1.8.2 这一章不咋会啊.. istream &read(istream &is) { int a; auto old_state=is.rdstate(); is.clear( ...
- 第一个structs+spring+hibernate的web程序
1. 数据库: Column Type Comment id int(11) Auto Increment name varchar(50) NULL url varchar(255) NUL ...
- MISC-极客大挑战-pen_and_apple.rar
额 一道MISC的题目 关键词:NTFS数据流隐藏 链接:http://pan.baidu.com/s/1c14PM3A 密码:d7hn 拿到的是一个rar压缩文件,解压得到一个无节操的最近很流行 ...
- iOS摇一摇手机,播放微信摇一摇音效
实现微信摇一摇播放音效,代码如下:- (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{ if (motio ...
- selenium win7+selenium2.0+python环境搭建
- 什么是 JSON ?
什么是 JSON ? JSON 指的是 JavaScript 对象表示法(JavaScript Object Notation) JSON 是轻量级的文本数据交换格式 JSON 独立于语言 JSON ...
- CSharper~
昨天晚上开始,重启读clr via c#大计.Jeffery大神的大作基本上没人不推荐的,所以我也抱了很大的期待,希望读完以后对.net的认识能有质的飞跃.争取五月份内读完.昨天看完了第一章,感觉.n ...