mirror of
https://github.com/mandiant/capa.git
synced 2025-12-12 15:49:46 -08:00
Apply suggestions from code review
Co-authored-by: Willi Ballenthin <willi.ballenthin@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user