diff options
| author | Xusheng <xusheng@vector35.com> | 2023-10-16 11:19:21 +0800 |
|---|---|---|
| committer | Xusheng <xusheng@vector35.com> | 2023-12-08 10:17:27 -0500 |
| commit | 58912645aef34b2de09cd341720f5a421250abfa (patch) | |
| tree | ca7eb8e834827a50c2edd4f0a4d3f59f0a139e52 /ui/viewframe.h | |
| parent | 693912a79d525d610ea84fee64991d9045a6c45d (diff) | |
Add support for main function detection in x64 Windows binaries
Diffstat (limited to 'ui/viewframe.h')
| -rw-r--r-- | ui/viewframe.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/viewframe.h b/ui/viewframe.h index 7f4376e8..fd663750 100644 --- a/ui/viewframe.h +++ b/ui/viewframe.h @@ -346,6 +346,29 @@ class SymbolsView; class ViewFrame; class ViewPane; + +class TimerWithMaxTries: public QObject +{ + Q_OBJECT + + QTimer* timer; + size_t attempts; + size_t initialDelay; + size_t maxTries; + size_t delay; + std::atomic<bool> stopped = false; + +public: + TimerWithMaxTries(QWidget* parent, size_t initialDelay, size_t n, size_t msec); + void start(); + void stop(); + ~TimerWithMaxTries(); + +Q_SIGNALS: + void timeout(); +}; + + /*! \ingroup viewframe @@ -374,6 +397,7 @@ class BINARYNINJAUIAPI ViewFrame : public QWidget bool m_aboutToClose = false; UIActionHandler m_actionHandler; + TimerWithMaxTries* m_mainNavigationTimer; protected: QPointer<CompileDialog> compileDialog; @@ -390,6 +414,8 @@ class BINARYNINJAUIAPI ViewFrame : public QWidget */ BinaryNinja::Ref<HistoryEntry> deserializeHistoryEntry(const Json::Value& json); + bool tryMainSymbolsNavigation(); + public: explicit ViewFrame(QWidget* parent, FileContext* file, const QString& type, bool createDynamicWidgets = false); virtual ~ViewFrame(); @@ -488,6 +514,7 @@ class BINARYNINJAUIAPI ViewFrame : public QWidget void updateCrossReferenceSelection(); void nextCrossReference(); void prevCrossReference(); + void tryNavigateToMain(); void updateVariableList(); void updateStackView(); |
