pspcidtable 学习

PspCidTable   is  an  undocmented variable  in  Windows  kernel...  it contains HANDLE_TABLE...

if get address of PspCidTable , i find the follow methods to get it  in net...  thx for sudami 's article...

 

1. 通过暴力搜索特征值的办法得到 PspCidTable的地址。。

要搜索的函数有:

PsLookupProcessThreadByCid()
PsLookupProcessByProcessId()
PsLookupThreadByThreadId()

 

从wrk上看到的 PsLookupProcessByProcessId() 的原码:

Code

 

里面有这样的一段:

.........

 20      KeEnterCriticalRegionThread (&CurrentThread->Tcb);

 21      CidEntry = ExMapHandleToPointer(PspCidTable, ProcessId);

.........

这样找到这个函数的汇编代码,然后穷搜这一句就可以了。。。

通过windbg看到的反汇编代码:

kd> u nt! PsLookupProcessByProcessId+0x12
nt!PsLookupProcessByProcessId+0x12:
80572960 ff8ed4000000            dec     dword ptr [esi+0D4h]
80572966 ff3560245680            push    dword ptr [nt!PspCidTable (80562460)]
8057296c e8dc50ffff                  call    nt!ExMapHandleToPointer (80567a4d)
80572971 8bd8                         mov     ebx,eax
80572973 85db                         test    ebx,ebx
80572975 c745080d0000c0        mov     dword ptr [ebp+8],0C000000Dh
8057297c 7432                         je      nt!PsLookupProcessByProcessId+0x62 (805729b0)
8057297e 57                            push    edi

便找到PspCidTable的地址了。。。

代码实现如下:

 


 

 

 

Code

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2009-04-06 14:18  甜甜嘟嘟  阅读(550)  评论(0编辑  收藏  举报