From cd6747223935581ae422a9825a389d89f329b5fd Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 23 Nov 2025 17:58:37 -0500 Subject: [Rust] Clarify and expand on the current set of queryable offset properties Now that we have more duplicate API's we need to clarify and cross link between them to help alleviate the confusion for readers. --- rust/src/function.rs | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'rust/src/function.rs') diff --git a/rust/src/function.rs b/rust/src/function.rs index c0e00bd1..80de8e6d 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -38,6 +38,7 @@ pub use binaryninjacore_sys::BNFunctionUpdateType as FunctionUpdateType; pub use binaryninjacore_sys::BNHighlightStandardColor as HighlightStandardColor; use crate::architecture::RegisterId; +use crate::binary_view::AddressRange; use crate::confidence::Conf; use crate::high_level_il::HighLevelILFunction; use crate::language_representation::CoreLanguageRepresentationFunction; @@ -373,7 +374,6 @@ impl Function { unsafe { let mut count = 0; let addresses = BNGetFunctionAddressRanges(self.handle, &mut count); - Array::new(addresses, count, ()) } } @@ -2684,46 +2684,6 @@ impl PartialEq for Function { } } -#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] -pub struct AddressRange { - pub start: u64, - pub end: u64, -} - -impl From for AddressRange { - fn from(raw: BNAddressRange) -> Self { - Self { - start: raw.start, - end: raw.end, - } - } -} - -impl From for BNAddressRange { - fn from(raw: AddressRange) -> Self { - Self { - start: raw.start, - end: raw.end, - } - } -} - -impl CoreArrayProvider for AddressRange { - type Raw = BNAddressRange; - type Context = (); - type Wrapped<'a> = Self; -} - -unsafe impl CoreArrayProviderInner for AddressRange { - unsafe fn free(raw: *mut Self::Raw, _count: usize, _context: &Self::Context) { - BNFreeAddressRanges(raw); - } - - unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { - Self::from(*raw) - } -} - #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct PerformanceInfo { pub name: String, -- cgit v1.3.1