2021-02-26 13:35:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2021-02-26 13:35:19 +01:00
|
|
|
|
2023-11-18 14:50:43 +01:00
|
|
|
#include <hex/api/task_manager.hpp>
|
2022-08-17 16:15:36 +02:00
|
|
|
|
2024-02-21 22:08:26 +01:00
|
|
|
#include <content/yara_rule.hpp>
|
2024-02-23 17:49:20 +01:00
|
|
|
#include <wolv/container/interval_tree.hpp>
|
2024-02-21 22:08:26 +01:00
|
|
|
|
2023-12-23 21:09:41 +01:00
|
|
|
namespace hex::plugin::yara {
|
2021-02-26 13:35:19 +01:00
|
|
|
|
2023-11-21 13:47:50 +01:00
|
|
|
class ViewYara : public View::Window {
|
2021-02-26 13:35:19 +01:00
|
|
|
public:
|
|
|
|
ViewYara();
|
|
|
|
~ViewYara() override;
|
|
|
|
|
|
|
|
void drawContent() override;
|
|
|
|
|
2023-04-17 16:18:48 +02:00
|
|
|
private:
|
2024-02-21 22:08:26 +01:00
|
|
|
PerProvider<std::vector<std::pair<std::fs::path, std::fs::path>>> m_rulePaths;
|
2024-02-22 20:49:21 +01:00
|
|
|
PerProvider<std::vector<YaraRule::Rule>> m_matchedRules;
|
2024-02-21 22:08:26 +01:00
|
|
|
PerProvider<std::vector<std::string>> m_consoleMessages;
|
|
|
|
PerProvider<u32> m_selectedRule;
|
2024-02-23 17:49:20 +01:00
|
|
|
PerProvider<wolv::container::IntervalTree<std::string>> m_highlights;
|
2024-02-22 20:49:21 +01:00
|
|
|
|
2022-08-17 16:15:36 +02:00
|
|
|
TaskHolder m_matcherTask;
|
2022-03-15 23:48:49 +01:00
|
|
|
|
2021-02-26 13:35:19 +01:00
|
|
|
void applyRules();
|
2022-03-15 23:48:49 +01:00
|
|
|
void clearResult();
|
2021-02-26 13:35:19 +01:00
|
|
|
};
|
|
|
|
|
2024-02-23 17:49:20 +01:00
|
|
|
}
|