*: 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

@@ -14,7 +14,7 @@ import capa.render.default
import capa.render.result_document as rd
import capa.features.freeze.features as frzf
from capa.engine import *
from capa.features.common import OS_AUTO
from capa.features.common import OS_AUTO, FORMAT_AUTO
# == Render dictionary helpers
@@ -166,12 +166,12 @@ def capa_details(rules_path, file_path, output_format="dictionary"):
# extract features and find capabilities
extractor = capa.main.get_extractor(
file_path, "auto", OS_AUTO, capa.main.BACKEND_VIV, [], False, disable_progress=True
file_path, FORMAT_AUTO, OS_AUTO, capa.main.BACKEND_VIV, [], False, disable_progress=True
)
capabilities, counts = capa.main.find_capabilities(rules, extractor, disable_progress=True)
# collect metadata (used only to make rendering more complete)
meta = capa.main.collect_metadata([], file_path, "auto", OS_AUTO, rules_path, extractor)
meta = capa.main.collect_metadata([], file_path, FORMAT_AUTO, OS_AUTO, rules_path, extractor)
meta["analysis"].update(counts)
meta["analysis"]["layout"] = capa.main.compute_layout(rules, extractor, capabilities)