From f535df40f978d221547b45650b75aa1089e197ce Mon Sep 17 00:00:00 2001 From: Michael Krasnitski Date: Thu, 8 Feb 2024 19:50:00 -0500 Subject: Rename `mlil::operation::ConstantData` to `ConstData` to mirror HLIL --- rust/src/mlil/instruction.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'rust/src/mlil/instruction.rs') diff --git a/rust/src/mlil/instruction.rs b/rust/src/mlil/instruction.rs index 816065a5..7b182010 100644 --- a/rust/src/mlil/instruction.rs +++ b/rust/src/mlil/instruction.rs @@ -2,7 +2,7 @@ use binaryninjacore_sys::BNGetMediumLevelILByIndex; use binaryninjacore_sys::BNMediumLevelILOperation; use crate::rc::Ref; -use crate::types::ILIntrinsic; +use crate::types::{ConstantData, ILIntrinsic, RegisterValue, RegisterValueType}; use super::lift::*; use super::operation::*; @@ -28,7 +28,7 @@ pub enum MediumLevelILInstructionKind { ConstPtr(Constant), Import(Constant), ExternPtr(ExternPtr), - ConstData(ConstantData), + ConstData(ConstData), Jump(Jump), RetHint(Jump), StoreSsa(StoreSsa), @@ -192,7 +192,7 @@ impl MediumLevelILInstruction { constant: op.operands[0], offset: op.operands[1], }), - MLIL_CONST_DATA => Op::ConstData(ConstantData { + MLIL_CONST_DATA => Op::ConstData(ConstData { constant_data_kind: op.operands[0] as u32, constant_data_value: op.operands[1] as i64, size: op.size, @@ -733,11 +733,14 @@ impl MediumLevelILInstruction { ExternPtr(op) => Lifted::ExternPtr(op), ConstData(op) => Lifted::ConstData(LiftedConstantData { - constant_data: get_constant_data( - &self.function, - op.constant_data_kind, - op.constant_data_value, - op.size, + constant_data: ConstantData::new( + self.function.get_function(), + RegisterValue { + state: RegisterValueType::from_raw_value(op.constant_data_kind).unwrap(), + value: op.constant_data_value, + offset: 0, + size: op.size, + }, ), }), Jump(op) => Lifted::Jump(LiftedJump { -- cgit v1.3.1