From 1aa21b8a2d5986c24257efbee9c329f728db4356 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 23 May 2021 22:52:09 +0200 Subject: [PATCH] ui: Display correct offsets in hex editor header when base address is not aligned --- external/ImGui/include/imgui_memory_editor.h | 2 +- source/views/view_hexeditor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/ImGui/include/imgui_memory_editor.h b/external/ImGui/include/imgui_memory_editor.h index b0108f84d..05eb8c035 100644 --- a/external/ImGui/include/imgui_memory_editor.h +++ b/external/ImGui/include/imgui_memory_editor.h @@ -272,7 +272,7 @@ struct MemoryEditor if (OptMidColsCount > 0) byte_pos_x += (float)(i / OptMidColsCount) * s.SpacingBetweenMidCols; ImGui::SameLine(byte_pos_x); - ImGui::Text("%02X", i); + ImGui::Text("%02llX", i + (base_display_addr % Cols)); } ImGui::EndChild(); diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index 1017d9ccd..e9561e382 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -144,7 +144,7 @@ namespace hex { u64 start = region.address; this->m_memoryEditor.GotoAddrAndSelect(start - provider->getBaseAddress(), start + region.size - provider->getBaseAddress() - 1); } - + EventManager::post(Region { this->m_memoryEditor.DataPreviewAddr, (this->m_memoryEditor.DataPreviewAddrEnd - this->m_memoryEditor.DataPreviewAddr) + 1}); });