KiFatalExceptionFilter

UINT64 __fastcall KiFatalExceptionFilter(){
  struct _KPRCB *CurrentPrcb; 
  __int64 v1; 
  unsigned int v2; 
  char *v3; 
  unsigned int *v4; 
  unsigned __int64 v5; 
  int v6; 
  int v8; 
  int v9; 
  UINT64 TableSize; 
  IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY *FunctionTable; 
  ULONG_PTR v12; 
  _mm_lfence();
  CurrentPrcb = KeGetCurrentPrcb();
  *((_QWORD *)CurrentPrcb + 15) = KiServiceTablesLocked;
  RtlCaptureImageExceptionValues((PVOID)0x140000000i64, &FunctionTable, &TableSize);
  if( !FunctionTable )
    goto LABEL_18;
  v2 = (unsigned int)TableSize / 0xC;
  if( !((unsigned int)TableSize / 0xC) )
    goto LABEL_18;
  v3 = (char *)KiServiceTablesLocked - 0x140000000i64;
  v4 = (unsigned int *)&FunctionTable[-1] + 3 * v2 - 1;
  v5 = *v4;
  if( (unsigned __int64)KiServiceTablesLocked - 0x140000000i64 < v5 )
  {
    v8 = 0;
    v1 = v2 - 2;
    if( (int)v1 >= 0 )
    {
      do
      {
        v9 = (v8 + (int)v1) >> 1;
        v4 = (unsigned int *)FunctionTable + 3 * v9;
        if( (unsigned __int64)v3 >= *v4 )
        {
          LODWORD(v5) = *v4;
          if( (unsigned __int64)v3 < v4[3] )
            break;
          v8 = v9 + 1;
        }
        else
        {
          v1 = (unsigned int)(v9 - 1);
        }
        LODWORD(v5) = *v4;
      }
      while( (int)v1 >= v8 );
    }
  }
  if( (unsigned __int64)v3 < (unsigned int)v5 || (unsigned __int64)v3 >= v4[1] )
    v4 = 0i64;
  if( !v4 )
LABEL_18:
    KeBugCheck(0x31ui64);
  v6 = RtlLookupExceptionHandler((__int64)v4, 0x140000000ui64, 1u, v1, &v12, 0i64);
  if( v6 < 0 )
    KeBugCheckEx(0x31u, v6, 0i64, 0i64, 0i64);
  *((_QWORD *)CurrentPrcb + 14) = v12;
  KiHardwareTriggerLock = 0i64;
  return 0i64;
}

Referenced by:

No references.