From 37a0604d805991b85a0590279ad993a19ddee7bb Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Thu, 1 Jan 2026 12:21:22 -0500 Subject: add whole-file entropy calculation to triage --- examples/triage/entropy.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'examples/triage/entropy.h') diff --git a/examples/triage/entropy.h b/examples/triage/entropy.h index 821dfb7b..bd50081d 100644 --- a/examples/triage/entropy.h +++ b/examples/triage/entropy.h @@ -3,6 +3,7 @@ #include #include #include +#include #include "uitypes.h" @@ -13,6 +14,9 @@ class EntropyThread size_t m_blockSize; bool m_updated, m_running; std::thread m_thread; + double m_averageEntropy; + int m_sampleCount; + mutable std::mutex m_mutex; public: EntropyThread(BinaryViewRef data, size_t blockSize, QImage* image); @@ -21,6 +25,7 @@ class EntropyThread void Run(); bool IsUpdated() { return m_updated; } void ResetUpdated() { m_updated = false; } + double GetAverageEntropy() const; }; @@ -28,6 +33,8 @@ class TriageView; class EntropyWidget : public QWidget { + Q_OBJECT + TriageView* m_view; BinaryViewRef m_data, m_rawData; size_t m_blockSize; @@ -40,6 +47,10 @@ class EntropyWidget : public QWidget virtual ~EntropyWidget(); virtual QSize sizeHint() const override; + double getAverageEntropy() const; + + Q_SIGNALS: + void entropyUpdated(double avgEntropy); protected: virtual void paintEvent(QPaintEvent* event) override; -- cgit v1.3.1