SSDT Hook ZwOpenThread后,ZwQueryInformationThread一直失败
请问是不是不能在这里使用ZwQueryInformationThread呢,如果是该如何处理呢?
NTSTATUS Hook_ZwOpenThread(
OUT PHANDLE ThreadHandle,
IN ACCESS_MASK AccessMask,
IN POBJECT_ATTRIBUTES ObjectAttributes,
IN PCLIENT_ID ClientId )
{
NTSTATUS ntStatus,QueryStatus;
THREAD_BASIC_INFORMATION tbi;
ULONG PID = 0;
ntStatus = OldZwOpenThread(ThreadHandle,AccessMask,ObjectAttributes,ClientId);
if( uProcetProcessId != 0 )
{
if( NT_SUCCESS(ntStatus))
{
QueryStatus = ZwQueryInformationThread(ThreadHandle,ThreadBasicInformation,&tbi,sizeof(THREAD_BASIC_INFORMATION),NULL);
if( NT_SUCCESS(QueryStatus))
{
DbgPrint("Hook_ZwOpenThread ZwQueryInformationThread %u",(ULONG)tbi.ClientId.UniqueProcess);
PID = (ULONG)tbi.ClientId.UniqueProcess;
if( PID == uProcetProcessId )
{
DbgPrint("Hook_ZwOpenThread %d",uProcetProcessId);
ThreadHandle = NULL;
return STATUS_ACCESS_DENIED;
}
}
else
{
DbgPrint("ZwQueryInformationThread FAILED: %08X ,%08X\n", QueryStatus,(ULONG)ThreadHandle);
}
}
}
return ntStatus;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!