From 7e823057b9e9fee11894d608f9f448f26daec157 Mon Sep 17 00:00:00 2001 From: Zander Work Date: Thu, 9 Mar 2023 11:51:19 -0500 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Willi Ballenthin --- CHANGELOG.md | 2 +- capa/features/extractors/viv/extractor.py | 3 +-- capa/main.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6d57994..bce65830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### New Features -- new cli flag `-o`/`--os` to override auto-detected operating system for a sample @captainGeech42 +- new cli flag `--os` to override auto-detected operating system for a sample @captainGeech42 ### Breaking Changes diff --git a/capa/features/extractors/viv/extractor.py b/capa/features/extractors/viv/extractor.py index c009da56..4d877ab2 100644 --- a/capa/features/extractors/viv/extractor.py +++ b/capa/features/extractors/viv/extractor.py @@ -29,14 +29,13 @@ class VivisectFeatureExtractor(FeatureExtractor): super().__init__() self.vw = vw self.path = path - self.os = os with open(self.path, "rb") as f: self.buf = f.read() # pre-compute these because we'll yield them at *every* scope. self.global_features: List[Tuple[Feature, Address]] = [] self.global_features.extend(capa.features.extractors.viv.file.extract_file_format(self.buf)) - self.global_features.extend(capa.features.extractors.common.extract_os(self.buf, self.os)) + self.global_features.extend(capa.features.extractors.common.extract_os(self.buf, os)) self.global_features.extend(capa.features.extractors.viv.global_.extract_arch(self.vw)) def get_base_address(self): diff --git a/capa/main.py b/capa/main.py index ed47bf69..1e893451 100644 --- a/capa/main.py +++ b/capa/main.py @@ -880,7 +880,6 @@ def install_common_args(parser, wanted=None): ] os_help = ", ".join(["%s (%s)" % (o[0], o[1]) if len(o) == 2 else o[0] for o in oses]) parser.add_argument( - "-o", "--os", choices=[o[0] for o in oses], default=OS_AUTO,