This commit is contained in:
Willi Ballenthin
2023-10-17 14:42:58 +00:00
parent 92daf3a530
commit 1aac4a1a69
11 changed files with 16 additions and 16 deletions

View File

@@ -112,7 +112,7 @@ def get_capa_results(args):
extractor = capa.main.get_extractor(
path, format, os_, capa.main.BACKEND_VIV, sigpaths, should_save_workspace, disable_progress=True
)
except capa.main.UnsupportedFormatError:
except capa.exceptions.UnsupportedFormatError:
# i'm 100% sure if multiprocessing will reliably raise exceptions across process boundaries.
# so instead, return an object with explicit success/failure status.
#
@@ -123,7 +123,7 @@ def get_capa_results(args):
"status": "error",
"error": f"input file does not appear to be a PE file: {path}",
}
except capa.main.UnsupportedRuntimeError:
except capa.exceptions.UnsupportedRuntimeError:
return {
"path": path,
"status": "error",

View File

@@ -359,7 +359,7 @@ def get_sample_capabilities(ctx: Context, path: Path) -> Set[str]:
elif nice_path.name.endswith(capa.helpers.EXTENSIONS_SHELLCODE_64):
format_ = "sc64"
else:
format_ = capa.main.get_auto_format(nice_path)
format_ = capa.helpers.get_auto_format(nice_path)
logger.debug("analyzing sample: %s", nice_path)
extractor = capa.main.get_extractor(

View File

@@ -47,7 +47,7 @@ from typing import Dict, List
from pathlib import Path
import requests
from stix2 import Filter, MemoryStore, AttackPattern # type: ignore
from stix2 import Filter, MemoryStore, AttackPattern
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")