*: use FORMAT_AUTO instead of string literal

This commit is contained in:
Willi Ballenthin
2023-03-21 16:54:48 +01:00
parent 98eb28704c
commit f1c495dc0a
5 changed files with 13 additions and 7 deletions

View File

@@ -68,6 +68,7 @@ import capa.render.verbose
import capa.features.freeze
import capa.render.result_document as rd
from capa.helpers import get_file_taste
from capa.features.common import FORMAT_AUTO
from capa.features.freeze import Address
logger = logging.getLogger("capa.show-capabilities-by-function")
@@ -156,7 +157,7 @@ def main(argv=None):
logger.error("%s", str(e))
return -1
if (args.format == "freeze") or (args.format == "auto" and capa.features.freeze.is_freeze(taste)):
if (args.format == "freeze") or (args.format == FORMAT_AUTO and capa.features.freeze.is_freeze(taste)):
format_ = "freeze"
with open(args.sample, "rb") as f:
extractor = capa.features.freeze.load(f.read())