From 9537f33da6b8de883a45c4b7758f0dc5c1438ed7 Mon Sep 17 00:00:00 2001 From: Zichuan Li Date: Tue, 21 May 2024 17:56:03 -0400 Subject: Solved issue #1180 by adding new APIs 1. Add two new APIs for multiple entry functions `GetAllAnalysisEntryFunctions` and `AddToEntryFunctions` 2. Add Python APIs `entry_functions` and `add_to_entry_functions`. `entry_functions` resturns a list of functions, which supports parsing functions in `init_array`, `fini_array` and TLS callbacks. 3. Modify bin-info, it now prints all entry functions --- rust/src/binaryview.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rust/src/binaryview.rs') diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs index aed2a454..25b3fbb2 100644 --- a/rust/src/binaryview.rs +++ b/rust/src/binaryview.rs @@ -942,6 +942,15 @@ pub trait BinaryViewExt: BinaryViewBase { } } + fn entry_point_functions(&self) -> Array { + unsafe { + let mut count = 0; + let functions = BNGetAllEntryFunctions(self.as_ref().handle, &mut count); + + Array::new(functions, count, ()) + } + } + fn functions(&self) -> Array { unsafe { let mut count = 0; -- cgit v1.3.1