HalpKdEnumerateDebuggingDevices
NTSTATUS __stdcall HalpKdEnumerateDebuggingDevices(
VOID *LoaderBlock,
_DEBUG_DEVICE_DESCRIPTOR *Device,
KD_CALLBACK_ACTION Callback,
_DEBUG_DEVICE_DESCRIPTOR **a4){
_DWORD *v6;
__int128 v7;
unsigned int v8;
VOID **PoolWithTag;
int v10;
UINT64 v11;
unsigned __int64 v12;
VOID **v13;
if( !Device )
return -1073741811;
if( Device->Configured )
return 0;
if( qword_140C49C28
&& *((_BYTE *)qword_140C49C28 + 19)
&& (unsigned __int8)HalpDeviceEquals((_DEBUG_DEVICE_DESCRIPTOR *)LoaderBlock, Device) )
{
v6 = qword_140C49C28;
*(_OWORD *)&Device->Bus = *(_OWORD *)qword_140C49C28;
*(_OWORD *)&Device->ProgIf = *((_OWORD *)v6 + 1);
*(_OWORD *)&Device->BaseAddress[0].TranslatedAddress = *((_OWORD *)v6 + 2);
*(_OWORD *)&Device->BaseAddress[1].Type = *((_OWORD *)v6 + 3);
*(_OWORD *)&Device->BaseAddress[1].Length = *((_OWORD *)v6 + 4);
*(_OWORD *)&Device->BaseAddress[2].TranslatedAddress = *((_OWORD *)v6 + 5);
*(_OWORD *)&Device->BaseAddress[3].Type = *((_OWORD *)v6 + 6);
v7 = *((_OWORD *)v6 + 7);
v6 += 32;
*(_OWORD *)&Device->BaseAddress[3].Length = v7;
*(_OWORD *)&Device->BaseAddress[4].TranslatedAddress = *(_OWORD *)v6;
*(_OWORD *)&Device->BaseAddress[5].Type = *((_OWORD *)v6 + 1);
*(_OWORD *)&Device->BaseAddress[5].Length = *((_OWORD *)v6 + 2);
*(_OWORD *)&Device->Memory.MaxEnd.anonymous_0.LowPart = *((_OWORD *)v6 + 3);
*(_OWORD *)&Device->Memory.Length = *((_OWORD *)v6 + 4);
*(_OWORD *)&Device->OemData = *((_OWORD *)v6 + 5);
*(_OWORD *)&Device->NameSpacePath = *((_OWORD *)v6 + 6);
Device->TransportData = (_DEBUG_TRANSPORT_DATA)*((_QWORD *)v6 + 14);
v8 = qword_140C49C28[54];
if( v8 && *((_QWORD *)qword_140C49C28 + 26) )
{
if( ::LoaderBlock )
HalpMmAllocateMemory(v8);
else
PoolWithTag = ExAllocatePoolWithTag(1ui64, (unsigned int)qword_140C49C28[54], 543973704i64);
Device->OemData = PoolWithTag;
if( !PoolWithTag )
return -1073741823;
memmove(PoolWithTag, *((const VOID **)qword_140C49C28 + 26), qword_140C49C28[54]);
}
v10 = qword_140C49C28[58];
if( !v10 || !*((_QWORD *)qword_140C49C28 + 28) )
goto LABEL_22;
v11 = (unsigned int)(v10 + 2);
v12 = (unsigned int)v11;
if( ::LoaderBlock )
HalpMmAllocateMemory(v11);
else
v13 = ExAllocatePoolWithTag(1ui64, (unsigned int)v11, 543973704i64);
Device->NameSpacePath = (wchar_t *)v13;
if( v13 )
{
memset(v13, 0i64, v12);
wcsncpy_s(
Device->NameSpacePath,
v12 >> 1,
*((WCHAR **)qword_140C49C28 + 28),
(unsigned __int64)(unsigned int)qword_140C49C28[58] >> 1);
LABEL_22:
*(_WORD *)&Device->Initialized = 256;
return 0;
}
}
return -1073741823;
}Referenced by:
HalpKdSetupDebuggingDevice