From 3401b90b10075cb4c602bc92c255448b0493ee7e Mon Sep 17 00:00:00 2001 From: Fish Date: Tue, 24 Sep 2024 22:41:37 -0700 Subject: [PATCH] Switch to decompilation presets. (#1329) --- angrmanagement/ui/widgets/qdecomp_options.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/angrmanagement/ui/widgets/qdecomp_options.py b/angrmanagement/ui/widgets/qdecomp_options.py index 471d4c9f2..ec03e8ae7 100644 --- a/angrmanagement/ui/widgets/qdecomp_options.py +++ b/angrmanagement/ui/widgets/qdecomp_options.py @@ -2,8 +2,9 @@ from typing import TYPE_CHECKING +from angr.analyses.decompiler import DECOMPILATION_PRESETS from angr.analyses.decompiler.decompilation_options import options as dec_options -from angr.analyses.decompiler.optimization_passes import get_default_optimization_passes, get_optimization_passes +from angr.analyses.decompiler.optimization_passes import get_optimization_passes from angr.analyses.decompiler.peephole_optimizations import EXPR_OPTS, MULTI_STMT_OPTS, STMT_OPTS from PySide6.QtCore import Qt from PySide6.QtWidgets import QComboBox, QLineEdit, QPushButton, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget @@ -163,9 +164,10 @@ def get_default_options(self): # pylint: disable=no-self-use def get_default_passes(self): if self._instance is None or self._instance.project.am_none: return [] - return get_default_optimization_passes(self._instance.project.arch, self._instance.project.simos.name) + [ - x for x, de in self._code_view.workspace.plugins.optimization_passes() if de - ] + default_preset = DECOMPILATION_PRESETS["default"] + return default_preset.get_optimization_passes( + self._instance.project.arch, self._instance.project.simos.name + ) + [x for x, de in self._code_view.workspace.plugins.optimization_passes() if de] def get_all_passes(self): if self._instance is None or self._instance.project.am_none: