explorer: fix plugin exception when loaded under idat (#1341)

This commit is contained in:
Mike Hunhoff
2023-03-02 13:42:43 -07:00
committed by GitHub
parent 52de09a032
commit 9f3428e1c3
4 changed files with 13 additions and 8 deletions

View File

@@ -38,6 +38,12 @@ class CapaExplorerPlugin(idaapi.plugin_t):
"""called when IDA is loading the plugin"""
logging.basicConfig(level=logging.INFO)
# do not load plugin unless hosted in idaq (IDA Qt)
if not idaapi.is_idaq():
# note: it does not appear that IDA calls "init" by default when hosted in idat; we keep this
# check here for good measure
return idaapi.PLUGIN_SKIP
import capa.ida.helpers
# do not load plugin if IDA version/file type not supported