main: dont save .viv by default, unless CAPA_SAVE_WORKSPACE set

closes #507
This commit is contained in:
William Ballenthin
2021-06-15 12:24:01 -06:00
parent 9484fadd0f
commit 7f03db9fe4
6 changed files with 20 additions and 12 deletions

View File

@@ -152,9 +152,10 @@ def main(argv=None):
extractor = capa.features.freeze.load(f.read())
else:
format = args.format
should_save_workspace = os.environ.get("CAPA_SAVE_WORKSPACE") not in ("0", "no", "NO", "n", None)
try:
extractor = capa.main.get_extractor(args.sample, args.format, args.backend, args.signatures)
extractor = capa.main.get_extractor(args.sample, args.format, args.backend, args.signatures, should_save_workspace)
except capa.main.UnsupportedFormatError:
logger.error("-" * 80)
logger.error(" Input file does not appear to be a PE file.")