1
0
mirror of synced 2025-01-29 19:17:28 +01:00

fix: Yara rules not being read correctly in data information section

This commit is contained in:
WerWolv 2024-02-27 18:01:30 +01:00
parent 2572e23928
commit 607f7cba8d

View File

@ -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<const char>();
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();
});