2021-02-26 13:35:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <imgui.h>
|
|
|
|
#include <hex/views/view.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-01-22 22:37:52 +01:00
|
|
|
i64 address;
|
|
|
|
i32 size;
|
2021-02-26 13:35:19 +01:00
|
|
|
bool wholeDataMatch;
|
|
|
|
};
|
|
|
|
|
2021-09-23 22:57:19 +02:00
|
|
|
std::vector<std::pair<std::string, std::string>> m_rules;
|
2021-02-26 13:35:19 +01:00
|
|
|
std::vector<YaraMatch> m_matches;
|
|
|
|
u32 m_selectedRule = 0;
|
|
|
|
bool m_matching = false;
|
|
|
|
std::vector<char> m_errorMessage;
|
|
|
|
|
|
|
|
void reloadRules();
|
|
|
|
void applyRules();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|