From f201ef1d22689df256bbe977840b23fc5a1174fa Mon Sep 17 00:00:00 2001 From: mr-tz Date: Mon, 27 Nov 2023 13:28:06 +0100 Subject: [PATCH] actually get global feature values --- capa/features/extractors/cape/extractor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/capa/features/extractors/cape/extractor.py b/capa/features/extractors/cape/extractor.py index d490c446..01a0d8d3 100644 --- a/capa/features/extractors/cape/extractor.py +++ b/capa/features/extractors/cape/extractor.py @@ -41,7 +41,9 @@ class CapeExtractor(DynamicFeatureExtractor): ) ) self.report: CapeReport = report - self.global_features = capa.features.extractors.cape.global_.extract_features(self.report) + + # pre-compute these because we'll yield them at *every* scope. + self.global_features = list(capa.features.extractors.cape.global_.extract_features(self.report)) def get_base_address(self) -> Union[AbsoluteVirtualAddress, _NoAddress, None]: # value according to the PE header, the actual trace may use a different imagebase