mirror of
https://github.com/mandiant/capa.git
synced 2026-07-28 22:50:59 -07:00
fix: elffile.py: get_base_address returns None instead of NO_ADDRESS
Closes #3023
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user