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

fix: Yara rule matching not working properly with non-zero base addresses

This commit is contained in:
WerWolv 2024-02-25 00:16:14 +01:00
parent d51b065723
commit afede0ff9c

View File

@ -182,7 +182,7 @@ namespace hex::plugin::yara {
iterator->last_error = ERROR_SUCCESS;
context.currBlock.base = address;
context.currBlock.size = std::min<size_t>(context.region.size - address, 10_MiB);
context.currBlock.size = std::min<size_t>(context.region.size - (address - context.region.address), 10_MiB);
context.currBlock.context = &context;
if (context.currBlock.size == 0) return nullptr;