HalpMiscGetParameters

VOID __stdcall HalpMiscGetParameters(_LOADER_PARAMETER_BLOCK *LoaderBlock){
  CHAR v2; 
  char *LoadOptions; 
  CHAR v4; 
  CHAR v5; 
  __int64 v6; 
  CHAR v7; 
  __int64 v8; 
  CHAR v9; 
  __int64 v10; 
  char *v11; 
  CHAR v12; 
  char *v13; 
  CHAR v14; 
  CHAR v15; 
  __int64 v16; 
  CHAR v17; 
  __int64 v18; 
  CHAR v19; 
  __int64 v20; 
  CHAR v21; 
  __int64 v22; 
  CHAR v23; 
  __int64 v24; 
  CHAR v25; 
  __int64 v26; 
  __int64 v27; 
  CHAR v28; 
  __int64 v29; 
  CHAR v30; 
  __int64 v31; 
  __int64 v32; 
  char IsHvUsedForReboot; 
  CHAR v34; 
  CHAR v35; 
  __int64 v36; 
  CHAR v37; 
  __int64 v38; 
  CHAR v39; 
  __int64 v40; 
  char *v41; 
  CHAR v42; 
  CHAR v43; 
  CHAR v44; 
  char v45; 
  NTSTATUS v46; 
  char v47; 
  NTSTATUS v48; 
  CHAR v49; 
  char v50; 
  NTSTATUS v51; 

  if( HalpInterruptModel() == 1 )
    byte_140C49C49 = 1;
  *(&CmpDummyThreadEvent + 7093) = HalpProcIsSmtDisabled((__int64)LoaderBlock);
  if( *(&CmpDummyThreadEvent + 7093) )
  {
    if( !LoaderBlock )
      return;
    if( (LoaderBlock->Extension->_bf_84 & 0x200) == 0 )
      *(&CmpDummyThreadEvent + 7092) = 1;
  }
  if( LoaderBlock )
  {
    LoadOptions = LoaderBlock->LoadOptions;
    if( LoadOptions )
    {
      strstr((UINT8 *)LoadOptions, (UINT8 *)"SAFEBOOT:", v2);
      strstr((UINT8 *)LoadOptions, (UINT8 *)"ONECPU", v4);
      if( v6 )
        *(&stru_140CF2E80 + 1859) = 1;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"USEPHYSICALAPIC", v5);
      if( v8 )
        *(&stru_140CF2E80 + 6616) = 1;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"BREAK", v7);
      if( v10 )
        byte_140C49C48 = 1;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"MAXPROCSPERCLUSTER", v9);
      if( v11 )
      {
        while( 1 )
        {
          v45 = *v11;
          if( !*v11 || v45 == 32 || (unsigned __int8)(v45 - 48) <= 9u )
            break;
          ++v11;
        }
        v46 = atoi(v11);
        HalpInterruptClusterModeForced = 1;
        if( v46 )
          HalpInterruptMaxClusterSize = v46;
      }
      strstr((UINT8 *)LoadOptions, (UINT8 *)"MAXAPICCLUSTER", v12);
      if( v13 )
      {
        while( 1 )
        {
          v47 = *v13;
          if( !*v13 || v47 == 32 || (unsigned __int8)(v47 - 48) <= 9u )
            break;
          ++v13;
        }
        v48 = atoi(v13);
        if( v48 )
          LODWORD(HalpInterruptMaxCluster) = v48;
      }
      strstr((UINT8 *)LoadOptions, (UINT8 *)"X2APICPOLICY=ENABLE", v14);
      if( v16 )
        HalpInterruptX2ApicPolicy = 1;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"X2APICPOLICY=DISABLE", v15);
      if( v18 )
        HalpInterruptX2ApicPolicy = 0;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"USELEGACYAPICMODE", v17);
      if( v20 )
        HalpInterruptX2ApicPolicy = 0;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"TSCSYNCPOLICY=LEGACY", v19);
      if( v22 )
        dword_140C4A3EC = 1;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"TSCSYNCPOLICY=ENHANCED", v21);
      if( v24 )
        dword_140C4A3EC = 2;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"SYSTEMWATCHDOGPOLICY=DISABLED", v23);
      if( v26 )
      {
        byte_140C4A360 = 1;
      }
      else
      {
        strstr((UINT8 *)LoadOptions, (UINT8 *)"SYSTEMWATCHDOGPOLICY=PHYSICALONLY", v25);
        if( v27 )
          byte_140C4A329 = 1;
      }
      strstr((UINT8 *)LoadOptions, (UINT8 *)"CONFIGACCESSPOLICY=DISALLOWMMCONFIG", v25);
      if( v29 )
        HalpAvoidMmConfigAccessMethod = 1;
      strstr((UINT8 *)LoadOptions, (UINT8 *)"MSIPOLICY=FORCEDISABLE", v28);
      if( v31 )
      {
        v49 = 0;
      }
      else
      {
        strstr((UINT8 *)LoadOptions, (UINT8 *)"FORCEMSI", v30);
        if( !v32 )
        {
LABEL_31:
          if( HalpIsHvPresent() )
          {
            byte_140C4A319 = 1;
            if( (unsigned __int8)HalpIsPartitionCpuManager() )
              byte_140C4A318 = 1;
            IsHvUsedForReboot = HalpIsHvUsedForReboot();
          }
          else
          {
            IsHvUsedForReboot = HalpIsXboxNanovisorPresent();
          }
          if( IsHvUsedForReboot )
            byte_140C4A0F8 = 1;
          strstr((UINT8 *)LoadOptions, (UINT8 *)"FIRSTMEGABYTEPOLICY=USEALL", v34);
          if( v36 || HalpIsMicrosoftCompatibleHvLoaded() && !byte_140C4A318 )
            byte_140C49C49 = 0;
          strstr((UINT8 *)LoadOptions, (UINT8 *)"USEPLATFORMCLOCK", v35);
          if( v38 )
            HalpTimerPlatformSourceForced = 1;
          strstr((UINT8 *)LoadOptions, (UINT8 *)"USEPLATFORMTICK", v37);
          if( v40 )
            HalpTimerPlatformClockSourceForced = 1;
          strstr((UINT8 *)LoadOptions, (UINT8 *)"GROUPSIZE", v39);
          if( v41 )
          {
            while( 1 )
            {
              v50 = *v41;
              if( !*v41 || v50 == 32 || (unsigned __int8)(v50 - 48) <= 9u )
                break;
              ++v41;
            }
            v51 = atoi(v41);
            HalpMaximumGroupSize = v51;
            if( (unsigned int)(v51 - 1) > 0x3F || ((v51 - 1) & v51) != 0 )
              HalpMaximumGroupSize = 64;
          }
          strstr((UINT8 *)LoadOptions, (UINT8 *)"HALTPROFILINGPOLICY=BLOCKED", v42);
          strstr((UINT8 *)LoadOptions, (UINT8 *)"HALTPROFILINGPOLICY=RELAXED", v43);
          strstr((UINT8 *)LoadOptions, (UINT8 *)"HALTPROFILINGPOLICY=RESTRICTED", v44);
          return;
        }
        v49 = 1;
      }
      HalpInterruptSetMsiOverride(v49);
      goto LABEL_31;
    }
  }
}

Referenced by:

HalpMiscInitSystem