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 --- view/elf/elfview.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'view/elf/elfview.cpp') diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index f938e978..a01d043b 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -1539,9 +1539,15 @@ bool ElfView::Init() entry += imageBaseAdjustment; Ref entryArch = entryPointArch->GetAssociatedArchitectureByAddress(entry); if (entryArch != entryPointArch) - AddFunctionForAnalysis(platform->GetRelatedPlatform(entryArch), entry); + { + auto func = AddFunctionForAnalysis(platform->GetRelatedPlatform(entryArch), entry); + AddToEntryFunctions(func); + } else - AddFunctionForAnalysis(platform, entry); + { + auto func = AddFunctionForAnalysis(platform, entry); + AddToEntryFunctions(func); + } m_logger->LogDebug("Adding function start: %#" PRIx64 "\n", entry); // name functions in .init_array, .fini_array, .ctors and .dtors -- cgit v1.3.1