遍历CallBack对象 和 HHIVE对象

内核中有个PLIST_ENTRY CmpHiveListHead;
CmpHiveListHead = &CMHIVE.HiveList;

CMHIVE结构如下:
kd> dt _CMHIVE
nt!_CMHIVE
   +0x000 Hive             : _HHIVE
   +0x210 FileHandles      : [3] Ptr32 Void
   +0x21c NotifyList       : _LIST_ENTRY
   +0x224 HiveList         : _LIST_ENTRY
   +0x22c HiveLock         : Ptr32 _FAST_MUTEX
   +0x230 ViewLock         : Ptr32 _FAST_MUTEX
   +0x234 LRUViewListHead  : _LIST_ENTRY
   +0x23c PinViewListHead  : _LIST_ENTRY
   +0x244 FileObject       : Ptr32 _FILE_OBJECT
   +0x248 FileFullPath     : _UNICODE_STRING
   +0x250 FileUserName     : _UNICODE_STRING
   +0x258 MappedViews      : Uint2B
   +0x25a PinnedViews      : Uint2B
   +0x25c UseCount         : Uint4B
   +0x260 SecurityCount    : Uint4B
   +0x264 SecurityCacheSize : Uint4B
   +0x268 SecurityHitHint  : Int4B
   +0x26c SecurityCache    : Ptr32 _CM_KEY_SECURITY_CACHE_ENTRY
   +0x270 SecurityHash     : [64] _LIST_ENTRY
   +0x470 UnloadEvent      : Ptr32 _KEVENT
   +0x474 RootKcb          : Ptr32 _CM_KEY_CONTROL_BLOCK
   +0x478 Frozen           : UChar
   +0x47c UnloadWorkItem   : Ptr32 _WORK_QUEUE_ITEM
   +0x480 GrowOnlyMode     : UChar
   +0x484 GrowOffset       : Uint4B
   +0x488 KcbConvertListHead : _LIST_ENTRY
   +0x490 KnodeConvertListHead : _LIST_ENTRY
   +0x498 CellRemapArray   : Ptr32 _CM_CELL_REMAP_BLOCK

遍历CmpHiveListHead就能得到所有的HHIVE的地址,
HHIVE结构如下:
kd> dt _HHIVE
nt!_HHIVE
   +0x000 Signature        : Uint4B
   +0x004 GetCellRoutine   : Ptr32     _CELL_DATA* 
   +0x008 ReleaseCellRoutine : Ptr32     void 
   +0x00c Allocate         : Ptr32     void* 
   +0x010 Free             : Ptr32     void 
   +0x014 FileSetSize      : Ptr32     unsigned char 
   +0x018 FileWrite        : Ptr32     unsigned char 
   +0x01c FileRead         : Ptr32     unsigned char 
   +0x020 FileFlush        : Ptr32     unsigned char 
   +0x024 BaseBlock        : Ptr32 _HBASE_BLOCK
   +0x028 DirtyVector      : _RTL_BITMAP
   +0x030 DirtyCount       : Uint4B
   +0x034 DirtyAlloc       : Uint4B
   +0x038 RealWrites       : UChar
   +0x03c Cluster          : Uint4B
   +0x040 Flat             : UChar
   +0x041 ReadOnly         : UChar
   +0x042 Log              : UChar
   +0x044 HiveFlags        : Uint4B
   +0x048 LogSize          : Uint4B
   +0x04c RefreshCount     : Uint4B
   +0x050 StorageTypeCount : Uint4B
   +0x054 Version          : Uint4B
   +0x058 Storage          : [2] _DUAL 

  这里主要在 CmpHiveListHead 里的地址。实际上是 CMHIVE 结构的 hivelist地址。所有-0x30c(win7 32为是这样) 就是CMHIVE地址。

CallBack对象在

\CallBack目录里

   怎么遍历 \CallBack目录  请参考    windows遍历驱动

POBJECT_DIRECTORY_ENTRY 结构里  Object 指向 CALLBACK_OBJECT 对象

 jpg 改 rar

原文地址:https://www.cnblogs.com/kuangke/p/5909742.html