diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2025-05-22 18:06:32 -0600 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2025-05-23 19:30:52 -0600 |
| commit | 98d81b780952c2c91fe686c55bb867d193472749 (patch) | |
| tree | ab768c350bc5b717ca10970fc51555c5519749ca /ui | |
| parent | 6248965db87082e5f27a5f222a63d8eddeafe6fc (diff) | |
Add UI action and API to control expression folding
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/commands.h | 5 | ||||
| -rw-r--r-- | ui/flowgraphwidget.h | 3 | ||||
| -rw-r--r-- | ui/linearview.h | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/ui/commands.h b/ui/commands.h index c8634bf7..7fb3f539 100644 --- a/ui/commands.h +++ b/ui/commands.h @@ -95,6 +95,9 @@ std::optional<std::string> GetVariableNameFromExpr(BinaryNinja::Function* func, // typedef-ed type TypeRef GetFunctionType(BinaryViewRef data, TypeRef type); +std::optional<uint64_t> getFoldableExprAddress( + BinaryNinja::HighLevelILFunction* hlil, const HighlightTokenState& highlight); + /*! - @} + @} */ diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h index 5133cd24..c7af8aa9 100644 --- a/ui/flowgraphwidget.h +++ b/ui/flowgraphwidget.h @@ -166,6 +166,8 @@ class BINARYNINJAUIAPI FlowGraphWidget : void recenterUpdatedGraph(FlowGraphRef oldGraph, int oldXOfs, int oldYOfs); BNDeadStoreElimination getCurrentVariableDeadStoreElimination(); + std::optional<uint64_t> getCurrentFoldableExprAddress(); + BNExprFolding getCurrentExprFolding(); std::optional<std::pair<BinaryNinja::Variable, BinaryNinja::Variable>> getMergeVariablesAtCurrentLocation(); protected: @@ -395,6 +397,7 @@ class BINARYNINJAUIAPI FlowGraphWidget : void instrEditDoneEvent(); void setCurrentVariableDeadStoreElimination(BNDeadStoreElimination elimination); + void setCurrentExprFolding(BNExprFolding folding); void splitToNewTabAndNavigateFromCursorPosition(); void splitToNewWindowAndNavigateFromCursorPosition(); void splitToNewPaneAndNavigateFromCursorPosition(); diff --git a/ui/linearview.h b/ui/linearview.h index 588909be..e5305aa8 100644 --- a/ui/linearview.h +++ b/ui/linearview.h @@ -316,6 +316,8 @@ class BINARYNINJAUIAPI LinearView : public QAbstractScrollArea, public View, pub TypeRef resType, uint64_t baseAddr, uint64_t& begin, uint64_t& end, bool singleLine, std::set<TypeRef>& seen); BNDeadStoreElimination getCurrentVariableDeadStoreElimination(); + std::optional<uint64_t> getCurrentFoldableExprAddress(); + BNExprFolding getCurrentExprFolding(); void setDataButtonVisible(bool visible); std::optional<std::pair<BinaryNinja::Variable, BinaryNinja::Variable>> getMergeVariablesAtCurrentLocation(); @@ -406,6 +408,7 @@ private Q_SLOTS: std::optional<uint64_t> addressForCall(); void setCurrentVariableDeadStoreElimination(BNDeadStoreElimination elimination); + void setCurrentExprFolding(BNExprFolding folding); Q_SIGNALS: void notifyResizeEvent(int width, int height); |
