mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
refactor: Rework features that use external libraries into optional plugins (#1470)
This commit is contained in:
27
plugins/yara_rules/source/plugin_yara.cpp
Normal file
27
plugins/yara_rules/source/plugin_yara.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <hex/plugin.hpp>
|
||||
|
||||
#include <hex/api/content_registry.hpp>
|
||||
#include <hex/helpers/logger.hpp>
|
||||
|
||||
#include <romfs/romfs.hpp>
|
||||
|
||||
#include "content/views/view_yara.hpp"
|
||||
|
||||
using namespace hex;
|
||||
using namespace hex::plugin::yara;
|
||||
|
||||
namespace {
|
||||
|
||||
void registerViews() {
|
||||
ContentRegistry::Views::add<ViewYara>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IMHEX_PLUGIN_SETUP("Yara Rules", "WerWolv", "Support for matching Yara rules") {
|
||||
hex::log::debug("Using romfs: '{}'", romfs::name());
|
||||
for (auto &path : romfs::list("lang"))
|
||||
hex::ContentRegistry::Language::addLocalization(nlohmann::json::parse(romfs::get(path).string()));
|
||||
|
||||
registerViews();
|
||||
}
|
||||
Reference in New Issue
Block a user