diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-12-19 22:39:11 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2024-01-04 11:02:14 -0700 |
| commit | 0748dfe65398f17064ed744a3d198f144d0aa2c5 (patch) | |
| tree | adde2cf25a4b9812c8322ed326f361b23c1681e5 /rust/src/llil/operation.rs | |
| parent | e9e5c3e3568351e99c5034e49ae21f0b8d12a4c2 (diff) | |
Support intrinsics in Rust architecture plugins
Diffstat (limited to 'rust/src/llil/operation.rs')
| -rw-r--r-- | rust/src/llil/operation.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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<V>, Intrinsic> + where + A: 'func + Architecture, + M: FunctionMutability, + V: NonSSAVariant, +{ + // TODO: Support register and expression lists + pub fn intrinsic(&self) -> Option<A::Intrinsic> { + 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 {} |
