From 168ba2ff9fa23a2dea930455b2b3065f71c15d81 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 5 Dec 2020 11:00:56 +0100 Subject: [PATCH] Denote invalid GUIDs in data inspector Addresses #24 --- source/views/view_data_inspector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/views/view_data_inspector.cpp b/source/views/view_data_inspector.cpp index 95b67e96e..892910bd9 100644 --- a/source/views/view_data_inspector.cpp +++ b/source/views/view_data_inspector.cpp @@ -96,7 +96,8 @@ namespace hex { } #endif - this->m_cachedData.emplace_back("GUID", hex::format("{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}", + this->m_cachedData.emplace_back("GUID", hex::format("%s{%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX}", + (this->m_previewData.guid.data3 >> 12) <= 5 && ((this->m_previewData.guid.data4[0] >> 4) >= 8 || (this->m_previewData.guid.data4[0] >> 4) == 0) ? "" : "[INVALID] ", hex::changeEndianess(this->m_previewData.guid.data1, this->m_endianess), hex::changeEndianess(this->m_previewData.guid.data2, this->m_endianess), hex::changeEndianess(this->m_previewData.guid.data3, this->m_endianess),