From 908e3bb037a86a6f0242cf5b8978265ef02230bf Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 15 Aug 2023 22:44:48 -0400 Subject: [PATCH] Check functions at start of code sections in detect_functions --- src/analysis/cfa.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/analysis/cfa.rs b/src/analysis/cfa.rs index 1af7b24..fa09c5c 100644 --- a/src/analysis/cfa.rs +++ b/src/analysis/cfa.rs @@ -88,6 +88,10 @@ impl AnalyzerState { .insert(symbol.address as u32, (symbol.address + symbol.size) as u32); } } + // Also check the beginning of every code section + for section in obj.sections.iter().filter(|s| s.kind == ObjSectionKind::Code) { + self.function_entries.insert(section.address as u32); + } // Process known functions first let known_functions = self.function_entries.clone();