Merge pull request #654 from fireeye/fix/653

resolve circular import failure
This commit is contained in:
Willi Ballenthin
2021-06-22 17:47:06 -06:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -113,6 +113,7 @@ It includes many new rules, including all new techniques introduced in MITRE ATT
- build: use Python 3.8 for PyInstaller to support consistently running across multiple operating systems including Windows 7 #505 @mr-tz
- main: correctly match BB-scope matches at file scope #605 @williballenthin
- explorer: add support for function-name feature #618 @mike-hunhoff
- explorer: circular import workaround #654 @mike-hunhoff
### Changes

View File

@@ -11,7 +11,6 @@ import logging
import idaapi
import ida_kernwin
from capa.ida.helpers import is_supported_file_type, is_supported_ida_version
from capa.ida.plugin.form import CapaExplorerForm
from capa.ida.plugin.icon import ICON
@@ -41,10 +40,12 @@ class CapaExplorerPlugin(idaapi.plugin_t):
"""called when IDA is loading the plugin"""
logging.basicConfig(level=logging.INFO)
import capa.ida.helpers
# do not load plugin if IDA version/file type not supported
if not is_supported_ida_version():
if not capa.ida.helpers.is_supported_ida_version():
return idaapi.PLUGIN_SKIP
if not is_supported_file_type():
if not capa.ida.helpers.is_supported_file_type():
return idaapi.PLUGIN_SKIP
return idaapi.PLUGIN_OK