From 0748dfe65398f17064ed744a3d198f144d0aa2c5 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Tue, 19 Dec 2023 22:39:11 -0700 Subject: Support intrinsics in Rust architecture plugins --- rust/src/llil/operation.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'rust/src/llil/operation.rs') diff --git a/rust/src/llil/operation.rs b/rust/src/llil/operation.rs index b998cce3..4daa7cb2 100644 --- a/rust/src/llil/operation.rs +++ b/rust/src/llil/operation.rs @@ -85,6 +85,22 @@ where // LLIL_SYSCALL, LLIL_SYSCALL_SSA pub struct Syscall; +// LLIL_INTRINSIC, LLIL_INTRINSIC_SSA +pub struct Intrinsic; + +impl<'func, A, M, V> Operation<'func, A, M, NonSSA, Intrinsic> + where + A: 'func + Architecture, + M: FunctionMutability, + V: NonSSAVariant, +{ + // TODO: Support register and expression lists + pub fn intrinsic(&self) -> Option { + let raw_id = self.op.operands[2] as u32; + self.function.arch().intrinsic_from_id(raw_id) + } +} + // LLIL_SET_REG, LLIL_SET_REG_SSA, LLIL_SET_REG_PARTIAL_SSA pub struct SetReg; @@ -617,6 +633,7 @@ pub trait OperationArguments: 'static {} impl OperationArguments for NoArgs {} impl OperationArguments for Pop {} impl OperationArguments for Syscall {} +impl OperationArguments for Intrinsic {} impl OperationArguments for SetReg {} impl OperationArguments for SetRegSplit {} impl OperationArguments for SetFlag {} -- cgit v1.3.1