diff --git a/plugins/builtin/source/content/main_menu_items.cpp b/plugins/builtin/source/content/main_menu_items.cpp index baf5ee8cd..7cb26ff63 100644 --- a/plugins/builtin/source/content/main_menu_items.cpp +++ b/plugins/builtin/source/content/main_menu_items.cpp @@ -200,7 +200,7 @@ namespace hex::plugin::builtin { auto selection = ImHexApi::HexEditor::getSelection(); for (u64 address = selection->getStartAddress(); address <= selection->getEndAddress(); address += bytes.size()) { - bytes.resize(std::min(bytes.size(), selection->getEndAddress() - address)); + bytes.resize(std::min(bytes.size(), selection->getEndAddress() - address + 1)); provider->read(address, bytes.data(), bytes.size()); outputFile.writeVector(bytes);