mirror of
https://github.com/mandiant/capa.git
synced 2025-12-22 07:10:29 -08:00
fix mypy and codestyle issues
This commit is contained in:
@@ -26,6 +26,7 @@ class CapeExtractor(DynamicFeatureExtractor):
|
||||
self.behavior = behavior
|
||||
|
||||
self.global_features = capa.features.extractors.cape.global_.extract_features(self.static)
|
||||
|
||||
def extract_global_features(self) -> Iterator[Tuple[Feature, Address]]:
|
||||
yield from self.global_features
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import textwrap
|
||||
import itertools
|
||||
import contextlib
|
||||
import collections
|
||||
from typing import Any, Dict, List, Tuple, Callable, cast, Union
|
||||
from typing import Any, Dict, List, Tuple, Union, Callable, cast
|
||||
|
||||
import halo
|
||||
import tqdm
|
||||
@@ -786,6 +786,7 @@ def collect_metadata(
|
||||
sha1 = hashlib.sha1()
|
||||
sha256 = hashlib.sha256()
|
||||
|
||||
assert isinstance(extractor, StaticFeatureExtractor)
|
||||
with open(sample_path, "rb") as f:
|
||||
buf = f.read()
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ from capa.helpers import get_auto_format, log_unsupported_runtime_error
|
||||
from capa.features.common import FORMAT_AUTO, FORMAT_FREEZE, DYNAMIC_FORMATS, is_global_feature
|
||||
from capa.features.extractors.base_extractor import FeatureExtractor, StaticFeatureExtractor, DynamicFeatureExtractor
|
||||
|
||||
|
||||
logger = logging.getLogger("capa.show-features")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user