为什么某些进程的 nt!_object_type 为空

逆向工程 视窗
2021-06-25 22:43:55

我尝试添加 notepad.exe 进程的 nt!_object_type。不过好像是空的。是否某个进程没有对象类型?

在此处输入图片说明

更正我上面使用 EPROCESS 地址提取 TypeIndex 而不是使用流程对象的标头的屏幕截图。

这次我猜对了,首先我确定TypeIndex属于记事本的进程对象是0x98.

通过将值0x98插入ObTypeIndexTable,我看到了空结构。

知道为什么吗?以下是更新后的截图。

在此处输入图片说明

1个回答

EPROCESS 不代表 OBJECT_HEADER

!process 0 0 notepad.exe 为您提供 EPROCESS

我认为 object_header 没有记录

在 x86 (win7 sp2) 上它是 OBJECT 之前的 0x18 个字节

如果我在较新的操作系统中没有弄错的话,Typeindex 字段也已重新调整用途

以下显示来自 win7sp2 32bit vm

kd> dt nt!_OBJECT_HEADER TypeIndex @$proc-0x18
   +0x00c TypeIndex : 0x7 ''
kd>

使用类型索引并检索 ObjectType 名称

kd> ?? ((nt!_OBJECT_TYPE **) @@masm(nt!ObTypeIndexTable))[7]->Name
struct _UNICODE_STRING
 "Process"
   +0x000 Length           : 0xe
   +0x002 MaximumLength    : 0x10
   +0x004 Buffer           : 0x89e04008  "Process"
kd>

一些进一步的类型索引示例

kd> .for (r $t0=3 ;@$t0<18;r $t0=@$t0+1) { du @@c++(((nt!_OBJECT_TYPE **) @@masm(nt!ObTypeIndexTable))[@$t0]->Name.Buffer)}
89e01980  "Directory"
89e01940  "SymbolicLink"
89e01430  "Token"
89e01088  "Job"
89e04008  "Process"
89e04fd8  "Thread"
89e04f98  "UserApcReserve"
89e04f48  "IoCompletionReserve"
89e04960  "DebugObject"
89e08840  "Event"
89e040a0  "EventPair"
89e04070  "Mutant"
89e04c10  "Callback"
89e04e60  "Semaphore"
89e04770  "Timer"
89e04728  "Profile"
89e08ee8  "KeyedEvent"
89e09b18  "WindowStation"
89e092a8  "Desktop"
89e09b40  "TpWorkerFactory"
89e046e0  "Adapter"
kd>