From 3b14d1605cf9ea638a0d058911a8c1e233a9f70d Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 11 May 2025 21:00:55 -0400 Subject: [Rust] Add missing instruction types to MLIL --- rust/src/medium_level_il/operation.rs | 78 +++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'rust/src/medium_level_il/operation.rs') diff --git a/rust/src/medium_level_il/operation.rs b/rust/src/medium_level_il/operation.rs index e11f59c8..e8b70cc6 100644 --- a/rust/src/medium_level_il/operation.rs +++ b/rust/src/medium_level_il/operation.rs @@ -329,6 +329,54 @@ pub struct LiftedCall { pub params: Vec, } +// CALL_OUTPUT +#[derive(Debug, Copy, Clone)] +pub struct CallOutput { + pub first_output: usize, + pub num_outputs: usize, +} +#[derive(Clone, Debug, PartialEq)] +pub struct LiftedCallOutput { + pub output: Vec, +} + +// CALL_PARAM_SSA +#[derive(Debug, Copy, Clone)] +pub struct CallParam { + pub first_param: usize, + pub num_params: usize, +} +#[derive(Clone, Debug, PartialEq)] +pub struct LiftedCallParam { + pub params: Vec, +} + +// CALL_OUTPUT_SSA +#[derive(Debug, Copy, Clone)] +pub struct CallOutputSsa { + pub dest_memory: u64, + pub first_output: usize, + pub num_outputs: usize, +} +#[derive(Clone, Debug, PartialEq)] +pub struct LiftedCallOutputSsa { + pub dest_memory: u64, + pub output: Vec, +} + +// CALL_PARAM_SSA +#[derive(Debug, Copy, Clone)] +pub struct CallParamSsa { + pub src_memory: u64, + pub first_param: usize, + pub num_params: usize, +} +#[derive(Clone, Debug, PartialEq)] +pub struct LiftedCallParamSsa { + pub src_memory: u64, + pub params: Vec, +} + // SYSCALL #[derive(Debug, Copy, Clone)] pub struct Syscall { @@ -375,6 +423,36 @@ pub struct LiftedIntrinsicSsa { pub params: Vec, } +// MEMORY_INTRINSIC_SSA +#[derive(Debug, Copy, Clone)] +pub struct MemoryIntrinsicSsa { + pub output: usize, + pub intrinsic: u32, + pub first_param: usize, + pub num_params: usize, + pub src_memory: u64, +} +#[derive(Clone, Debug, PartialEq)] +pub struct LiftedMemoryIntrinsicSsa { + pub output: Box, + pub intrinsic: CoreIntrinsic, + pub params: Vec, + pub src_memory: u64, +} + +// MEMORY_INTRINSIC_OUTPUT_SSA +#[derive(Debug, Copy, Clone)] +pub struct MemoryIntrinsicOutputSsa { + pub dest_memory: u64, + pub first_output: usize, + pub num_outputs: usize, +} +#[derive(Clone, Debug, PartialEq)] +pub struct LiftedMemoryIntrinsicOutputSsa { + pub dest_memory: u64, + pub output: Vec, +} + // CALL_SSA, TAILCALL_SSA #[derive(Debug, Copy, Clone)] pub struct CallSsa { -- cgit v1.3.1