1
0
mirror of synced 2025-01-22 19:42:11 +01:00
2024-02-21 22:08:26 +01:00

41 lines
891 B
C++

#pragma once
#include <hex.hpp>
#include <hex/ui/view.hpp>
#include <hex/api/task_manager.hpp>
#include <content/yara_rule.hpp>
namespace hex::plugin::yara {
class ViewYara : public View::Window {
public:
ViewYara();
~ViewYara() override;
void drawContent() override;
private:
struct YaraMatch {
YaraRule::Match match;
mutable u32 highlightId;
mutable u32 tooltipId;
};
private:
PerProvider<std::vector<std::pair<std::fs::path, std::fs::path>>> m_rulePaths;
PerProvider<std::vector<YaraMatch>> m_matches;
PerProvider<std::vector<YaraMatch*>> m_sortedMatches;
PerProvider<std::vector<std::string>> m_consoleMessages;
PerProvider<u32> m_selectedRule;
TaskHolder m_matcherTask;
void applyRules();
void clearResult();
};
}