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