From 9db106e3f0fecba2225eb4ef34a54ed86daacde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=E1=BB=93ng=20Th=E1=BA=A5t=20C=C3=B4ng?= Date: Wed, 22 Mar 2023 11:58:46 +0700 Subject: [PATCH] Update __init__.py Update IDA plugin --- capa/ida/plugin/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/capa/ida/plugin/__init__.py b/capa/ida/plugin/__init__.py index 8030a800..a24e7d38 100644 --- a/capa/ida/plugin/__init__.py +++ b/capa/ida/plugin/__init__.py @@ -67,7 +67,16 @@ class CapaExplorerPlugin(idaapi.plugin_t): arg (int): bitflag. Setting LSB enables automatic analysis upon loading. The other bits are currently undefined. See `form.Options`. """ - self.form = CapaExplorerForm(self.PLUGIN_NAME, arg) + if not self.form: + self.form = CapaExplorerForm(self.PLUGIN_NAME, arg) + else: + widget = idaapi.find_widget(self.form.form_title) + if widget: + idaapi.activate_widget(widget, True) + else: + self.form.Show() + self.form.load_capa_results(False, True) + return True