2020-11-12 08:38:52 +00:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-01 17:09:40 +00:00
|
|
|
#include <hex/ui/view.hpp>
|
2022-08-17 14:15:36 +00:00
|
|
|
#include <hex/api/task.hpp>
|
2020-11-12 08:38:52 +00:00
|
|
|
|
2022-12-27 21:50:37 +00:00
|
|
|
#include "content/helpers/diagrams.hpp"
|
|
|
|
|
2020-11-12 08:38:52 +00:00
|
|
|
#include <array>
|
2021-12-11 23:41:44 +00:00
|
|
|
#include <atomic>
|
2020-11-12 08:38:52 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2021-12-07 21:47:41 +00:00
|
|
|
namespace hex::plugin::builtin {
|
2020-11-12 08:38:52 +00:00
|
|
|
|
|
|
|
class ViewInformation : public View {
|
|
|
|
public:
|
2020-12-27 14:39:06 +00:00
|
|
|
explicit ViewInformation();
|
2020-11-12 08:38:52 +00:00
|
|
|
~ViewInformation() override;
|
|
|
|
|
2020-12-22 17:10:01 +00:00
|
|
|
void drawContent() override;
|
2020-11-12 08:38:52 +00:00
|
|
|
|
|
|
|
private:
|
2022-12-28 22:06:49 +00:00
|
|
|
bool m_dataValid = false;
|
|
|
|
u32 m_blockSize = 0;
|
|
|
|
double m_averageEntropy = -1.0;
|
|
|
|
double m_highestBlockEntropy = -1.0;
|
|
|
|
double m_plainTextCharacterPercentage = -1.0;
|
|
|
|
std::vector<double> m_blockEntropy;
|
2022-12-25 14:45:49 +00:00
|
|
|
std::array<std::vector<float>, 12> m_blockTypeDistributions;
|
2022-12-29 14:06:23 +00:00
|
|
|
std::atomic<u64> m_processedBlockCount = 0;
|
2020-11-12 08:38:52 +00:00
|
|
|
|
2022-12-27 21:50:37 +00:00
|
|
|
double m_diagramHandlePosition = 0.0;
|
2021-04-12 20:20:05 +00:00
|
|
|
|
2021-03-02 13:32:18 +00:00
|
|
|
std::array<ImU64, 256> m_valueCounts = { 0 };
|
2022-08-17 14:15:36 +00:00
|
|
|
TaskHolder m_analyzerTask;
|
2020-11-22 18:43:35 +00:00
|
|
|
|
2022-07-31 14:57:35 +00:00
|
|
|
Region m_analyzedRegion = { 0, 0 };
|
2020-11-12 08:38:52 +00:00
|
|
|
|
2022-07-31 14:57:35 +00:00
|
|
|
std::string m_dataDescription;
|
|
|
|
std::string m_dataMimeType;
|
2021-02-22 12:08:06 +00:00
|
|
|
|
2022-12-27 21:50:37 +00:00
|
|
|
DiagramDigram m_digram;
|
|
|
|
DiagramLayeredDistribution m_layeredDistribution;
|
|
|
|
|
2021-02-22 12:08:06 +00:00
|
|
|
void analyze();
|
2020-11-12 08:38:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|