From 607f7cba8de4480e5f69096cc63d76c9e552644d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 27 Feb 2024 18:01:30 +0100 Subject: [PATCH] fix: Yara rules not being read correctly in data information section --- .../yara_rules/source/content/data_information_sections.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/yara_rules/source/content/data_information_sections.cpp b/plugins/yara_rules/source/content/data_information_sections.cpp index c3f0a8dd1..07731e65b 100644 --- a/plugins/yara_rules/source/content/data_information_sections.cpp +++ b/plugins/yara_rules/source/content/data_information_sections.cpp @@ -29,9 +29,11 @@ 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 &ruleFilePath : std::fs::recursive_directory_iterator(yaraSignaturePath)) { - const std::string fileContent = romfs::get(ruleFilePath).data(); + wolv::io::File file(ruleFilePath.path(), wolv::io::File::Mode::Read); + if (!file.isValid()) + continue; - YaraRule yaraRule(fileContent); + YaraRule yaraRule(file.readString()); task.setInterruptCallback([&yaraRule] { yaraRule.interrupt(); });