SiIsWinPeHardDiskZeroUfdBoot

UINT8 __stdcall SiIsWinPeHardDiskZeroUfdBoot(){
  UINT8 v0; 
  UINT8 result; 
  INT64 v2; 
  UINT64 *v3; 
  void *v4; 
  __int64 v5; 
  VOID *v6; 
  UINT64 v7; 
  NTSTATUS v8; 
  bool v9; 
  UINT64 a6; 
  int v11; 
  int v12; 
  int v13; 
  INT64 a2; 
  WCHAR *ResultName; 
  __int64 OutputBuffer; 
  int v17; 
  __int128 OutputBufferLengtha; 
  __int128 v19; 
  __int64 v20; 

  v0 = 0;
  a2 = 0i64;
  ResultName = 0i64;
  OutputBufferLengtha = 0i64;
  v20 = 0i64;
  v19 = 0i64;
  v12 = 0;
  v11 = 0;
  OutputBuffer = 0i64;
  v17 = 0;
  v13 = 0;
  result = SiIsWinPEBoot();
  if( result )
  {
    if( SiGetBootDeviceNameFromRegistry((PWCHAR)L"FirmwareBootDevice", (INT64)&a2, v2, v3) >= 0 )
    {
      v4 = (void *)a2;
      v5 = -1i64;
      do
        ++v5;
      while( *(_WORD *)(a2 + 2 * v5) );
      if( snwscanf_s((const wchar_t *)a2, v5 + 1, L"multi(%d)disk(%d)rdisk(%d)", &v11, &v12, &v13) == 3
        && !v11
        && !v12
        && !v13
        && SiTranslateSymbolicLink((WCHAR *)L"\\ArcName\\multi(0)disk(0)rdisk(0)", &ResultName) >= 0 )
      {
        ExFreePoolWithTag(v4, 0);
        LODWORD(a6) = 40;
        v17 = 0;
        v8 = SiIssueSynchronousIoctl(ResultName, v6, &OutputBuffer, v7, &OutputBufferLengtha, a6);
        if( v8 >= 0 )
          v9 = HIDWORD(v19) == 7;
        else
          v9 = v8 == -1073741766;
        if( v9 )
          return 1;
      }
    }
    return v0;
  }
  return result;
}

Referenced by:

SiGetBiosSystemDisk