SepSidInSidAndAttributes

UINT8 __fastcall SepSidInSidAndAttributes(
        _SID_AND_ATTRIBUTES *SidAndAttributes,
        UINT64 SidCount,
        VOID *PrincipalSelfSid,
        VOID *Sid){
  unsigned int v5; 
  _SID_AND_ATTRIBUTES *v6; 
  int v7; 
  unsigned int v8; 
  char v9; 
  unsigned __int8 *v10; 
  v5 = SidCount;
  v6 = SidAndAttributes;
  if( !SidAndAttributes )
    return 0;
  v7 = 0;
  v8 = 4 * *((unsigned __int8 *)Sid + 1) + 8;
  if( !(_DWORD)SidCount )
    return 0;
  v9 = *(_BYTE *)Sid;
  while( 1 )
  {
    v10 = (unsigned __int8 *)v6->Sid;
    if( v9 == *(_BYTE *)v6->Sid && v8 == 4 * v10[1] + 8 && !memcmp(Sid, v10, v8) )
      break;
    ++v6;
    if( ++v7 >= v5 )
      return 0;
  }
  return 1;
}

Referenced by:

SepFilterToken
SepRemoveDisabledGroupsAndPrivileges