看了下,采用的应该是类似LINUX下的KAISER技术,采用shadow 页表技术,R3,R0用不同的页表,内核地址在R3中只有极少数被映射,大部分都无效,R0中的都有效,并且R3地址也都能访问,只通过SMAP和SMEP来进行保护。
在打了新的WIN10 补丁后,我们在 KPROCESS 里会看到
0: kd> dt nt!_EPROCESS @$proc ImageFileName Pcb.DirectoryTableBase Pcb.UserDirectoryTableBase
*** ERROR: Module load completed but symbols could not be loaded for LiveKdD.SYS
+0x000 Pcb :
+0x028 DirectoryTableBase : 0x1ab002
+0x278 UserDirectoryTableBase : 0x2f00001
+0x450 ImageFileName : [15] "System"
新的UserDirectoryTableBase 用来保存R3 的CR3 ,而原来的DirectoryTableBase则为R0的CR3
0: kd> ? nt!KiSystemCall64Shadow
Evaluate expression: -8787652898496 = fffff801`f7121140
0: kd> !vtop 1ab000 fffff801f7121140
Amd64VtoP: Virt fffff801`f7121140, pagedir 1ab000
Amd64VtoP: PML4E 1abf80
Amd64VtoP: PDPE 3b09038
Amd64VtoP: PDE 3b0adc0
Amd64VtoP: Large page mapped phys 00000002`18121140
Virtual address fffff801f7121140 translates to physical address 218121140.
0: kd> !vtop 2f00000 fffff801f7121140
Amd64VtoP: Virt fffff801`f7121140, pagedir 2f00000
Amd64VtoP: PML4E 2f00f80
Amd64VtoP: PDPE eb3038
Amd64VtoP: PDE ab2dc0
Amd64VtoP: PTE eb9908
Amd64VtoP: Mapped phys 00000002`18121140
Virtual address fffff801f7121140 translates to physical address 218121140.
而比较重要的nt!KiSystemCall64Shadow,在2个表中都有映射,指向同一物理地址218121140
0: kd> !pcr
KPCR for Processor 0 at fffff801f5b22000:
Major 1 Minor 1
NtTib.ExceptionList: fffff801f9664fb0
NtTib.StackBase: fffff801f9663000
NtTib.StackLimit: 0000000000000000
NtTib.SubSystemTib: fffff801f5b22000
NtTib.Version: 00000000f5b22180
NtTib.UserPointer: fffff801f5b22870
NtTib.SelfTib: 00000058e0504000
SelfPcr: 0000000000000000
Prcb: fffff801f5b22180
Irql: 0000000000000000
IRR: 0000000000000000
IDR: 0000000000000000
InterruptMode: 0000000000000000
IDT: 0000000000000000
GDT: 0000000000000000
TSS: 0000000000000000
CurrentThread: fffff801f72a4380
NextThread: 0000000000000000
IdleThread: fffff801f72a4380
DpcQueue: Unable to read nt!_KDPC_DATA.DpcListHead.Flink @ fffff801f5b24f80
0: kd> !vtop 2f00000 fffff801f5b24f80
Amd64VtoP: Virt fffff801`f5b24f80, pagedir 2f00000
Amd64VtoP: PML4E 2f00f80
Amd64VtoP: PDPE eb3038
Amd64VtoP: PDE ab2d68
Amd64VtoP: PTE 37b6920
Amd64VtoP: zero PTE
Virtual address fffff801f5b24f80 translation fails, error 0xD0000147.
0: kd> !vtop 1ab000 fffff801f5b24f80
Amd64VtoP: Virt fffff801`f5b24f80, pagedir 1ab000
Amd64VtoP: PML4E 1abf80
Amd64VtoP: PDPE 3b09038
Amd64VtoP: PDE 3b0ad68
Amd64VtoP: PTE 510d920
Amd64VtoP: Mapped phys f88f80
Virtual address fffff801f5b24f80 translates to physical address f88f80.
而另一个内核地址,只在R0被影射为物理地址f88f80.而在R3没有映射
提示错误 Virtual address fffff801f5b24f80 translation fails, error 0xD0000147.