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:
|
2023-03-17 17:07:39 +01:00
|
|
|
bool m_dataValid = false;
|
|
|
|
u32 m_blockSize = 0;
|
|
|
|
double m_averageEntropy = -1.0;
|
|
|
|
|
2022-12-28 23:06:49 +01:00
|
|
|
double m_highestBlockEntropy = -1.0;
|
2023-03-17 17:07:39 +01:00
|
|
|
u64 m_highestBlockEntropyAddress = 0x00;
|
|
|
|
double m_lowestBlockEntropy = -1.0;
|
|
|
|
u64 m_lowestBlockEntropyAddress = 0x00;
|
|
|
|
|
2022-12-28 23:06:49 +01:00
|
|
|
double m_plainTextCharacterPercentage = -1.0;
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2022-08-17 16:15:36 +02:00
|
|
|
TaskHolder m_analyzerTask;
|
2020-11-22 19:43:35 +01:00
|
|
|
|
2023-04-10 14:08:21 +02:00
|
|
|
Region m_analysisRegion = { 0, 0 };
|
2022-07-31 16:57:35 +02:00
|
|
|
Region m_analyzedRegion = { 0, 0 };
|
2024-01-09 16:48:49 +01:00
|
|
|
prv::Provider *m_analyzedProvider = nullptr;
|
2020-11-12 09:38:52 +01:00
|
|
|
|
2022-07-31 16:57:35 +02:00
|
|
|
std::string m_dataDescription;
|
|
|
|
std::string m_dataMimeType;
|
2024-01-25 20:53:08 +01:00
|
|
|
std::string m_dataAppleCreatorType;
|
|
|
|
std::string m_dataExtensions;
|
2021-02-22 13:08:06 +01:00
|
|
|
|
2022-12-27 22:50:37 +01:00
|
|
|
DiagramDigram m_digram;
|
|
|
|
DiagramLayeredDistribution m_layeredDistribution;
|
2023-03-10 16:06:18 +01:00
|
|
|
DiagramByteDistribution m_byteDistribution;
|
|
|
|
DiagramByteTypesDistribution m_byteTypesDistribution;
|
|
|
|
DiagramChunkBasedEntropyAnalysis m_chunkBasedEntropy;
|
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
|
|
|
|
2023-12-12 13:20:51 +01:00
|
|
|
u32 m_inputChunkSize = 0;
|
2023-04-10 14:08:21 +02:00
|
|
|
ui::RegionType m_selectionType = ui::RegionType::EntireData;
|
2020-11-12 09:38:52 +01:00
|
|
|
};
|
|
|
|
|
2023-03-10 16:06:18 +01:00
|
|
|
}
|