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