1
0
mirror of synced 2025-01-10 21:41:53 +01:00

fix: Off-by-one when calculating hashes of selected regions

Fixes #2046
This commit is contained in:
WerWolv 2025-01-04 00:15:35 +01:00
parent dcd80fe6ad
commit 1c30533d19

View File

@ -23,7 +23,7 @@ namespace hex::plugin::hashes {
reader.seek(region.getStartAddress());
reader.setEndAddress(region.getEndAddress());
for (u64 address = region.getStartAddress(); address < region.getEndAddress(); address += 1_MiB) {
for (u64 address = region.getStartAddress(); address <= region.getEndAddress(); address += 1_MiB) {
u64 readSize = std::min<u64>(1_MiB, (region.getEndAddress() - address) + 1);
auto data = reader.read(address, readSize);