status = ZwOpenDirectoryObject(&Handle, DIRECTORY_QUERY, &ObjectAttributes);
if (NT_SUCCESS (status))
{
status = ObReferenceObjectByHandle(Handle, FILE_READ_ACCESS, NULL, KernelMode, (PVOID *)&ObjectTypes_Directory, NULL);
if (NT_SUCCESS (status))
{
for ( ; i<37 ;i++)
{
//__try
//{
// WCHAR w = *(WCHAR *)(ObjectTypes_Directory->HashBuckets[i]->Object);//试探内存是否可访问.MmIsAddressValid要非分页,ProbeForRead 是用户模式.
//}
//__except (EXCEPTION_EXECUTE_HANDLER)
//{
// continue;
//}
if (ObjectTypes_Directory->HashBuckets[i] == NULL)
{
continue;
}
p = ObjectTypes_Directory->HashBuckets[i];
for ( ; ; )
{
pot = g_pObGetObjectType(ObjectTypes_Directory->HashBuckets[i]->Object);
//KdPrint(("文件路径为:%wZ\n",&(pot->Name)));//这种情况下,得到的值永远是Type.
pu = (PUNICODE_STRING)ExAllocatePoolWithTag(NonPagedPool, Length, TAG);
if (pu == 0) {
return STATUS_UNSUCCESSFUL;
}
RtlZeroMemory(pu, Length);
Hash Address Type Name
---- ------- ---- ----
00 fffffa8003cdc1d0 Type TmTm
01 fffffa8003cdb250 Type Desktop
fffffa8003c8fde0 Type Process
03 fffffa8003c8f8a0 Type DebugObject
04 fffffa8003cdc080 Type TpWorkerFactory
05 fffffa8003cdcf30 Type Adapter
fffffa8003c6aaa0 Type Token
08 fffffa8003cd08f0 Type EventPair
09 fffffa8003fa8200 Type PcwObject
fffffa8003cf83a0 Type WmiGuid
11 fffffa8003cf93a0 Type EtwRegistration
12 fffffa8003cdd590 Type Session
fffffa8003cdb790 Type Timer
13 fffffa8003cdb080 Type Mutant
16 fffffa8003cdc9f0 Type IoCompletion
17 fffffa8003cdb3a0 Type WindowStation
fffffa8003cdb640 Type Profile
18 fffffa8003cdc8a0 Type File
21 fffffa8003cdb8e0 Type Semaphore
23 fffffa8003cfa3a0 Type EtwConsumer
25 fffffa8003cddf30 Type TmTx
fffffa8003c6ac90 Type SymbolicLink
26 fffffa8003f35880 Type FilterConnectionPort
fffffa8003cb37a0 Type Key
fffffa8003cdb4f0 Type KeyedEvent
fffffa8003cdbf30 Type Callback
28 fffffa8003c8fb40 Type UserApcReserve
fffffa8003c8ff30 Type Job
29 fffffa8003cdcde0 Type Controller
fffffa8003c8f9f0 Type IoCompletionReserve
30 fffffa8003cdcc90 Type Device
fffffa8003c6ade0 Type Directory
31 fffffa8003cdd6e0 Type Section
fffffa8003cddc90 Type TmEn
fffffa8003c8fc90 Type Thread
32 fffffa8003c6af30 Type Type
33 fffffa8003f5ff30 Type FilterCommunicationPort
fffffa8003cbc7f0 Type PowerRequest
35 fffffa8003cddde0 Type TmRm
fffffa8003cd0a40 Type Event
36 fffffa8003cb7ac0 Type ALPC Port
fffffa8003cdcb40 Type Driver
还可以对照:Winobj(EX).exe或者其他工具查看对比.
made by correy
made at 2013.08.23
email:kouleguan at hotmail dot com
homepage:http://correy.webs.com
不足之处,敬请指出.