From 6431be2c42443172b8516e046f2b65801ca46558 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Wed, 22 Apr 2026 09:53:18 +0300 Subject: [PATCH] fix: rules/__init__.py: duplicate bytes_features line Closes #3027 --- CHANGELOG.md | 2 ++ capa/rules/__init__.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a59a3e2..ff8c8861 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/capa/rules/__init__.py b/capa/rules/__init__.py index 6ca7ee01..52a5ffc7 100644 --- a/capa/rules/__init__.py +++ b/capa/rules/__init__.py @@ -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: