VfTargetEtwUnregister

VOID __stdcall VfTargetEtwUnregister(UINT64 RegHandle, PVOID CallerAddress){
  int v3; 
  void *v4; 
  UINT64 v5; 
  CHAR *v6; 
  __int64 v7; 
  _QWORD *v8; 
  _QWORD *v9; 
  _QWORD *v10; 
  UINT64 v11; 
  __int128 v12; 
  v12 = 0i64;
  if( !VfSafeMode )
  {
    v3 = 0;
    v4 = 0i64;
    VfAvlInitializeLockContext((INT64)&v12, 0i64);
    v6 = VfAvlLookupTreeNode(&ViTargetDriversAvl, (INT64)&v12, v5, 1i64);
    if( v6 )
    {
      v7 = *((_QWORD *)v6 + 7);
      if( v7 )
      {
        v8 = *(_QWORD **)(v7 + 16);
        if( v8 == (_QWORD *)(v7 + 16) )
        {
LABEL_7:
          if( !dword_140C2A698 && (*(_DWORD *)(v7 + 32) & 1) == 0 && (MmVerifierData & 0x800) != 0 )
            VerifierBugCheckIfAppropriate(0xC4ui64, 0xDCui64, 0i64, 0i64, 0i64, v11);
        }
        else
        {
          while( 1 )
          {
            v4 = v8;
            v9 = (_QWORD *)*v8;
            if( v8[2] == RegHandle )
              break;
            v8 = (_QWORD *)*v8;
            if( v9 == (_QWORD *)(v7 + 16) )
              goto LABEL_7;
          }
          v3 = 1;
          if( (_QWORD *)v9[1] != v8 || (v10 = (_QWORD *)v8[1], (_QWORD *)*v10 != v8) )
            __fastfail(3u);
          *v10 = v9;
          v9[1] = v10;
        }
      }
    }
    VfAvlCleanupLockContext((INT64)&v12);
    if( v3 )
      ExFreePoolWithTag(v4, 0);
  }
}

Referenced by:

VerifierEtwUnregister