feat: Allow selected yara rules to be saved to Project file

This commit is contained in:
WerWolv
2023-01-28 14:15:15 +01:00
parent 60a178f75e
commit b1aa58d446
4 changed files with 111 additions and 42 deletions

View File

@@ -79,6 +79,22 @@ namespace hex::plugin::builtin {
struct Hashes {
std::vector<ContentRegistry::Hashes::Hash::Function> hashFunctions;
} hashes;
struct Yara {
struct YaraMatch {
std::string identifier;
std::string variable;
u64 address;
size_t size;
bool wholeDataMatch;
u32 highlightId;
u32 tooltipId;
};
std::vector<std::pair<std::fs::path, std::fs::path>> rules;
std::vector<YaraMatch> matches;
} yara;
};
static Data& getCurrent() {

View File

@@ -17,19 +17,6 @@ namespace hex::plugin::builtin {
void drawContent() override;
private:
struct YaraMatch {
std::string identifier;
std::string variable;
u64 address;
size_t size;
bool wholeDataMatch;
u32 highlightId;
u32 tooltipId;
};
std::vector<std::pair<std::fs::path, std::fs::path>> m_rules;
std::vector<YaraMatch> m_matches;
u32 m_selectedRule = 0;
TaskHolder m_matcherTask;