PsBootPhaseComplete

VOID __stdcall PsBootPhaseComplete(){
  WCHAR *v0; 
  _BOOL8 v1; 
  WCHAR *v2; 
  char v3; 
  INT64 v4; 
  INT64 v5; 
  NTSTATUS v6; 
  VOID *v7; 
  unsigned int *v8; 
  int v9; 
  unsigned int v10; 
  NTSTATUS v11; 
  PKINTERRUPT_ROUTINE **v12; 
  UINT32 v13; 
  PKINTERRUPT_ROUTINE *v14; 
  _EJOB *v15; 
  _ESERVERSILO_GLOBALS *ServerSiloGlobals; 
  INT64 Length; 
  UINT64 Lengtha; 
  INT64 Lengthb; 
  UINT64 Lengthc; 
  UINT64 *ResultLength; 
  UINT64 *ResultLengtha; 
  INT64 v23; 
  INT64 v24; 
  INT64 v25; 
  INT64 v26; 
  VOID *KeyHandle; 
  __int64 Buffer; 
  __int64 v29[2]; 
  _UNICODE_STRING ValueName; 
  __int64 v31[2]; 
  _OBJECT_ATTRIBUTES ObjectAttributes; 
  __int128 KeyValueInformation; 
  int v34[2]; 
  const wchar_t *v35; 
  int v36[4]; 
  const wchar_t *v37; 
  int v38; 
  int v39; 
  const wchar_t *v40; 
  int v41; 

  v29[0] = 8650882i64;
  Buffer = 0i64;
  v29[1] = (__int64)L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\LsaInformation";
  KeyHandle = 0i64;
  ValueName.Buffer = L"UACInstalled";
  *(_QWORD *)&ValueName.Length = 1703960i64;
  v31[1] = (__int64)L"\\Registry\\Machine\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
  *(&ObjectAttributes.Length + 1) = 0;
  v35 = L"EnableLUA";
  *(&ObjectAttributes.Attributes + 1) = 0;
  v37 = L"EnableVirtualization";
  v31[0] = 9961622i64;
  v40 = L"EnableInstallerDetection";
  KeyValueInformation = 0i64;
  v34[0] = 1310738;
  v36[0] = 1;
  v36[2] = 2752552;
  v38 = 2;
  v39 = 3276848;
  v41 = 3;
  if( RtlQueryImageFileExecutionOptions(v0, (VOID *)L"DevOverrideEnable") >= 0 )
  {
    v1 = (_DWORD)Buffer != 0;
    PspGlobalFlags = v1 | PspGlobalFlags & 0xFFFFFFFE;
  }
  RtlQueryImageFileExecutionOptions((WCHAR *)v1, (VOID *)L"MaxLoaderThreads");
  RtlQueryImageFileExecutionOptions(v2, (VOID *)L"NoRemoteThreadBeforeProcessInit");
  v3 = 0;
  ObjectAttributes.ObjectName = (_UNICODE_STRING *)v29;
  ObjectAttributes.Length = 48;
  ObjectAttributes.RootDirectory = 0i64;
  ObjectAttributes.Attributes = 576;
  *(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
  if( ZwOpenKey(&KeyHandle, 1ui64, &ObjectAttributes, v4, Length, (INT64)ResultLength, v23, v25) >= 0 )
  {
    LODWORD(Lengtha) = 16;
    if( ZwQueryValueKey(
           KeyHandle,
           &ValueName,
           KeyValuePartialInformation,
           &KeyValueInformation,
           Lengtha,
           (UINT64 *)((char *)&Buffer + 4)) >= 0
      && *(_QWORD *)((char *)&KeyValueInformation + 4) == 0x400000004i64
      && HIDWORD(KeyValueInformation) )
    {
      v3 = 1;
    }
    ObCloseHandle(KeyHandle, 0);
    KeyHandle = 0i64;
    if( v3 )
    {
      ObjectAttributes.Length = 48;
      ObjectAttributes.ObjectName = (_UNICODE_STRING *)v31;
      ObjectAttributes.RootDirectory = 0i64;
      ObjectAttributes.Attributes = 576;
      *(_OWORD *)&ObjectAttributes.SecurityDescriptor = 0i64;
      v6 = ZwOpenKey(&KeyHandle, 1ui64, &ObjectAttributes, v5, Lengthb, (INT64)ResultLengtha, v24, v26);
      v7 = KeyHandle;
      v8 = (unsigned int *)v36;
      v9 = v6;
      v10 = 0;
      if( v6 < 0 )
        v7 = 0i64;
      KeyHandle = v7;
      do
      {
        if( v7 )
        {
          LODWORD(Lengthc) = 16;
          v11 = ZwQueryValueKey(
                  v7,
                  (_UNICODE_STRING *)&v34[6 * v10],
                  KeyValuePartialInformation,
                  &KeyValueInformation,
                  Lengthc,
                  (UINT64 *)((char *)&Buffer + 4));
          v7 = KeyHandle;
          v9 = v11;
        }
        if( v9 < 0 || HIDWORD(KeyValueInformation) || *(_QWORD *)((char *)&KeyValueInformation + 4) != 0x400000004i64 )
        {
          _interlockedbittestandset((volatile signed __int32 *)&KUSER_SHARED_DATA.SharedDataFlags, *v8);
          v7 = KeyHandle;
        }
        ++v10;
        v8 += 6;
      }
      while( v10 < 3 );
      if( v7 )
        ObCloseHandle(v7, 0);
    }
  }
  PsCpuFairShareEnabled = PspIsDfssEnabled();
  LODWORD(v15) = HalSystemVectorDispatchEntry(v13, v12, v14);
  ServerSiloGlobals = PsGetServerSiloGlobals(v15);
  ServerSiloGlobals->OneCoreForwardersEnabled = PspQueryForwardersEnabled();
  PspGlobalFlags = PspGlobalFlags & 0xFFFFFFF3 | 4;
}

Referenced by:

CmCompleteRegistryInitialization
CmpFinishSystemHivesLoad