KsepMatchInitBiosInfo

__int64 KsepMatchInitBiosInfo(){
  int v0; 
  NTSTATUS v1; 
  HANDLE v2; 
  int v3; 
  int v4; 
  __int64 v5; 
  __int64 *v6; 
  unsigned __int64 v7; 
  unsigned int v8; 
  unsigned int v9; 
  int v10; 
  HANDLE KeyHandle; 
  UINT64 ActualLength; 
  wchar_t nptr[3]; 
  wchar_t v15[3]; 
  wchar_t Str[6]; 
  ActualLength = 0i64;
  KeyHandle = 0i64;
  xmmword_140C53F70 = 0i64;
  qword_140C53FA0 = 0i64;
  v0 = -1;
  xmmword_140C53F80 = 0i64;
  xmmword_140C53F90 = 0i64;
  v1 = KsepRegistryOpenKey((PWCHAR)L"\\Registry\\Machine\\Hardware\\Description\\System", 0i64, &KeyHandle);
  v2 = KeyHandle;
  v3 = v1;
  if( v1 >= 0 )
  {
    KsepRegistryQuerySZ((UINT64)KeyHandle, (INT8 *)L"SystemBiosDate", 1ui64, (INT8 *)nptr);
    v3 = v4;
    if( v4 >= 0 )
    {
      Str[4] = 0;
      KsepHistoryMessages[((unsigned __int8)_InterlockedExchangeAdd(&KsepHistoryMessagesIndex, 1u) + 1) & 0x3F] = 655816i64;
      if( (KsepDebugFlag & 1) != 0 )
        KsepDebugPrint(0i64, "KSE: BiosDate name [%ws] .\n", nptr);
      KsepLogInfo(0, "KSE: BiosDate name [%ws] .\n", nptr);
      v3 = KsepRegistryQueryMULTISZ(KeyHandle, (WCHAR *)L"SystemBiosVersion", qword_140C53D30, 0x208ui64, &ActualLength);
      word_140C53F36 = 0;
      v5 = 0i64;
      v6 = qword_140C53D30;
      while( *(_WORD *)v6 != 32 )
      {
        v5 = (unsigned int)(v5 + 1);
        v6 = (__int64 *)((char *)v6 + 2);
        if( (unsigned int)v5 >= 0x104 )
          goto LABEL_11;
      }
      v7 = 2 * v5;
      if( v7 >= 0x208 )
        _report_rangecheckfailure();
      *(_WORD *)((char *)qword_140C53D30 + v7) = 0;
LABEL_11:
      KsepHistoryMessages[((unsigned __int8)_InterlockedExchangeAdd(&KsepHistoryMessagesIndex, 1u) + 1) & 0x3F] = 655840i64;
      if( (KsepDebugFlag & 1) != 0 )
        KsepDebugPrint(0i64, "KSE: BiosVendor name [%ws] .\n", qword_140C53D30);
      KsepLogInfo(0, "KSE: BiosVendor name [%ws] .\n", qword_140C53D30);
      nptr[2] = 0;
      v15[2] = 0;
      v8 = wcstoul(Str, 0i64, 16i64);
      v9 = (unsigned int)wcstoul(nptr, 0i64, 16i64) << 8;
      v10 = v9 + wcstoul(v15, 0i64, 16i64);
      v2 = KeyHandle;
      v0 = v10 + ((v8 + (v8 < 0x80 ? 0x2000 : 6400)) << 16);
    }
  }
  if( v2 )
    KsepRegistryCloseKey(v2);
  if( v3 < 0 )
  {
    DWORD2(xmmword_140C53F90) = -1;
    *(_QWORD *)&xmmword_140C53F70 = 0i64;
  }
  else
  {
    *(_QWORD *)&xmmword_140C53F70 = qword_140C53D30;
    DWORD2(xmmword_140C53F90) = v0;
  }
  return(unsigned int)v3;
}

Referenced by:

KsepMatchInitMachineInfo