FsRtlIsDbcsInExpression

UINT8 __stdcall FsRtlIsDbcsInExpression(_STRING *Expression, _STRING *Name){
  int Length; 
  __int64 v3; 
  _STRING *v4; 
  _STRING *v5; 
  VOID **v6; 
  unsigned __int16 v7; 
  _STRING v9; 
  char *v10; 
  __int64 v11; 
  unsigned int v12; 
  unsigned int v13; 
  __int64 v14; 
  int v15; 
  bool v16; 
  __int16 *v17; 
  char *v18; 
  unsigned int v19; 
  unsigned __int16 v20; 
  __int16 v21; 
  char *Buffer; 
  __int16 v23; 
  __int16 v24; 
  char v25; 
  unsigned int v26; 
  __int16 v27; 
  unsigned int v28; 
  int v29; 
  __int16 v30; 
  char *v31; 
  __int16 v32; 
  __int16 v33; 
  VOID **PoolWithTag; 
  _OWORD *v35; 
  __int128 v36; 
  __int64 v37; 
  __int64 v38; 
  __int64 v39; 
  unsigned __int16 v40; 
  char *v41; 
  __int16 v42; 
  __int16 v43; 
  __int16 v44; 
  __int64 v45; 
  __int64 v46; 
  __int64 v47; 
  __int16 v48; 
  __int16 v49; 
  unsigned int v50; 
  char *v51; 
  __int16 v52; 
  char v53; 
  unsigned __int16 v54; 
  __int16 v55; 
  __int16 v56; 
  _STRING Namea; 
  unsigned int v58; 
  VOID **v59; 
  _STRING *v60; 
  int v61; 
  _STRING *v62; 
  __int16 v63[16]; 
  char v64; 

  Length = Name->Length;
  LODWORD(v3) = 0;
  v62 = Name;
  v4 = Name;
  v60 = Expression;
  v5 = Expression;
  v56 = 0;
  v6 = 0i64;
  v59 = 0i64;
  v53 = 0;
  if( !(_WORD)Length )
    return Expression->Length + Length == 0;
  v7 = Expression->Length;
  if( !Expression->Length )
    return Expression->Length + Length == 0;
  if( v7 == 1 && *Expression->Buffer == 42 )
    return 1;
  if( *Expression->Buffer == 42 )
  {
    v9 = *Expression;
    *(_DWORD *)(&Namea.MaximumLength + 1) = HIDWORD(*(_QWORD *)&Expression->Length);
    Namea.MaximumLength = v9.MaximumLength - 1;
    v10 = (char *)(_mm_srli_si128((__m128i)v9, 8).m128i_u64[0] + 1);
    v11 = (unsigned __int16)(v9.Length - 1);
    Namea.Buffer = v10;
    Namea.Length = v9.Length - 1;
    if( !FsRtlDoesDbcsContainWildCards(&Namea.Length) )
    {
      if( (unsigned __int16)Length >= (unsigned __int16)(v7 - 1) )
      {
        v12 = Length - (unsigned __int16)v11;
        if( !(_BYTE)NlsMbOemCodePageTag )
          return memcmp(v10, &v4->Buffer[v12], (unsigned __int16)v11) == 0;
        v13 = 0;
        if( !v12 )
          return memcmp(v10, &v4->Buffer[v12], (unsigned __int16)v11) == 0;
        do
        {
          v14 = (unsigned __int8)v4->Buffer[v13];
          if( (unsigned __int8)v14 >= 0x80u )
            v15 = (NlsOemLeadByteInfoTable[v14] != 0) + 1;
          else
            v15 = 1;
          v13 += v15;
        }
        while( v13 < v12 );
        if( v13 <= v12 )
          return memcmp(v10, &v4->Buffer[v12], (unsigned __int16)v11) == 0;
      }
      return 0;
    }
    v5 = v60;
    v6 = 0i64;
  }
  v17 = v63;
  v63[0] = 0;
  *(_QWORD *)&Namea.Length = v63;
  v18 = &v64;
  v19 = 1;
  v54 = 0;
  v20 = 0;
  v21 = 2 * v7;
  do
  {
    if( v20 >= v4->Length )
    {
      v53 = 1;
      v25 = 1;
      if( v17[v19 - 1] == v21 )
        break;
    }
    else
    {
      Buffer = v4->Buffer;
      v23 = Buffer[v20];
      if( (unsigned __int8)Buffer[v20] >= 0x80u
        && (_BYTE)NlsMbOemCodePageTag
        && NlsOemLeadByteInfoTable[(unsigned __int8)v23] )
      {
        v24 = 2;
        v56 = v23 + (Buffer[v20 + 1] << 8);
      }
      else
      {
        v56 = Buffer[v20];
        v24 = 1;
      }
      v17 = *(__int16 **)&Namea.Length;
      v20 += v24;
      v25 = v53;
      v54 = v20;
    }
    v58 = 0;
    v26 = 0;
    do
    {
      v27 = 0;
      v28 = ((unsigned int)(unsigned __int16)v17[(unsigned int)v3] + 1) >> 1;
      v3 = (unsigned int)(v3 + 1);
      while( 1 )
      {
        while( 1 )
        {
          while( 1 )
          {
            v29 = v5->Length;
            if( (_WORD)v28 == (_WORD)v29 )
              goto LABEL_81;
            LOWORD(v28) = v27 + v28;
            v30 = 2 * v28;
            if( (_WORD)v28 == (_WORD)v29 )
            {
              *(_WORD *)&v18[2 * v26] = v21;
              goto LABEL_69;
            }
            v31 = v5->Buffer;
            v61 = v5->Length;
            if( (unsigned __int16)v28 == v29 - 1 )
            {
              v32 = v31[(unsigned __int16)v28];
              if( (unsigned __int8)v31[(unsigned __int16)v28] >= 0x80u )
              {
                if( (_BYTE)NlsMbOemCodePageTag )
                {
                  v6 = v59;
                  if( NlsOemLeadByteInfoTable[(unsigned __int8)v32] )
                  {
                    v55 = 1;
LABEL_41:
                    v33 = v32;
                    goto LABEL_42;
                  }
                }
              }
            }
            v32 = v31[(unsigned __int16)v28];
            if( (unsigned __int8)v31[(unsigned __int16)v28] < 0x80u
              || !(_BYTE)NlsMbOemCodePageTag
              || !NlsOemLeadByteInfoTable[(unsigned __int8)v32] )
            {
              v55 = 1;
              goto LABEL_41;
            }
            v55 = 2;
            v33 = v32 + (v31[(unsigned __int16)v28 + 1] << 8);
LABEL_42:
            if( v26 >= 0xE && !v6 )
            {
              PoolWithTag = ExAllocatePoolWithTag(0x11ui64, 8i64 * (unsigned int)(v61 + 1), 1685214022i64);
              v35 = *(_OWORD **)&Namea.Length;
              v6 = PoolWithTag;
              v5 = v60;
              *(_OWORD *)PoolWithTag = *(_OWORD *)v18;
              v59 = PoolWithTag;
              v36 = *((_OWORD *)v18 + 1);
              v18 = (char *)PoolWithTag;
              *((_OWORD *)PoolWithTag + 1) = v36;
              v37 = v5->Length;
              *(_OWORD *)((char *)PoolWithTag + 4 * v37 + 4) = *v35;
              *(_OWORD *)((char *)PoolWithTag + 4 * v37 + 20) = v35[1];
              *(_QWORD *)&Namea.Length = (char *)PoolWithTag + 4 * v5->Length + 4;
            }
            v25 = v53;
            if( v33 == 42 )
            {
              v27 = v55;
              v38 = v26;
              v39 = v26 + 1;
              *(_WORD *)&v18[2 * v38] = v30;
              *(_WORD *)&v18[2 * v39] = v30 + 1;
              v26 = v39 + 1;
              goto LABEL_47;
            }
            if( v33 != 60 )
              break;
            v20 = v54;
            if( !v53 && v56 == 46 )
            {
              v40 = v54;
              if( v54 >= v62->Length )
              {
LABEL_61:
                v45 = v26++;
                *(_WORD *)&v18[2 * v45] = v30 + 1;
                goto LABEL_62;
              }
              v41 = v62->Buffer;
              while( 1 )
              {
                v42 = v41[v40];
                if( (unsigned __int8)v41[v40] >= 0x80u
                  && (_BYTE)NlsMbOemCodePageTag
                  && (v20 = v54, NlsOemLeadByteInfoTable[(unsigned __int8)v42]) )
                {
                  v43 = 2;
                  v44 = v42 + (v41[v40 + 1] << 8);
                }
                else
                {
                  v44 = v41[v40];
                  v43 = 1;
                }
                if( v44 == 46 )
                  break;
                v40 += v43;
                if( v40 >= v62->Length )
                {
                  v6 = v59;
                  v25 = 0;
                  goto LABEL_61;
                }
              }
              v6 = v59;
              v25 = 0;
            }
            v46 = v26;
            v47 = v26 + 1;
            *(_WORD *)&v18[2 * v46] = v30;
            *(_WORD *)&v18[2 * v47] = v30 + 1;
            v26 = v47 + 1;
LABEL_62:
            v5 = v60;
            v27 = v55;
          }
          v27 = v55;
          v48 = 2 * v55 + v30;
          if( v33 != 62 )
            break;
          v20 = v54;
          if( !v53 && v56 != 46 )
            goto LABEL_68;
        }
        if( v33 != 34 )
        {
          if( v53 )
          {
            v20 = v54;
          }
          else
          {
            if( v33 != 63 )
            {
              v49 = v56;
              goto LABEL_77;
            }
LABEL_73:
            v20 = v54;
            *(_WORD *)&v18[2 * v26++] = v48;
          }
          goto LABEL_81;
        }
        if( !v53 )
          break;
LABEL_47:
        v20 = v54;
      }
      v49 = v56;
      if( v56 == 46 )
        goto LABEL_73;
LABEL_77:
      v16 = v33 == v49;
      v20 = v54;
      if( v16 )
      {
LABEL_68:
        *(_WORD *)&v18[2 * v26] = v48;
LABEL_69:
        ++v26;
      }
LABEL_81:
      v17 = *(__int16 **)&Namea.Length;
      if( (unsigned int)v3 >= v19 )
        break;
      v50 = v58;
      do
      {
        if( v50 >= v26 )
          break;
        for( ; (unsigned int)v3 < v19; v3 = (unsigned int)(v3 + 1) )
        {
          if( *(_WORD *)(*(_QWORD *)&Namea.Length + 2 * v3) >= *(_WORD *)&v18[2 * v50] )
            break;
        }
        ++v50;
      }
      while( (unsigned int)v3 < v19 );
      v58 = v50;
    }
    while( (unsigned int)v3 < v19 );
    LODWORD(v3) = 0;
    if( !v26 )
    {
      if( v6 )
        ExFreePoolWithTag(v6, 0);
      return 0;
    }
    v4 = v62;
    v51 = *(char **)&Namea.Length;
    v17 = (__int16 *)v18;
    *(_QWORD *)&Namea.Length = v18;
    v19 = v26;
    v18 = v51;
  }
  while( !v25 );
  v52 = v17[v19 - 1];
  if( v6 )
    ExFreePoolWithTag(v6, 0);
  return v52 == v21;
}

Referenced by:

No references.