From 8fe88f601f7d5c6fa775830c44f74147c68d4ba7 Mon Sep 17 00:00:00 2001 From: naikordian Date: Wed, 5 Apr 2023 17:59:41 +0700 Subject: [PATCH] fix: Warning user to install signatures (#1420) * fix: Warning user to install signatures --------- Co-authored-by: Willi Ballenthin --- capa/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/capa/main.py b/capa/main.py index 75979c09..d4f1dcda 100644 --- a/capa/main.py +++ b/capa/main.py @@ -1038,6 +1038,13 @@ def handle_common_args(args): logger.debug("-" * 80) sigs_path = os.path.join(get_default_root(), "sigs") + if not os.path.exists(sigs_path): + logger.error( + "Using default signature path, but it doesn't exist. " + "Please install the signatures first: " + "https://github.com/mandiant/capa/blob/master/doc/installation.md#method-2-using-capa-as-a-python-library." + ) + raise IOError(f"signatures path {sigs_path} does not exist or cannot be accessed") else: sigs_path = args.signatures logger.debug("using signatures path: %s", sigs_path)