From 6f3bffe68973d5eeb94a7cf19a047cf3ace24b8d Mon Sep 17 00:00:00 2001 From: Xusheng Date: Mon, 10 Apr 2023 11:41:32 +0800 Subject: [PATCH] Fix BN installation path detection does not work with Python 3.11 --- CHANGELOG.md | 2 ++ capa/features/extractors/binja/find_binja_api.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9737725a..b985d8cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ ### Bug Fixes +- extractor: fix binja installation path detection does not work with Python 3.11 + ### capa explorer IDA Pro plugin ### Development diff --git a/capa/features/extractors/binja/find_binja_api.py b/capa/features/extractors/binja/find_binja_api.py index 6356c074..f9001c41 100644 --- a/capa/features/extractors/binja/find_binja_api.py +++ b/capa/features/extractors/binja/find_binja_api.py @@ -15,8 +15,8 @@ import subprocess # binaryninja module is extracted by the PyInstaller. code = r""" from pathlib import Path -import importlib -spec = importlib.util.find_spec('binaryninja') +from importlib import util +spec = util.find_spec('binaryninja') if spec is not None: if len(spec.submodule_search_locations) > 0: path = Path(spec.submodule_search_locations[0])