DecodeAttributeName

UINT64 __stdcall DecodeAttributeName(UINT8 *Value, UINT64 ValueSize, WCHAR **DecodedString){
  unsigned int v3; 
  unsigned int v4; 
  __int64 v6; 
  WCHAR *v7; 
  unsigned int v8; 
  unsigned int v9; 
  unsigned int v10; 
  unsigned int v11; 
  __int64 v12; 
  __int64 v13; 
  UINT8 v14; 
  __int64 v15; 
  WCHAR v16; 
  UINT8 v18; 
  char v19[3]; 
  unsigned int v20; 
  UINT8 Digit; 
  WCHAR **v22; 
  UINT8 v23; 

  v22 = DecodedString;
  v3 = 0;
  v4 = ValueSize;
  v20 = 0;
  Digit = 0;
  v23 = 0;
  LOWORD(v6) = 0;
  v18 = 0;
  v19[0] = 0;
  if( !Value || !(_DWORD)ValueSize || !DecodedString )
    return 87i64;
  if( (ValueSize & 1) != 0 )
    return 1336;
  v7 = (WCHAR *)SddlpAlloc((unsigned int)ValueSize + 2i64, ValueSize, (UINT64)DecodedString);
  if( !v7 )
    return 8;
  v8 = v4 >> 1;
  v9 = 0;
  v10 = v8;
  if( !v8 )
  {
LABEL_26:
    *v22 = v7;
    return v3;
  }
  v11 = 0;
  while( 1 )
  {
    v12 = v9;
    v13 = v9 + 4;
    v14 = 0;
    if( *(_WORD *)&Value[2 * v9] != 37 )
      goto LABEL_18;
    if( (unsigned int)v13 >= v10 )
      break;
    if( !GetDigitFromChar2(*(_WORD *)&Value[2 * v9 + 2], &Digit) )
      break;
    if( !GetDigitFromChar2(*(_WORD *)&Value[2 * v9 + 4], &v23) )
      break;
    if( !GetDigitFromChar2(*(_WORD *)&Value[2 * v9 + 6], &v18) )
      break;
    if( !GetDigitFromChar2(*(_WORD *)&Value[2 * v13], (UINT8 *)v19) )
      break;
    v6 = (unsigned __int16)((unsigned __int8)v19[0] | (unsigned __int16)(16
                                                                       * (v18 | (unsigned __int16)(16
                                                                                                 * (v23 | (unsigned __int16)(16 * Digit))))));
    v14 = IsEncodedAttributeChar((unsigned __int8)v19[0] | (unsigned __int16)(16
                                                                            * (v18 | (unsigned __int16)(16 * (v23 | (unsigned __int16)(16 * Digit))))));
    if( !v14 )
      break;
    v11 = v20;
    v12 = v9;
LABEL_18:
    v15 = v11++;
    v20 = v11;
    if( v14 )
      v16 = v6;
    else
      v16 = *(_WORD *)&Value[2 * v12];
    v7[v15] = v16;
    if( !v14 )
      LODWORD(v13) = v9;
    v9 = v13 + 1;
    if( (int)v13 + 1 >= v8 )
      goto LABEL_26;
    v10 = v8;
  }
  ExFreePoolWithTag(v7, 0);
  return 1336;
}

Referenced by:

GetAttributeName
LocalGetRelativeAttributeForString