ExpCovQueryHypervisorInformation

VOID __stdcall ExpCovQueryHypervisorInformation(INT64 *a1){
  VOID **v2; 
  VOID **PoolWithTag; 
  wchar_t *v4; 
  __int64 v5; 
  CHAR v6; 
  unsigned int v7; 
  int v8; 
  INT64 v9; 
  __int64 v10; 
  unsigned int v11; 
  unsigned int v12; 
  unsigned int v13; 
  unsigned int v14; 
  unsigned int v15; 
  VOID **v16; 
  size_t Length; 
  unsigned __int16 MaximumLength; 
  VOID *v19; 
  size_t v20; 
  wchar_t *Buffer; 
  _UNICODE_STRING DestinationString; 
  UINT64 NumberOfBytes; 
  unsigned int v24; 
  unsigned int v25; 

  v24 = 0;
  v2 = 0i64;
  DestinationString = 0i64;
  LODWORD(NumberOfBytes) = 0;
  if( (_BYTE)HvlHypervisorConnected )
  {
    PoolWithTag = ExAllocatePoolWithTag(1ui64, 0x40ui64, 1920364355i64);
    v4 = (wchar_t *)PoolWithTag;
    if( PoolWithTag )
    {
      memset(PoolWithTag, 0i64, 0x40u);
      if( HvlGetCoverageInfo(v4, v5, &NumberOfBytes, &v24) )
      {
        RtlInitUnicodeString(&DestinationString, v4);
        v6 = *((_BYTE *)a1 + 12);
        v7 = *((_DWORD *)a1 + 2);
        v8 = *((_DWORD *)a1 + 12);
        v9 = *a1;
        v25 = v7;
        if( v6 )
        {
          if( v6 == 1 && v8 == 2 )
          {
            v10 = v24;
            if( !RtlCompareUnicodeString((const _UNICODE_STRING *)a1 + 1, &DestinationString, 1u) )
            {
              v7 = v25;
              goto LABEL_11;
            }
          }
        }
        else if( !v8 )
        {
          v10 = (unsigned int)NumberOfBytes;
LABEL_11:
          v11 = -1;
          if( (unsigned int)v10 < 0xFFFFFFE0 )
          {
            v12 = DestinationString.Length + v10 + 32;
            if( v12 < 0x20 )
              v12 = -1;
            v11 = v12;
          }
          v13 = *((_DWORD *)a1 + 14);
          v14 = v13 + v11;
          if( v13 + v11 >= v13 )
          {
            *((_DWORD *)a1 + 14) = v14;
            if( v7 >= v14 )
            {
              v15 = 4096;
              if( (unsigned int)v10 > 0x1000 )
                v15 = v10;
              v16 = ExAllocatePoolWithTag(0x200ui64, v15, 1920364355i64);
              v2 = v16;
              if( v16 )
              {
                if( HvlGetCoverageData(v6, (unsigned int)v10, v16) )
                {
                  *(_DWORD *)(v9 + 4) = 1;
                  *(_DWORD *)v9 = v11;
                  *(_DWORD *)(v9 + 24) = v10;
                  memmove((VOID *)(v9 + 28), v2, v10);
                  Length = DestinationString.Length;
                  MaximumLength = DestinationString.MaximumLength;
                  v19 = (VOID *)(v10 + v9 + 32);
                  *(_WORD *)(v9 + 8) = DestinationString.Length;
                  v20 = Length;
                  Buffer = DestinationString.Buffer;
                  *(_QWORD *)(v9 + 16) = v19;
                  *(_WORD *)(v9 + 10) = MaximumLength;
                  memmove(v19, Buffer, v20);
                  ++*((_DWORD *)a1 + 13);
                  *a1 += v11;
                  if( v6 )
                    HvlResetCoverageVector();
                }
              }
            }
            else
            {
              ++*((_DWORD *)a1 + 13);
            }
          }
        }
      }
      ExFreePoolWithTag(v4, 0);
      if( v2 )
        ExFreePoolWithTag(v2, 0);
    }
  }
}

Referenced by:

ExpCovQueryInformation