summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorRusty Wagner <rusty.wagner@gmail.com>2025-06-03 13:42:04 -0600
committerRusty Wagner <rusty.wagner@gmail.com>2025-06-03 13:42:54 -0600
commit9c8d4eac3dadf6273b34ba193c219de9283285b3 (patch)
treed2df35ae70c77ef83dd320a29f97baa738a956d6 /ui
parent37d52c95d94b8a586c5d59fb500a7b35f3e272dc (diff)
Add UI action and API to control early returns in HLIL
Diffstat (limited to 'ui')
-rw-r--r--ui/commands.h1
-rw-r--r--ui/flowgraphwidget.h3
-rw-r--r--ui/linearview.h3
3 files changed, 7 insertions, 0 deletions
diff --git a/ui/commands.h b/ui/commands.h
index aed0fbf6..754d99a7 100644
--- a/ui/commands.h
+++ b/ui/commands.h
@@ -98,6 +98,7 @@ TypeRef GetFunctionType(BinaryViewRef data, TypeRef type);
std::optional<uint64_t> getFoldableExprAddress(
BinaryNinja::HighLevelILFunction* hlil, const HighlightTokenState& highlight);
std::optional<uint64_t> getInvertableConditionAddress(BinaryNinja::HighLevelILFunction* hlil, size_t instrIndex);
+std::optional<uint64_t> getEarlyReturnAddress(BinaryNinja::HighLevelILFunction* hlil, size_t instrIndex);
/*!
@}
diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h
index b69ec38b..d988da12 100644
--- a/ui/flowgraphwidget.h
+++ b/ui/flowgraphwidget.h
@@ -170,6 +170,8 @@ class BINARYNINJAUIAPI FlowGraphWidget :
BNExprFolding getCurrentExprFolding();
std::optional<uint64_t> getCurrentInvertableConditionAddress();
bool getCurrentConditionInverted();
+ std::optional<uint64_t> getCurrentEarlyReturnAddress();
+ BNEarlyReturn getCurrentEarlyReturn();
std::optional<std::pair<BinaryNinja::Variable, BinaryNinja::Variable>> getMergeVariablesAtCurrentLocation();
protected:
@@ -401,6 +403,7 @@ class BINARYNINJAUIAPI FlowGraphWidget :
void setCurrentVariableDeadStoreElimination(BNDeadStoreElimination elimination);
void setCurrentExprFolding(BNExprFolding folding);
void toggleConditionInverted();
+ void setCurrentEarlyReturn(BNEarlyReturn earlyReturn);
void splitToNewTabAndNavigateFromCursorPosition();
void splitToNewWindowAndNavigateFromCursorPosition();
void splitToNewPaneAndNavigateFromCursorPosition();
diff --git a/ui/linearview.h b/ui/linearview.h
index 2ea8e37f..eea40d7f 100644
--- a/ui/linearview.h
+++ b/ui/linearview.h
@@ -320,6 +320,8 @@ class BINARYNINJAUIAPI LinearView : public QAbstractScrollArea, public View, pub
BNExprFolding getCurrentExprFolding();
std::optional<uint64_t> getCurrentInvertableConditionAddress();
bool getCurrentConditionInverted();
+ std::optional<uint64_t> getCurrentEarlyReturnAddress();
+ BNEarlyReturn getCurrentEarlyReturn();
void setDataButtonVisible(bool visible);
std::optional<std::pair<BinaryNinja::Variable, BinaryNinja::Variable>> getMergeVariablesAtCurrentLocation();
@@ -412,6 +414,7 @@ private Q_SLOTS:
void setCurrentVariableDeadStoreElimination(BNDeadStoreElimination elimination);
void setCurrentExprFolding(BNExprFolding folding);
void toggleConditionInverted();
+ void setCurrentEarlyReturn(BNEarlyReturn earlyReturn);
Q_SIGNALS:
void notifyResizeEvent(int width, int height);