From 0609276712622908254065546102381466033141 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 5 Mar 2024 02:09:39 -0500 Subject: Rust: Implement instruction_llil for CoreArchitecture --- rust/src/architecture.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'rust/src/architecture.rs') diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 1d343972..ee0e3cd3 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -1172,14 +1172,23 @@ impl Architecture for CoreArchitecture { } } } - + fn instruction_llil( &self, - _data: &[u8], - _addr: u64, - _il: &mut Lifter, + data: &[u8], + addr: u64, + il: &mut Lifter, ) -> Option<(usize, bool)> { - None + let mut size = data.len(); + let success = unsafe { + BNGetInstructionLowLevelIL(self.0, data.as_ptr(), addr, &mut size as *mut _, il.handle) + }; + + if !success { + None + } else { + Some((size, true)) + } } fn flag_write_llil<'a>( -- cgit v1.3.1