fix: loader.py reads entire file for magic byte check

Closes #3029
This commit is contained in:
Willi Ballenthin
2026-04-22 09:58:56 +03:00
committed by Willi Ballenthin
parent 9954d99402
commit 7484d3fc16
2 changed files with 3 additions and 2 deletions
+2
View File
@@ -48,6 +48,8 @@
- fix: freeze/__init__.py: logically impossible condition @williballenthin #3030
- fix: loader.py reads entire file for magic byte check @williballenthin #3029
### capa Explorer Web
### capa Explorer IDA Pro plugin
+1 -2
View File
@@ -498,8 +498,7 @@ def _get_binexport2_file_extractors(input_file: Path) -> list[FeatureExtractor]:
input_file, be2, [Path(os.environ.get("CAPA_SAMPLES_DIR", "."))]
)
with sample_path.open("rb") as f:
taste = f.read()
taste = capa.helpers.get_file_taste(sample_path)
if taste.startswith(capa.features.extractors.common.MATCH_PE):
return get_file_extractors(sample_path, FORMAT_PE)