VslStartSecureProcessor

INT64 __stdcall VslStartSecureProcessor(UINT32 ecx0, INT64 a2){
  PHYSICAL_ADDRESS *PoolWithTag; 
  PHYSICAL_ADDRESS *v5; 
  INT64 v6; 
  __int64 v7; 
  int v8; 
  INT64 v9[10]; 
  INT64 result[10]; 
  INT64 a4[14]; 
  memset((INT64)result, 0i64);
  memset((INT64)a4, 0i64);
  memset((INT64)v9, 0i64);
  PoolWithTag = (PHYSICAL_ADDRESS *)ExAllocatePoolWithTag(NonPagedPoolNx, 0x100ui64, 0x54736D56ui64);
  v5 = PoolWithTag;
  if( !PoolWithTag )
    return 3221225626i64;
  v7 = *((_QWORD *)KeLoaderBlock_0 + 17);
  PoolWithTag->LowPart = ecx0;
  PoolWithTag->HighPart = *(unsigned __int8 *)(v7 + 209) | (*(unsigned __int8 *)(v7 + 208) << 8);
  *(_OWORD *)&PoolWithTag[4].LowPart = *(_OWORD *)a2;
  *(_OWORD *)&PoolWithTag[6].LowPart = *(_OWORD *)(a2 + 16);
  *(_OWORD *)&PoolWithTag[8].LowPart = *(_OWORD *)(a2 + 32);
  *(_OWORD *)&PoolWithTag[10].LowPart = *(_OWORD *)(a2 + 48);
  *(_OWORD *)&PoolWithTag[12].LowPart = *(_OWORD *)(a2 + 64);
  *(_OWORD *)&PoolWithTag[14].LowPart = *(_OWORD *)(a2 + 80);
  *(_OWORD *)&PoolWithTag[16].LowPart = *(_OWORD *)(a2 + 96);
  *(_OWORD *)&PoolWithTag[18].LowPart = *(_OWORD *)(a2 + 112);
  *(_OWORD *)&PoolWithTag[20].LowPart = *(_OWORD *)(a2 + 128);
  *(_OWORD *)&PoolWithTag[22].LowPart = *(_OWORD *)(a2 + 144);
  *(_OWORD *)&PoolWithTag[24].LowPart = *(_OWORD *)(a2 + 160);
  *(_OWORD *)&PoolWithTag[26].LowPart = *(_OWORD *)(a2 + 176);
  *(_OWORD *)&PoolWithTag[28].LowPart = *(_OWORD *)(a2 + 192);
  *(_OWORD *)&PoolWithTag[30].LowPart = *(_OWORD *)(a2 + 208);
  v6 = VslpLockPagesForTransfer((INT64)result, v7 - 384, 0xB080ui64, 2i64, 2);
  if( (int)v6 >= 0 )
  {
    v5[1] = (PHYSICAL_ADDRESS)result[0];
    v5[2] = (PHYSICAL_ADDRESS)result[7];
    v5[3] = MmGetPhysicalAddress(*(PVOID *)(a2 + 176));
    v8 = VslpLockPagesForTransfer((INT64)v9, (INT64)v5, 0x100ui64, 0i64, 0);
    if( v8 >= 0 )
    {
      a4[1] = v9[0];
      a4[2] = v9[7];
      v8 = VslpEnterIumSecureMode(2u, 2, 0i64, (INT64)a4);
      VslpUnlockPagesForTransfer((INT64 **)v9);
    }
    VslpUnlockPagesForTransfer((INT64 **)result);
    ExFreePoolWithTag(v5, 0);
    return(unsigned int)v8;
  }
  return v6;
}

Referenced by:

HvlHalStartVirtualProcessor