fix: find_dynamic_limitations_from_cli overwrites instead of OR-ing

Closes #3019
This commit is contained in:
Willi Ballenthin
2026-04-22 09:24:25 +03:00
committed by Willi Ballenthin
parent 9289f09f15
commit 53158b4712
2 changed files with 4 additions and 2 deletions

View File

@@ -24,6 +24,8 @@
- fix: load_one_jsonl_from_path: finally block runs on unrelated exceptions @williballenthin #3018
- fix: find_dynamic_limitations_from_cli overwrites instead of OR-ing @williballenthin #3019
### capa Explorer Web
### capa Explorer IDA Pro plugin

View File

@@ -776,7 +776,7 @@ def find_static_limitations_from_cli(args, rules: RuleSet, file_extractors: list
# file limitations that rely on non-file scope won't be detected here.
# nor on FunctionName features, because pefile doesn't support this.
found_file_limitation = has_static_limitation(rules, pure_file_capabilities)
found_file_limitation |= has_static_limitation(rules, pure_file_capabilities)
if found_file_limitation:
# bail if capa encountered file limitation e.g. a packed binary
# do show the output in verbose mode, though.
@@ -800,7 +800,7 @@ def find_dynamic_limitations_from_cli(args, rules: RuleSet, file_extractors: lis
found_dynamic_limitation = False
for file_extractor in file_extractors:
pure_dynamic_capabilities = find_file_capabilities(rules, file_extractor, {})
found_dynamic_limitation = has_dynamic_limitation(rules, pure_dynamic_capabilities)
found_dynamic_limitation |= has_dynamic_limitation(rules, pure_dynamic_capabilities)
if found_dynamic_limitation:
# bail if capa encountered file limitation e.g. a dotnet sample is detected