fix: elffile.py: get_base_address returns None instead of NO_ADDRESS

Closes #3023
This commit is contained in:
Willi Ballenthin
2026-04-22 18:48:37 +03:00
parent 643a29541d
commit 14f897eecb
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -31,6 +31,8 @@
- fix: DNTokenOffsetAddress.__eq__ lacks type guard @williballenthin #3022
- fix: elffile.py: get_base_address returns None instead of NO_ADDRESS @williballenthin #3023
### capa Explorer Web
### capa Explorer IDA Pro plugin
+1 -1
View File
@@ -214,10 +214,10 @@ class ElfFeatureExtractor(StaticFeatureExtractor):
self.elf = ELFFile(io.BytesIO(path.read_bytes()))
def get_base_address(self):
# virtual address of the first segment with type LOAD
for segment in self.elf.iter_segments():
if segment.header.p_type == "PT_LOAD":
return AbsoluteVirtualAddress(segment.header.p_vaddr)
return NO_ADDRESS
def extract_global_features(self):
buf = self.path.read_bytes()