【问题标题】:what is nt!PsActiveProcessHead?什么是 nt!PsActiveProcessHead?
【发布时间】:2019-07-05 00:13:24
【问题描述】:

背景: 使用波动率时,变量PsActiveProcessHead 可以通过KDBGscan(死系统)找到,或者可以在Windows Crash Dump(同样,死系统)_DMP_HEADER 上找到。

在实时系统中,可以通过以下方式找到该符号的地址 (lkd>> x nt!PsActiveProcessHead)

问题: nt!PsActiveProcessHead 变量属于/引用哪个 Windows 内核对象/结构? (这个符号指向哪个对象/结构?)

例如,ActiveProcessLinks 也是一个_LIST_ENTRY 结构(与ActiveProcessHead 相同)属于_EPROCESS 对象。 ActiveProcessHead也有这样的对象吗?

【问题讨论】:

    标签: windows kernel windbg kernel-module


    【解决方案1】:

    是的,它还指向一个双向链表 (_LIST_ENTRY),更准确地说是指向 _EPROCESS.ActiveProcessLinks

    检查nt!PsActiveProcessHead指向的双向链表:

    0: kd> dt nt!_list_entry poi(nt!PsActiveProcessHead)
     [ 0xffffc582`ca5c3328 - 0xfffff804`40c10680 ]
       +0x000 Flink            : 0xffffc582`ca5c3328 _LIST_ENTRY [ 0xffffc582`d11d1328 - 0xffffc582`ca4b15e8 ]
       +0x008 Blink            : 0xfffff804`40c10680 _LIST_ENTRY [ 0xffffc582`ca4b15e8 - 0xffffc582`edada368 ]
    

    下一个条目:

    0: kd> dt nt!_list_entry poi(0xffffc582`ca5c3328)
     [ 0xffffc582`d0023428 - 0xffffc582`ca5c3328 ]
       +0x000 Flink            : 0xffffc582`d0023428 _LIST_ENTRY [ 0xffffc582`d54243a8 - 0xffffc582`d11d1328 ]
       +0x008 Blink            : 0xffffc582`ca5c3328 _LIST_ENTRY [ 0xffffc582`d11d1328 - 0xffffc582`ca4b15e8 ]
    

    获取ActiveProcessLink_EPROCESS结构中的偏移量:

    0: kd> ? @@c++(#FIELD_OFFSET(nt!_eprocess, ActiveProcessLinks))
    Evaluate expression: 744 = 00000000`000002e8
    

    只需确认我在上述输出中的前两个 flink(注意:我们从我们拥有的地址中删除 ActiveProcessLinks 的偏移量,然后从 EPROCESS 结构中转储 ImageFileName)。它只是证明它确实在_EPROCESS中指向ActiveProcessLinks

    0: kd> dt nt!_eprocess 0xffffc582`ca5c3328-@@c++(#FIELD_OFFSET(nt!_eprocess , ActiveProcessLinks)) ImageFileName
       +0x450 ImageFileName : [15]  "Registry"
    
    0: kd> dt nt!_eprocess 0xffffc582`d0023428-@@c++(#FIELD_OFFSET(nt!_eprocess , ActiveProcessLinks)) ImageFileName
       +0x450 ImageFileName : [15]  "csrss.exe"
    

    转储整个列表:

    0: kd> !list "-t nt!_eprocess.ActiveProcessLinks.Flink -e -x \"dt nt!_eprocess ImageFileName\"(poi(nt!PsActiveProcessHead) - @@c++(#FIELD_OFFSET(nt!_eprocess, ActiveProcessLinks)))"
    
    dt nt!_EPROCESS ImageFileName 0xffffc582ca4b1300
       +0x450 ImageFileName : [15]  "System"
    
    dt nt!_EPROCESS ImageFileName 0xffffc582ca5c3040
       +0x450 ImageFileName : [15]  "Registry"
    
    dt nt!_EPROCESS ImageFileName 0xffffc582d11d1040
       +0x450 ImageFileName : [15]  "smss.exe"
    
    dt nt!_EPROCESS ImageFileName 0xffffc582d0023140
       +0x450 ImageFileName : [15]  "csrss.exe"
    
     [...snip....]
    

    所以基本上它是一个当前活动进程的列表。它指向_EPROCESS.ActiveProcessLinks中的双向链表。

    【讨论】:

      猜你喜欢
      • 2021-10-30
      • 1970-01-01
      • 2020-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-22
      • 2011-06-21
      • 2016-10-19
      相关资源
      最近更新 更多