Skip to content

Commit

Permalink
fix: Yara rules not being read correctly in data information section
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Feb 27, 2024
1 parent 2572e23 commit 607f7cb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down

0 comments on commit 607f7cb

Please sign in to comment.