fix: Yara rules not being read correctly in data information section
This commit is contained in:
parent
2572e23928
commit
607f7cba8d
@ -29,9 +29,11 @@ namespace hex::plugin::yara {
|
|||||||
void process(Task &task, prv::Provider *provider, Region region) override {
|
void process(Task &task, prv::Provider *provider, Region region) override {
|
||||||
for (const auto &yaraSignaturePath : fs::getDefaultPaths(fs::ImHexPath::YaraAdvancedAnalysis)) {
|
for (const auto &yaraSignaturePath : fs::getDefaultPaths(fs::ImHexPath::YaraAdvancedAnalysis)) {
|
||||||
for (const auto &ruleFilePath : std::fs::recursive_directory_iterator(yaraSignaturePath)) {
|
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] {
|
task.setInterruptCallback([&yaraRule] {
|
||||||
yaraRule.interrupt();
|
yaraRule.interrupt();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user