ViThunkReplaceSpecialPristine

__int64 __fastcall ViThunkReplaceSpecialPristine(_QWORD *a1){
  PVOID *v1; 
  __int64 result; 
  PVOID *i; 
  unsigned int v5; 
  _QWORD *v6; 
  int v7; 

  v1 = (PVOID *)ViVerifierDriverAddedSpecialThunkListHead;
  result = 0i64;
  while( v1 != &ViVerifierDriverAddedSpecialThunkListHead )
  {
    for( i = (PVOID *)v1[3]; i != v1 + 3; i = (PVOID *)*i )
    {
      v5 = *((_DWORD *)i + 6);
      v6 = i + 4;
      v7 = 0;
      if( v5 )
      {
        while( *a1 != v6[1] )
        {
          v6 += 2;
          if( ++v7 >= v5 )
            goto LABEL_8;
        }
        *a1 = *v6;
        result = 1i64;
      }
LABEL_8:
      if( (_DWORD)result == 1 )
        return result;
    }
    v1 = (PVOID *)*v1;
  }
  return result;
}

Referenced by:

ViThunkRecoverPristines