From bc195c1c21da0400a1a1dde1fcdde45d687e666f Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 7 Dec 2025 17:29:41 -0500 Subject: [Rust] Add misc documentation --- rust/src/binary_view.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'rust/src/binary_view.rs') diff --git a/rust/src/binary_view.rs b/rust/src/binary_view.rs index 31bdeb89..9952cf28 100644 --- a/rust/src/binary_view.rs +++ b/rust/src/binary_view.rs @@ -1322,6 +1322,11 @@ pub trait BinaryViewExt: BinaryViewBase { } } + /// This list contains the analysis entry function, and functions like init_array, fini_array, + /// and TLS callbacks etc. + /// + /// We see `entry_functions` as good starting points for analysis, these functions normally don't + /// have internal references. Exported functions in a dll/so file are not included. fn entry_point_functions(&self) -> Array { unsafe { let mut count = 0; @@ -1706,6 +1711,9 @@ pub trait BinaryViewExt: BinaryViewBase { } } + /// Retrieve the metadata as the type `T`. + /// + /// Fails if the metadata does not exist, or if the metadata failed to coerce to type `T`. fn get_metadata(&self, key: &str) -> Option> where T: for<'a> TryFrom<&'a Metadata>, @@ -2235,6 +2243,9 @@ pub trait BinaryViewExt: BinaryViewBase { } } + /// Retrieve the string that falls on a given virtual address. + /// + /// NOTE: This returns discovered strings and is therefore governed by `analysis.limits.minStringLength` and other settings. fn string_at(&self, addr: u64) -> Option { let mut str_ref = BNStringReference::default(); let success = unsafe { BNGetStringAtAddress(self.as_ref().handle, addr, &mut str_ref) }; -- cgit v1.3.1