fix: rules/__init__.py: duplicate bytes_features line

Closes #3027
This commit is contained in:
Willi Ballenthin
2026-04-22 09:53:18 +03:00
committed by Willi Ballenthin
parent 62e6af31f8
commit 6431be2c42
2 changed files with 5 additions and 3 deletions

View File

@@ -40,6 +40,8 @@
- fix: dotnetfile.py: missing import for capa.features.extractors.common @williballenthin #3026
- fix: rules/__init__.py: duplicate bytes_features line @williballenthin #3027
### capa Explorer Web
### capa Explorer IDA Pro plugin

View File

@@ -1833,9 +1833,6 @@ class RuleSet:
for feature in features
if isinstance(feature, (capa.features.common.Substring, capa.features.common.Regex))
]
bytes_features: list[capa.features.common.Bytes] = [
feature for feature in features if isinstance(feature, capa.features.common.Bytes)
]
hashable_features = [
feature
for feature in features
@@ -1852,6 +1849,9 @@ class RuleSet:
if string_features:
string_rules[rule_name] = cast(list[Feature], string_features)
bytes_features: list[capa.features.common.Bytes] = [
feature for feature in features if isinstance(feature, capa.features.common.Bytes)
]
if bytes_features:
bytes_rules_count += 1
for wanted_bytes in bytes_features: