1
0
mirror of synced 2024-12-12 07:51:05 +01:00
ImHex/plugins/builtin/include/content/views/view_information.hpp
Fenrisfulsur 069221757f
feat: Added chunk based entropy analysis to information view (#933)
Issue: https://github.com/WerWolv/ImHex/issues/522

Implementation of chunk based entropy analysis in diagram.hpp available
from the data information view and in the pattern language.

---------

Co-authored-by: WerWolv <werwolv98@gmail.com>
2023-03-10 16:06:18 +01:00

52 lines
1.2 KiB
C++

#pragma once
#include <hex/ui/view.hpp>
#include <hex/api/task.hpp>
#include "content/helpers/diagrams.hpp"
#include <array>
#include <atomic>
#include <cstdio>
#include <string>
#include <vector>
namespace hex::plugin::builtin {
class ViewInformation : public View {
public:
explicit ViewInformation();
~ViewInformation() override;
void drawContent() override;
private:
bool m_dataValid = false;
u32 m_blockSize = 0;
double m_averageEntropy = -1.0;
double m_highestBlockEntropy = -1.0;
double m_plainTextCharacterPercentage = -1.0;
TaskHolder m_analyzerTask;
Region m_analyzedRegion = { 0, 0 };
std::string m_dataDescription;
std::string m_dataMimeType;
DiagramDigram m_digram;
DiagramLayeredDistribution m_layeredDistribution;
DiagramByteDistribution m_byteDistribution;
DiagramByteTypesDistribution m_byteTypesDistribution;
DiagramChunkBasedEntropyAnalysis m_chunkBasedEntropy;
void analyze();
// User controlled input (referenced by ImgGui)
int m_inputChunkSize = 0;
int m_inputStartAddress = 0;
int m_inputEndAddress = 0;
};
}