2020-11-12 09:38:52 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2023-11-18 14:50:43 +01:00
|
|
|
#include <hex/api/task_manager.hpp>
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2022-12-27 22:50:37 +01:00
|
|
|
#include "content/helpers/diagrams.hpp"
|
2023-04-10 14:08:21 +02:00
|
|
|
#include <ui/widgets.hpp>
|
2022-12-27 22:50:37 +01:00
|
|
|
|
2020-11-12 09:38:52 +01:00
|
|
|
#include <string>
|
|
|
|
|
2021-12-07 22:47:41 +01:00
|
|
|
namespace hex::plugin::builtin {
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2023-11-21 13:47:50 +01:00
|
|
|
class ViewInformation : public View::Window {
|
2020-11-12 09:38:52 +01:00
|
|
|
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:
|
2024-01-25 22:49:56 +01:00
|
|
|
struct AnalysisData {
|
|
|
|
AnalysisData() = default;
|
|
|
|
AnalysisData(const AnalysisData&) = default;
|
2023-03-17 17:07:39 +01:00
|
|
|
|
2024-01-25 22:49:56 +01:00
|
|
|
TaskHolder analyzerTask;
|
2023-03-17 17:07:39 +01:00
|
|
|
|
2024-01-25 22:49:56 +01:00
|
|
|
bool dataValid = false;
|
|
|
|
u32 blockSize = 0;
|
|
|
|
double averageEntropy = -1.0;
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2024-01-25 22:49:56 +01:00
|
|
|
double highestBlockEntropy = -1.0;
|
|
|
|
u64 highestBlockEntropyAddress = 0x00;
|
|
|
|
double lowestBlockEntropy = -1.0;
|
|
|
|
u64 lowestBlockEntropyAddress = 0x00;
|
2020-11-22 19:43:35 +01:00
|
|
|
|
2024-01-25 22:49:56 +01:00
|
|
|
double plainTextCharacterPercentage = -1.0;
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2024-01-25 22:49:56 +01:00
|
|
|
Region analysisRegion = { 0, 0 };
|
|
|
|
Region analyzedRegion = { 0, 0 };
|
|
|
|
prv::Provider *analyzedProvider = nullptr;
|
|
|
|
|
|
|
|
std::string dataDescription;
|
|
|
|
std::string dataMimeType;
|
|
|
|
std::string dataAppleCreatorType;
|
|
|
|
std::string dataExtensions;
|
|
|
|
|
|
|
|
std::shared_ptr<DiagramDigram> digram;
|
|
|
|
std::shared_ptr<DiagramLayeredDistribution> layeredDistribution;
|
|
|
|
std::shared_ptr<DiagramByteDistribution> byteDistribution;
|
|
|
|
std::shared_ptr<DiagramByteTypesDistribution> byteTypesDistribution;
|
|
|
|
std::shared_ptr<DiagramChunkBasedEntropyAnalysis> chunkBasedEntropy;
|
|
|
|
|
|
|
|
u32 inputChunkSize = 0;
|
|
|
|
ui::RegionType selectionType = ui::RegionType::EntireData;
|
|
|
|
};
|
|
|
|
|
|
|
|
PerProvider<AnalysisData> m_analysis;
|
2021-02-22 13:08:06 +01:00
|
|
|
|
2022-12-27 22:50:37 +01:00
|
|
|
|
2021-02-22 13:08:06 +01:00
|
|
|
void analyze();
|
2023-03-10 16:06:18 +01:00
|
|
|
|
2020-11-12 09:38:52 +01:00
|
|
|
};
|
|
|
|
|
2023-03-10 16:06:18 +01:00
|
|
|
}
|