diff --git a/libs/ImGui/include/imgui_memory_editor.h b/libs/ImGui/include/imgui_memory_editor.h index de81d4edc..d6034e930 100644 --- a/libs/ImGui/include/imgui_memory_editor.h +++ b/libs/ImGui/include/imgui_memory_editor.h @@ -547,6 +547,7 @@ struct MemoryEditor IM_UNUSED(mem_data); ImGuiStyle& style = ImGui::GetStyle(); const char* format_range = OptUpperCaseHex ? "Range %0*" _PRISizeT "X..%0*" _PRISizeT "X" : "Range %0*" _PRISizeT "x..%0*" _PRISizeT "x"; + const char* format_selection = OptUpperCaseHex ? "Selection %0*" _PRISizeT "X..%0*" _PRISizeT "X (%ld %s)" : "Range %0*" _PRISizeT "x..%0*" _PRISizeT "x (%ld %s)"; // Options menu if (ImGui::Button("Options")) @@ -566,6 +567,17 @@ struct MemoryEditor ImGui::SameLine(); ImGui::Text(format_range, s.AddrDigitsCount, base_display_addr, s.AddrDigitsCount, base_display_addr + mem_size - 1); + if (DataPreviewAddr != (size_t)-1 && DataPreviewAddrEnd != (size_t)-1) { + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); + + auto selectionStart = std::min(DataPreviewAddr, DataPreviewAddrEnd); + auto selectionEnd = std::max(DataPreviewAddr, DataPreviewAddrEnd); + + size_t regionSize = (selectionEnd - selectionStart) + 1; + ImGui::Text(format_selection, s.AddrDigitsCount, selectionStart, s.AddrDigitsCount, selectionEnd, regionSize, regionSize == 1 ? "byte" : "bytes"); + } if (GotoAddr != (size_t)-1) { diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index 81b72405c..b76d8cd29 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -109,6 +109,8 @@ namespace hex { if (dataSize != 0x00) { ImGui::Begin("Hex Editor"); ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); ImGui::Text("Page %d / %d", this->m_dataProvider->getCurrentPage() + 1, this->m_dataProvider->getPageCount()); ImGui::SameLine();