mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <imgui.h>
|
||||
#include <hex/api/task_manager.hpp>
|
||||
#include <hex/helpers/default_paths.hpp>
|
||||
#include <hex/ui/imgui_imhex_extensions.h>
|
||||
|
||||
#include <content/yara_rule.hpp>
|
||||
@@ -25,7 +26,7 @@ namespace hex::plugin::yara {
|
||||
};
|
||||
|
||||
void process(Task &task, prv::Provider *provider, Region region) override {
|
||||
for (const auto &yaraSignaturePath : fs::getDefaultPaths(fs::ImHexPath::YaraAdvancedAnalysis)) {
|
||||
for (const auto &yaraSignaturePath : paths::YaraAdvancedAnalysis.read()) {
|
||||
for (const auto &ruleFilePath : std::fs::recursive_directory_iterator(yaraSignaturePath)) {
|
||||
wolv::io::File file(ruleFilePath.path(), wolv::io::File::Mode::Read);
|
||||
if (!file.isValid())
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <hex/api/project_file_manager.hpp>
|
||||
|
||||
#include <hex/helpers/fs.hpp>
|
||||
#include <hex/helpers/default_paths.hpp>
|
||||
|
||||
#include <toasts/toast_notification.hpp>
|
||||
#include <popups/popup_file_chooser.hpp>
|
||||
@@ -21,7 +22,7 @@ namespace hex::plugin::yara {
|
||||
YaraRule::init();
|
||||
|
||||
ContentRegistry::FileHandler::add({ ".yar", ".yara" }, [](const auto &path) {
|
||||
for (const auto &destPath : fs::getDefaultPaths(fs::ImHexPath::Yara)) {
|
||||
for (const auto &destPath : paths::Yara.write()) {
|
||||
if (wolv::io::fs::copyFile(path, destPath / path.filename(), std::fs::copy_options::overwrite_existing)) {
|
||||
ui::ToastInfo::open("hex.yara_rules.view.yara.rule_added"_lang);
|
||||
return true;
|
||||
@@ -143,7 +144,7 @@ namespace hex::plugin::yara {
|
||||
}
|
||||
|
||||
if (ImGuiExt::IconButton(ICON_VS_ADD, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
|
||||
const auto basePaths = fs::getDefaultPaths(fs::ImHexPath::Yara);
|
||||
const auto basePaths = paths::Yara.read();
|
||||
std::vector<std::fs::path> paths;
|
||||
for (const auto &path : basePaths) {
|
||||
std::error_code error;
|
||||
|
||||
Reference in New Issue
Block a user