2021-02-26 13:35:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <imgui.h>
|
2022-02-01 18:09:40 +01:00
|
|
|
#include <hex/ui/view.hpp>
|
2021-02-26 13:35:19 +01:00
|
|
|
|
2022-08-17 16:15:36 +02:00
|
|
|
#include <hex/api/task.hpp>
|
|
|
|
|
2021-12-07 22:47:41 +01:00
|
|
|
namespace hex::plugin::builtin {
|
2021-02-26 13:35:19 +01:00
|
|
|
|
|
|
|
class ViewYara : public View {
|
|
|
|
public:
|
|
|
|
ViewYara();
|
|
|
|
~ViewYara() override;
|
|
|
|
|
|
|
|
void drawContent() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct YaraMatch {
|
|
|
|
std::string identifier;
|
2021-11-04 20:41:36 +01:00
|
|
|
std::string variable;
|
2022-02-02 21:08:46 +01:00
|
|
|
u64 address;
|
|
|
|
size_t size;
|
2021-02-26 13:35:19 +01:00
|
|
|
bool wholeDataMatch;
|
2022-05-27 20:42:07 +02:00
|
|
|
|
2022-02-02 21:08:46 +01:00
|
|
|
u32 highlightId;
|
2022-05-27 20:42:07 +02:00
|
|
|
u32 tooltipId;
|
2021-02-26 13:35:19 +01:00
|
|
|
};
|
|
|
|
|
2022-06-30 19:39:06 +02:00
|
|
|
std::vector<std::pair<std::fs::path, std::fs::path>> m_rules;
|
2021-02-26 13:35:19 +01:00
|
|
|
std::vector<YaraMatch> m_matches;
|
|
|
|
u32 m_selectedRule = 0;
|
2022-08-17 16:15:36 +02:00
|
|
|
TaskHolder m_matcherTask;
|
2022-03-15 23:48:49 +01:00
|
|
|
|
|
|
|
std::vector<std::string> m_consoleMessages;
|
2021-02-26 13:35:19 +01:00
|
|
|
|
|
|
|
void reloadRules();
|
|
|
|
void applyRules();
|
2022-03-15 23:48:49 +01:00
|
|
|
void clearResult();
|
2021-02-26 13:35:19 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|