diff --git a/.gitignore b/.gitignore index 71b1c9799..aff1588fa 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,8 @@ .idea/ cmake-build-debug/ - cmake-build-release/ +cmake-build-relwithdebinfo/ build-linux/ build/ diff --git a/external/ImGui/include/imgui_memory_editor.h b/external/ImGui/include/imgui_memory_editor.h index 05eb8c035..56c8c305f 100644 --- a/external/ImGui/include/imgui_memory_editor.h +++ b/external/ImGui/include/imgui_memory_editor.h @@ -161,6 +161,8 @@ struct MemoryEditor GotoAddr = addr_min; DataPreviewAddr = addr_min; DataPreviewAddrEnd = addr_max; + DataPreviewAddrOld = addr_min; + DataPreviewAddrEndOld = addr_max; } struct Sizes @@ -722,8 +724,6 @@ struct MemoryEditor ImGui::BeginChild("##scrolling"); ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + (GotoAddr / Cols) * ImGui::GetTextLineHeight()); ImGui::EndChild(); - DataEditingAddr = DataPreviewAddr = HighlightMin; - DataPreviewAddrEnd = HighlightMax; } GotoAddr = (size_t)-1; } diff --git a/source/views/view_information.cpp b/source/views/view_information.cpp index 0d7cf533f..8923b4653 100644 --- a/source/views/view_information.cpp +++ b/source/views/view_information.cpp @@ -73,6 +73,7 @@ namespace hex { std::vector buffer(this->m_blockSize, 0x00); std::memset(this->m_valueCounts.data(), 0x00, this->m_valueCounts.size() * sizeof(u32)); this->m_blockEntropy.clear(); + this->m_valueCounts.fill(0); for (u64 i = 0; i < provider->getSize(); i += this->m_blockSize) { std::array blockValueCounts = { 0 }; @@ -216,7 +217,9 @@ namespace hex { ImPlot::PlotLine("##entropy_line", this->m_blockEntropy.data(), this->m_blockEntropy.size()); if (ImPlot::DragLineX("Position", &this->m_entropyHandlePosition, false)) { - EventManager::post( Region{ u64(this->m_entropyHandlePosition * this->m_blockSize) + provider->getBaseAddress(), 1 }); + u64 address = u64(this->m_entropyHandlePosition * this->m_blockSize) + provider->getBaseAddress(); + address = std::min(address, provider->getBaseAddress() + provider->getSize() - 1); + EventManager::post( Region{ address, 1 }); } ImPlot::EndPlot();