Skip to content

Commit 29ab296

Browse files
committed
speed up and path changes
1 parent 63ffd9b commit 29ab296

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/penguin/static_analyses.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,18 @@ def run(self, extracted_fs, prior_results):
102102
logger.warning(f"Failed to parse ELF file {path}: {e}. Ignoring")
103103
continue
104104
info = arch_filter(ef)
105-
for segment in ef.iter_segments():
105+
for segment in ef.iter_segments(type='PT_INTERP'):
106106
try:
107107
name = segment.get_interp_name()
108108
if name is not None:
109-
loaders[name] = loaders.get(name, 0) + 1
109+
# handle non path loaders might be a problem on certain version where loader path is handled with an env var
110+
if '/' not in name:
111+
for loader in loaders.keys():
112+
if name in loader:
113+
loaders[loader] = loaders.get(loader, 0) + 1
114+
break
115+
else:
116+
loaders[name] = loaders.get(name, 0) + 1
110117
except AttributeError:
111118
continue
112119
if info.bits is None or info.arch is None:

0 commit comments

Comments
 (0)