MiCheckSessionPoolAllocations

VOID __stdcall MiCheckSessionPoolAllocations(){
  __int64 v0; 
  __int64 v2; 
  __int64 v3; 
  ULONG_PTR *v4; 
  __int64 *v5; 
  __int64 v6; 
  __int64 i; 
  void *v8; 
  UINT64 v9; 
  __int64 v10; 
  ULONG_PTR BugCheckParameter3; 
  ULONG_PTR v12; 
  v9 = qword_140C4DB20 + 4096;
  v0 = 292i64;
  if( _BitScanReverse64((unsigned __int64 *)&v2, 0x124ui64) )
    v0 = 1i64 << v2;
  v10 = v0;
  v3 = 2i64;
  v4 = *(ULONG_PTR **)(*((_QWORD *)KeGetCurrentThread() + 23) + 1368i64);
  v5 = &v10;
  BugCheckParameter3 = v4[122];
  v12 = v4[123];
  do
  {
    v6 = *(v5 - 1);
    if( v6 )
    {
      for( i = *v5; i; --i )
        v6 += 56i64;
    }
    v5 += 2;
    --v3;
  }
  while( v3 );
  if( BugCheckParameter3 )
  {
    ExPoolCleanupExpansionTable((PVOID)BugCheckParameter3);
    v4[122] = 0i64;
    v4[123] = 0i64;
  }
  v8 = (void *)v4[124];
  if( v8 )
  {
    ExFreePoolWithTag(v8, 0);
    v4[124] = 0i64;
  }
}

Referenced by:

MiDereferenceSessionFinal