当前位置: 首页 > ds >正文

nt!MiInitializeSystemCache函数分析之PointerPte->u.List.NextEntry的由来

第一部分:
1: kd> dd 0xc0304200
c0304200  c10c0000 00000000 00000000 00000000
c0304210  00000000 00000000 00000000 00000000
c0304220  00000000 00000000 00000000 00000000
c0304230  00000000 00000000 00000000 00000000
c0304240  00000000 00000000 00000000 00000000
c0304250  00000000 00000000 00000000 00000000
c0304260  00000000 00000000 00000000 00000000
c0304270  00000000 00000000 00000000 00000000
1: kd> dd 0xc0304300
c0304300  c1100000 00000000 00000000 00000000
c0304310  00000000 00000000 00000000 00000000
c0304320  00000000 00000000 00000000 00000000
c0304330  00000000 00000000 00000000 00000000
c0304340  00000000 00000000 00000000 00000000
c0304350  00000000 00000000 00000000 00000000
c0304360  00000000 00000000 00000000 00000000
c0304370  00000000 00000000 00000000 00000000
1: kd> dd 0xc0304400
c0304400  c1140000 00000000 00000000 00000000
c0304410  00000000 00000000 00000000 00000000
c0304420  00000000 00000000 00000000 00000000
c0304430  00000000 00000000 00000000 00000000
c0304440  00000000 00000000 00000000 00000000


第二部分:
VOID
MiInitializeSystemCache (
    IN ULONG MinimumWorkingSet,
    IN ULONG MaximumWorkingSet
    )


    //
    // Build a free list structure in the PTEs for the system cache.
    //

    MmSystemCachePteBase = MI_PTE_BASE_FOR_LOWEST_KERNEL_ADDRESS;

    SizeOfSystemCacheInPages = MI_COMPUTE_PAGES_SPANNED (MmSystemCacheStart,
                                (PCHAR)MmSystemCacheEnd - (PCHAR)MmSystemCacheStart + 1);

    HunksOf256KInCache = SizeOfSystemCacheInPages / (X256K / PAGE_SIZE);

    PointerPte = MiGetPteAddress (MmSystemCacheStart);

    MmFirstFreeSystemCache = PointerPte;

    for (i = 0; i < HunksOf256KInCache; i += 1) {
        PointerPte->u.List.NextEntry = (PointerPte + (X256K / PAGE_SIZE)) - MmSystemCachePteBase;
        PointerPte += X256K / PAGE_SIZE;
    }

第三部分:

#define PAGE_SIZE                   0x1000
#define X256K 0x40000

1: kd> ?0x40000/0x1000
Evaluate expression: 64 = 00000040

0100 0000
0100 0000 00
01    00 00    00 00    =    0x100

0xc0304000+0x100=0xc0304100
0xc0304100-0xc0000000=0x304100

304100

0011 00    00     0100     0001     0000 0000
 11 00    00     0100     0001     0000 0000 00
 11 00    00     01    00     00    01     00    00 00    00 00    

 11 00    00     01    00     00    01     00    00 00    00 00
c1040

      +0x000 List             : _MMPTE_LIST
         +0x000 Valid            : Pos 0, 1 Bit
         +0x000 OneEntry         : Pos 1, 1 Bit
         +0x000 filler0          : Pos 2, 8 Bits
         +0x000 Prototype        : Pos 10, 1 Bit
         +0x000 filler1          : Pos 11, 1 Bit
         +0x000 NextEntry        : Pos 12, 20 Bits

1: kd> x nt!MmSystemCachePteBase
80b2358c          nt!MmSystemCachePteBase = 0xc0000000

1: kd> dd 0xc0304000
c0304000  c1040000

第四部分:

0xc0304200

0xc0304300

304300
0011 0000 0100 0011 0000 0000

11 0000 0100 0011 0000 0000 00

11 00    00 01    00 00    11 00    00 00    00 00
c10c0

1: kd> dd 0xc0304200
c0304200  c10c0000 00000000 00000000 00000000
c0304210  00000000 00000000 00000000 00000000
c0304220  00000000 00000000 00000000 00000000
c0304230  00000000 00000000 00000000 00000000
c0304240  00000000 00000000 00000000 00000000
c0304250  00000000 00000000 00000000 00000000
c0304260  00000000 00000000 00000000 00000000
c0304270  00000000 00000000 00000000 00000000
1: kd> dd 0xc0304300
c0304300  c1100000 00000000 00000000 00000000
c0304310  00000000 00000000 00000000 00000000
c0304320  00000000 00000000 00000000 00000000
c0304330  00000000 00000000 00000000 00000000
c0304340  00000000 00000000 00000000 00000000
c0304350  00000000 00000000 00000000 00000000
c0304360  00000000 00000000 00000000 00000000
c0304370  00000000 00000000 00000000 00000000
1: kd> dd 0xc0304400
c0304400  c1140000 00000000 00000000 00000000
c0304410  00000000 00000000 00000000 00000000
c0304420  00000000 00000000 00000000 00000000
c0304430  00000000 00000000 00000000 00000000
c0304440  00000000 00000000 00000000 00000000

http://www.xdnf.cn/news/9303.html

相关文章:

  • 深度解析 K8S Pod 控制器,从原理到企业实践
  • [ Qt ] | 常见控件(二): window相关
  • 字符串day7
  • 线上 VR 展会:独特魅力与显著特质
  • 新增 git submodule 子模块
  • 安全接口设计:筑牢对外接口的安全防线
  • 企业im怎么选? BeeWorks -安全的企业内部通讯软件
  • 设计模式-单一职责原则
  • (14)JVM弹性内存管理
  • 【自用资源分享】Protocol Buffers 构建脚本: 支持生成 ​C++、Go、Python、Java 的 Protobuf 和 gRPC 代码
  • Leetcode-5 好数对的数目
  • 全局事务标识符
  • SPSS跨域分类:自监督知识+软模板优化
  • Ubuntu 下搭建ESP32 ESP-IDF开发环境,并在windows下用VSCode通过SSH登录Ubuntu开发ESP32应用
  • WordPress免费网站模板下载
  • 【C++】小知识点
  • 【MySQL】第11节|MySQL 8.0 主从复制原理分析与实战
  • 线下陪玩app小程序 陪玩同城搭子系统开发;
  • 【NLP基础知识系列课程-Tokenizer的前世今生第四课】生物信息中的 Tokenizer 策略:如何切开一段基因?
  • 量产前研发“效率黑洞”如何破局?全星系统重构汽车部件体系化管理新范式
  • Elasticsearch 如何实现跨数据中心的数据同步?
  • word2016标题自动编号
  • Modbus通信中的延迟和时间间隔详解
  • 4.2.1、mysql进阶——存储过程基本语法,变量
  • 网络拓扑如何跨网段访问
  • ArcGIS Pro 3.4 二次开发 - 知识图谱
  • (自用)Java学习-5.15(模糊搜索,收藏,购物车)
  • 编程日志5.28
  • 了解一下C#的SortedSet
  • C++?继承!!!