diff --git a/capa/ida/plugin/form.py b/capa/ida/plugin/form.py index 29d8305c..99cdafd9 100644 --- a/capa/ida/plugin/form.py +++ b/capa/ida/plugin/form.py @@ -44,6 +44,13 @@ CAPA_SETTINGS_RULE_PATH = "rule_path" CAPA_SETTINGS_RULEGEN_AUTHOR = "rulegen_author" CAPA_SETTINGS_RULEGEN_SCOPE = "rulegen_scope" +from enum import IntFlag + + +class Options(IntFlag): + DEFAULT = 0 + ANALYZE = 1 # Runs the analysis when starting the explorer + def write_file(path, data): """ """ @@ -230,7 +237,7 @@ class CapaSettingsInputDialog(QtWidgets.QDialog): class CapaExplorerForm(idaapi.PluginForm): """form element for plugin interface""" - def __init__(self, name, option=0): + def __init__(self, name, option=Options.DEFAULT): """initialize form elements""" super(CapaExplorerForm, self).__init__() @@ -278,7 +285,7 @@ class CapaExplorerForm(idaapi.PluginForm): self.Show() - if option == 1: + if (option & Options.ANALYZE) == Options.ANALYZE: self.analyze_program() def OnCreate(self, form):