MiCheckForDiscardableLongJumpTable

unsigned __int64 __fastcall MiCheckForDiscardableLongJumpTable(__int64 a1, __int64 a2){
  unsigned int v4; 
  unsigned __int64 result; 
  unsigned __int64 v6; 
  __int64 v7; 
  unsigned __int64 v8; 
  char *v9; 
  v9 = 0i64;
  v8 = 0i64;
  v4 = 0;
  while( 1 )
  {
    v4 = MiSnapDriverRange(a1, v4, 2, 0i64, (char **)&v8, &v9);
    result = v8;
    if( v8 )
    {
      v6 = *(_QWORD *)(a2 + 176);
      v7 = (_QWORD)MmGetPteBase() << 25;
      result = (__int64)((v8 << 25) - v7) >> 16;
      if( v6 >= result )
      {
        result = ((((_QWORD)v9 << 25) - v7) | 0xFFF0000) >> 16;
        if( v6 <= result )
          break;
      }
    }
    if( !v4 )
      return result;
  }
  *(_DWORD *)(a1 + 104) |= 0x800u;
  return result;
}

Referenced by:

MiProcessKernelCfgImageLoadConfig