From d03ba5394fb32e005631185bbf27bed8f37f9dc8 Mon Sep 17 00:00:00 2001 From: Yacine Elhamer Date: Tue, 20 Jun 2023 13:26:25 +0100 Subject: [PATCH] cape/global_.py: add warning messages if architecture/os/format are unknown --- capa/features/extractors/cape/global_.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/capa/features/extractors/cape/global_.py b/capa/features/extractors/cape/global_.py index 70b5d2bf..1582630b 100644 --- a/capa/features/extractors/cape/global_.py +++ b/capa/features/extractors/cape/global_.py @@ -42,6 +42,7 @@ def guess_elf_os(file_output) -> Iterator[Tuple[Feature, Address]]: elif "kNetBSD" in file_output: yield OS("netbsd"), NO_ADDRESS else: + logger.warn("unrecognized OS: %s", file_output) yield OS(OS_ANY), NO_ADDRESS @@ -51,6 +52,7 @@ def extract_arch(static) -> Iterator[Tuple[Feature, Address]]: elif "x86-64" in static["file"]["type"]: yield Arch(ARCH_AMD64), NO_ADDRESS else: + logger.warn("unrecognized Architecture: %s", static["file"]["type"]) yield Arch(ARCH_ANY), NO_ADDRESS @@ -60,7 +62,7 @@ def extract_format(static) -> Iterator[Tuple[Feature, Address]]: elif "ELF" in static["file"]["type"]: yield Format(FORMAT_ELF), NO_ADDRESS else: - logger.debug(f"unknown file format, file command output: {static['file']['type']}") + logger.warn("unknown file format, file command output: %s", static["file"]["type"]) yield Format(FORMAT_UNKNOWN), NO_ADDRESS