MxSwitchDescriptors
UINT64 *__fastcall MxSwitchDescriptors(UINT64 a1){
_LOADER_PARAMETER_BLOCK *v1;
unsigned __int64 v2;
char *v3;
UINT64 *v4;
UINT64 v5;
int v6;
unsigned int v7;
__int64 *v8;
__int64 v9;
__int64 v10;
__int64 v11;
UINT64 *result;
v1 = KeLoaderBlock_0;
v2 = (unsigned int)a1;
v3 = (char *)KeLoaderBlock_0 + 32;
v4 = (UINT64 *)&qword_140D5AD60[5 * (unsigned int)a1];
v5 = v4[4];
while( 2 )
{
if( !v5 )
{
v5 = *((_QWORD *)v1 + 5);
goto LABEL_14;
}
while( 1 )
{
v5 = *(_QWORD *)(v5 + 8);
LABEL_14:
if( (char *)v5 == v3 )
break;
v6 = *(_DWORD *)(v5 + 16);
if( v6 == 2 || v6 == 24 )
{
v7 = 0;
if( KeNumberNodes )
{
v8 = qword_140D5A380;
do
{
if( v5 == *v8 )
break;
++v7;
v8 += 5;
}
while( v7 < (unsigned __int16)KeNumberNodes );
}
if( v7 >= (unsigned __int16)KeNumberNodes )
{
LODWORD(v9) = MiSearchNumaNodeTable(*(PVOID *)(v5 + 24));
if( *(_DWORD *)(v9 + 8) == (_DWORD)v2 || (v10 = MxBootDescriptorAnyNode, _bittest64(&v10, v2)) )
{
MiInitializeBootMemoryDescriptor(v4, v5, *(_QWORD *)(v5 + 24), *(_QWORD *)(v5 + 32));
*(_DWORD *)(v5 + 16) |= 0x40000000u;
result = v4;
MxFreeDescriptor[v2] = (__int64)v4;
return result;
}
}
}
}
v11 = MxBootDescriptorAnyNode;
if( !_bittest64(&v11, v2) )
{
v4[4] = 0i64;
MxBootDescriptorAnyNode = v11 | (1i64 << v2);
v5 = 0i64;
continue;
}
return 0i64;
}
}Referenced by:
MxGetNextPage