mod x86;
use capstone::{Arch, Capstone, Insn};
pub fn identify_jump_target(insn: &Insn, caps: &Capstone) -> Jump {
match caps.arch() {
Arch::X86 => x86::identify_jump_target(insn, caps),
_ => Jump::None,
}
}
#[derive(Debug, Copy, Clone)]
pub enum Jump {
Internal(usize),
External(u64),
None,
}
impl Jump {
#[inline]
pub fn is_internal(&self) -> bool {
matches!(self, &Jump::Internal(..))
}
#[inline]
pub fn is_external(&self) -> bool {
matches!(self, &Jump::External(..))
}
}