RtlGuardCheckLongJumpTarget

NTSTATUS __stdcall RtlGuardCheckLongJumpTarget(PVOID PcValue){
  __int64 v2; 
  rsize_t v3; 
  int Key; 
  PVOID BaseOfImage; 
  Key = 0;
  BaseOfImage = 0i64;
  if( (unsigned int)RtlpControlFlowGuardEnforced() )
  {
    RtlPcToFileHeader(PcValue, &BaseOfImage);
    if( !BaseOfImage
      || (LODWORD(v2) = LdrImageDirectoryEntryToLoadConfig(BaseOfImage), v2)
      && *(_DWORD *)v2 >= 0xC0u
      && (*(_DWORD *)(v2 + 144) & 0x10000) != 0
      && ((Key = (_DWORD)PcValue - (_DWORD)BaseOfImage, (v3 = *(_QWORD *)(v2 + 184)) == 0)
       || !bsearch_s(
             &Key,
             *(const void **)(v2 + 176),
             v3,
             (unsigned int)((*(_DWORD *)(v2 + 144) >> 28) + 4),
             (int(__cdecl *)(void *, const void *, const void *))RtlpTargetCompare,
             0i64)) )
    {
      RtlFailFast2(38i64, PcValue);
    }
  }
  return 0;
}

Referenced by:

RtlGuardRestoreContext