diff options
| author | Ryan Snyder <ryan@vector35.com> | 2025-02-24 15:14:19 -0500 |
|---|---|---|
| committer | Ryan Snyder <ryan@vector35.com> | 2025-03-17 10:07:02 -0400 |
| commit | 1652efdc43aa3acbd570c1f042a35da458538bb4 (patch) | |
| tree | 72c5ec04401432691a78acdd0d29b1fc7ecc07de /ui | |
| parent | 996ad28c29cd242b672041ae3b08e97a0e160a85 (diff) | |
core: initial union support with C++ API
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/commands.h | 10 | ||||
| -rw-r--r-- | ui/flowgraphwidget.h | 3 | ||||
| -rw-r--r-- | ui/linearview.h | 3 | ||||
| -rw-r--r-- | ui/uitypes.h | 1 | ||||
| -rw-r--r-- | ui/util.h | 2 |
5 files changed, 18 insertions, 1 deletions
diff --git a/ui/commands.h b/ui/commands.h index 662e1d6c..c8634bf7 100644 --- a/ui/commands.h +++ b/ui/commands.h @@ -47,6 +47,16 @@ bool BINARYNINJAUIAPI eligibleToForceVariableVersion(View* parent, HighlightToke bool BINARYNINJAUIAPI clearVariableVersion(View* parent, HighlightTokenState& highlight); bool BINARYNINJAUIAPI eligibleToClearVariableVersion(View* parent, HighlightTokenState& highlight); +struct BINARYNINJAUIAPI FieldResolutionState +{ + std::vector<std::pair<std::string, FieldResolutionInfoRef>> goodFieldResolutions = {}; + std::vector<std::pair<std::string, FieldResolutionInfoRef>> badFieldResolutions = {}; + + size_t registeredGoodFieldResolutions = 0; + size_t registeredBadFieldResolutions = 0; + + void bindDynamicActions(View* view, HighlightTokenState& highlight); +}; bool BINARYNINJAUIAPI getEnumSelection(QWidget* parent, BinaryViewRef data, FunctionRef func, uint64_t constValue, TypeRef& selectedEnum, bool checkValue, bool canTruncate); diff --git a/ui/flowgraphwidget.h b/ui/flowgraphwidget.h index 3d1434de..52635584 100644 --- a/ui/flowgraphwidget.h +++ b/ui/flowgraphwidget.h @@ -8,6 +8,7 @@ #include "menus.h" #include "uicontext.h" #include "commentdialog.h" +#include "commands.h" #include "instructionedit.h" /*! @@ -147,6 +148,8 @@ class BINARYNINJAUIAPI FlowGraphWidget : FlowGraphRef m_recenterWithGraph; int m_recenterXofs, m_recenterYofs; + FieldResolutionState m_fieldResolution; + static int m_layoutCompleteEventType; static int m_updateCompleteEventType; diff --git a/ui/linearview.h b/ui/linearview.h index 727f8634..f7253e3f 100644 --- a/ui/linearview.h +++ b/ui/linearview.h @@ -15,6 +15,7 @@ #include "uicontext.h" #include "instructionedit.h" #include "ilchooser.h" +#include "commands.h" #include <assembledialog.h> #define LINEAR_VIEW_UPDATE_CHECK_INTERVAL 200 @@ -244,6 +245,8 @@ class BINARYNINJAUIAPI LinearView : public QAbstractScrollArea, public View, pub std::set<std::string> m_layers; + FieldResolutionState m_fieldResolution; + void setTopToAddress(uint64_t addr); void setTopToOrderingIndex(uint64_t idx); void refreshLines(size_t lineOffset = 0, bool refreshUIContext = true); diff --git a/ui/uitypes.h b/ui/uitypes.h index 410dde70..f950268d 100644 --- a/ui/uitypes.h +++ b/ui/uitypes.h @@ -77,6 +77,7 @@ typedef BinaryNinja::Ref<BinaryNinja::DownloadProvider> DownloadProviderRef; typedef BinaryNinja::Ref<BinaryNinja::Enumeration> EnumerationRef; typedef BinaryNinja::Ref<BinaryNinja::ExternalLibrary> ExternalLibraryRef; typedef BinaryNinja::Ref<BinaryNinja::ExternalLocation> ExternalLocationRef; +typedef BinaryNinja::Ref<BinaryNinja::FieldResolutionInfo> FieldResolutionInfoRef; typedef BinaryNinja::Ref<BinaryNinja::FileMetadata> FileMetadataRef; typedef BinaryNinja::Ref<BinaryNinja::FlowGraph> FlowGraphRef; typedef BinaryNinja::Ref<BinaryNinja::FlowGraphLayoutRequest> FlowGraphLayoutRequestRef; @@ -31,7 +31,7 @@ std::optional<BinaryNinja::PossibleValueSet> BINARYNINJAUIAPI getPossibleValueSe std::optional<uint64_t> BINARYNINJAUIAPI getAddressOfILTokenExpr(View* view, HighlightTokenState token); template <typename T> -std::optional<T> visitILInstructionForToken(View* view, HighlightTokenState token, +std::optional<T> visitILInstructionForToken(View* view, const HighlightTokenState& token, const std::function<std::optional<T>(BinaryNinja::LowLevelILInstruction&)>& llil, const std::function<std::optional<T>(BinaryNinja::MediumLevelILInstruction&)>& mlil, const std::function<std::optional<T>(BinaryNinja::HighLevelILInstruction&)>& hlil) |
