NtSetInformationDebugObject
INT64 __fastcall NtSetInformationDebugObject(
VOID *DebugObjectHandle,
INT64 DebugObjectInformationClass,
VOID *DebugInformation,
INT64 DebugInformationLength,
UINT64 *ReturnLength,
INT64 a6,
INT64 a7,
INT64 a8){
int v8;
KPROCESSOR_MODE v10;
char *v11;
__int64 v12;
UINT64 *v13;
INT64 result;
int v15;
char *v16;
unsigned int v17;
PVOID Object;
v8 = DebugObjectInformationClass;
v10 = *((_BYTE *)KeGetCurrentThread() + 562);
if( !v10 )
{
v13 = ReturnLength;
LABEL_14:
if( v13 )
*(_DWORD *)v13 = 0;
goto LABEL_16;
}
if( (_DWORD)DebugInformationLength )
{
if( ((unsigned __int8)DebugInformation & 3) != 0 )
ExRaiseDatatypeMisalignment();
v11 = (char *)DebugInformation + (unsigned int)DebugInformationLength;
v12 = 0x7FFFFFFF0000i64;
if( (unsigned __int64)v11 > 0x7FFFFFFF0000i64 || v11 < DebugInformation )
MEMORY[0x7FFFFFFF0000] = 0;
}
else
{
v12 = 0x7FFFFFFF0000i64;
}
v13 = ReturnLength;
if( ReturnLength )
{
if( (unsigned __int64)ReturnLength < 0x7FFFFFFF0000i64 )
v12 = (__int64)ReturnLength;
*(_DWORD *)v12 = *(_DWORD *)v12;
goto LABEL_14;
}
LABEL_16:
if( v8 != 1 )
return 3221225485i64;
if( (_DWORD)DebugInformationLength == 4 )
{
v15 = *(_DWORD *)DebugInformation;
if( (*(_DWORD *)DebugInformation & 0xFFFFFFFE) != 0 )
{
return 3221225485i64;
}
else
{
Object = 0i64;
LODWORD(result) = ObReferenceObjectByHandle(DebugObjectHandle, 4u, DbgkDebugObjectType, v10, &Object, 0i64);
if( (int)result >= 0 )
{
v16 = (char *)Object;
ExAcquireFastMutex((FAST_MUTEX *)((char *)Object + 24));
v17 = *((_DWORD *)v16 + 24) | 2;
if( (v15 & 1) == 0 )
v17 = *((_DWORD *)v16 + 24) & 0xFFFFFFFD;
*((_DWORD *)v16 + 24) = v17;
KeReleaseGuardedMutex((_FAST_MUTEX *)(v16 + 24));
HalPutDmaAdapter((PADAPTER_OBJECT)v16);
return 0i64;
}
}
}
else
{
if( v13 )
*(_DWORD *)v13 = 4;
return 3221225476i64;
}
return result;
}Referenced by:
No references.