RtlGuardCheckLongJumpTarget

NTSTATUS __fastcall RtlGuardCheckLongJumpTarget(VOID *PcValue){
  __int64 v2; 
  __int64 v3; 
  int Key; 
  VOID *BaseOfImage; 

  Key = 0;
  BaseOfImage = 0i64;
  if( 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,
             (*(_DWORD *)(v2 + 144) >> 28) + 4,
             (int(__cdecl *)(void *, const void *, const void *))RtlpTargetCompare,
             0i64)) )
    {
      RtlFailFast2(38i64, PcValue);
    }
  }
  return 0;
}

Referenced by:

RtlGuardRestoreContext