From 1c30533d199d70de18c225c01e302f75f2468aa2 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 4 Jan 2025 00:15:35 +0100 Subject: [PATCH] fix: Off-by-one when calculating hashes of selected regions Fixes #2046 --- plugins/hashes/source/content/hashes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hashes/source/content/hashes.cpp b/plugins/hashes/source/content/hashes.cpp index a551aaec9..abebc96e6 100644 --- a/plugins/hashes/source/content/hashes.cpp +++ b/plugins/hashes/source/content/hashes.cpp @@ -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(1_MiB, (region.getEndAddress() - address) + 1); auto data = reader.read(address, readSize);