|
[原创]Windows内存篇Ⅱ x64内核内存布局的迁移演变
FaEry 找到进bitmap的锁就可以了,目前这种方式最大的问题是访问内存时如果在MmIsAddressValid调用完内存被释放了就有蓝屏风险,lock内存也没用,lock了别人调用ExFreePool发现内 ...毕竟是非分页内存,我一般拉高IRQL防止被切换,当然如果对方的代码也在DPC_LEVEL,照样防不住 |
|
[原创]Windows内存篇Ⅱ x64内核内存布局的迁移演变
FaEry 对,win10windbg有点问题所以不太信他的处理结果,用poolheader比较舒服,小内存都能按tag找,头+0xC就是DriverObject了,没做vista xp的兼容了搜poolheader虽然流程简单点,直接暴力搜效率还是比较慢的,我看了篇论文,说定位PhysicalMemoryBackupPool的Bitmap可以筛掉很多无效页面,但也要符号或特征码定位 |
|
[原创]Windows内存篇Ⅱ x64内核内存布局的迁移演变
FaEry hhkqqs 我在windbg用!poolfind Driv 只搜到零星的几个,非常奇怪,我看了眼IoDriverObjectType上面登记的个数可是一百多个 ...windbg这个poolfind的指令在6.x版本下能正常用,到了10.0版本不知道为啥少了好多信息。我用特征码的方法找了一遍,基本能全找出来,首先找ULONG_PTR PoolHeader,使得*(PULONGLONG)PoolHeader & 0x7FFFFFFFFF000000 == 0x7669724402000000。进一步判断(*(PULONGLONG)(PoolHeader + 0x10) == DriverObjectDirectory || *(PULONGLONG)(PoolHeader + 0x10) == FileSystemDirectory) && *(PULONGLONG)(PoolHeader + 0x60) == 0x1500004,基本能确定是一个驱动,然后PoolHeader += (((PPOOL_HEADER)PoolHeader)->BlockSize << 4)继续扫下去,兼容Vista SP0。你代码用到的ObGetObjectType不兼容Vista。 |
|
[原创]Windows内存篇Ⅱ x64内核内存布局的迁移演变
FaEry 为啥我搜出来好多DriverObject我在windbg用!poolfind Driv 只搜到零星的几个,非常奇怪,我看了眼IoDriverObjectType上面登记的个数可是一百多个 |
|
[原创]Windows内存篇Ⅱ x64内核内存布局的迁移演变
win10的nonpagedpool大小应该不是巨硬pdb所说的0x100000000000,实测在这个区域搜DriverObject只能搜出零星的几个,巨硬大概率在内存管理函数里面多做了一些手脚。
最后于 2020-10-25 10:53
被hhkqqs编辑
,原因:
|
|
[原创]Win10 DiSPATCH_LEVEL下读取物理内存
不对 理解你的意思了,你是从PML4T的位置就开始替换成自己的了,受教了![em_13],我去改进一下思路 如果只是简单地访问某个物理页,直接申请一页内存,第一项填一个Valid和LargePage位为1的PDPT项,按你的需求给Dirty1(Intel's R/W bit)和NoExecute置位,物理页帧号填你要访问的页帧号。再把申请的这页内存的物理页帧号填进某个没使用的PML4T里面,再刷下TLB,你就能随意使用从你想用的物理页开始,长度为1G的物理内存了。我原帖干的很多事都是映射已有的虚拟地址,稍微补充下就能做到既映射已有虚拟地址也映射物理地址了
最后于 2020-10-20 14:37
被hhkqqs编辑
,原因:
|
|
[原创]Win10 DiSPATCH_LEVEL下读取物理内存
我帖子里也有计算大分页情况下拿到MmAllocxxx和ExAllocxxx申请到的物理页帧号的代码,主要是利用了操作系统申请大分页时页帧号和虚拟页帧号对齐的特点,当然也可以MmGetPhysicalForVirtual(不喜欢用这个,没准哪天就变成MmMapIoSpace一样的下场了) |
|
[原创]Win10 DiSPATCH_LEVEL下读取物理内存
不对 [em_67]受教了,是否可以使用ExAllocatePool来进行替换呢?ExAllocatePool虽然在长度≥0x1000的时候也是页对齐,但和Mmxxx一样拥有内存充足下优先分配大分页的特点,最好的方案是参考我之前某篇帖子的思路,MmAllocatexxx只用于分配建立新PML4T和PDPT页表项内容的内存,在PML4T的512项里面选一项占坑,把想访问的虚拟地址直接往这里做拷贝,如果是访问物理地址,直接在这里面找一项未使用的PTE填充物理页帧号\有效位\可写位,再刷tlb就稳得一批了。因为这个连续空间已经被自己占坑,你完全不用担心操作系统会动你映射的内容。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值