1
0
mirror of synced 2024-11-28 17:40:51 +01:00

fix: Yara rules being unable to include files

Fixes #875
This commit is contained in:
WerWolv 2023-01-12 23:29:38 +01:00
parent 1f6acc101f
commit 8d9667c2e0

View File

@ -191,6 +191,7 @@ namespace hex::plugin::builtin {
yr_compiler_destroy(compiler);
};
auto currFilePath = hex::toUTF8String(fs::toShortPath(this->m_rules[this->m_selectedRule].second));
yr_compiler_set_include_callback(
compiler,
[](const char *includeName, const char *, const char *, void *userData) -> const char * {
@ -212,7 +213,7 @@ namespace hex::plugin::builtin {
delete[] ptr;
},
hex::toUTF8String(fs::toShortPath(this->m_rules[this->m_selectedRule].second)).data()
currFilePath.data()
);
fs::File file(this->m_rules[this->m_selectedRule].second, fs::File::Mode::Read);