Improved byte highlighting
This commit is contained in:
parent
740619529c
commit
be738eb5e7
@ -182,7 +182,7 @@ set_target_properties(imhex PROPERTIES CXX_VISIBILITY_PRESET hidden)
|
||||
target_link_directories(imhex PRIVATE ${CRYPTO_LIBRARY_DIRS} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(imhex libdl.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a libshlwapi.a libcrypto.a libwinpthread.a libcapstone.a LLVMDemangle libimhex ${Python_LIBRARIES})
|
||||
target_link_libraries(imhex libdl.a libmagic.a libgnurx.a libtre.a libintl.a libiconv.a libshlwapi.a libcrypto.a libwinpthread.a libcapstone.a LLVMDemangle libimhex ${Python_LIBRARIES} wsock32 ws2_32)
|
||||
elseif (UNIX)
|
||||
target_link_libraries(imhex magic crypto ${CMAKE_DL_LIBS} capstone LLVMDemangle libimhex ${Python_LIBRARIES} dl)
|
||||
endif()
|
||||
|
@ -183,7 +183,7 @@ namespace hex::lang {
|
||||
|
||||
class PatternDataPadding : public PatternData {
|
||||
public:
|
||||
PatternDataPadding(u64 offset, size_t size) : PatternData(offset, size, 0x00FFFFFF) { }
|
||||
PatternDataPadding(u64 offset, size_t size) : PatternData(offset, size, 0xFF000000) { }
|
||||
|
||||
PatternData* clone() override {
|
||||
return new PatternDataPadding(*this);
|
||||
|
@ -46,22 +46,26 @@ namespace hex {
|
||||
|
||||
for (const auto &[region, name, comment, color] : _this->m_bookmarks) {
|
||||
if (off >= region.address && off < (region.address + region.size))
|
||||
currColor = (color & 0x00FFFFFF) | 0x40000000;
|
||||
currColor = (color & 0x00FFFFFF) | 0x80000000;
|
||||
if ((off - 1) >= region.address && (off - 1) < (region.address + region.size))
|
||||
prevColor = (color & 0x00FFFFFF) | 0x40000000;;
|
||||
prevColor = (color & 0x00FFFFFF) | 0x80000000;
|
||||
}
|
||||
|
||||
if (_this->m_highlightedBytes.contains(off))
|
||||
currColor = _this->m_highlightedBytes[off];
|
||||
if (_this->m_highlightedBytes.contains(off - 1))
|
||||
prevColor = _this->m_highlightedBytes[off - 1];
|
||||
if (_this->m_highlightedBytes.contains(off)) {
|
||||
auto color = (_this->m_highlightedBytes[off] & 0x00FFFFFF) | 0x80000000;
|
||||
currColor = currColor.has_value() ? ImAlphaBlendColors(color, currColor.value()) : color;
|
||||
}
|
||||
if (_this->m_highlightedBytes.contains(off - 1)) {
|
||||
auto color = (_this->m_highlightedBytes[off - 1] & 0x00FFFFFF) | 0x80000000;
|
||||
prevColor = prevColor.has_value() ? ImAlphaBlendColors(color, prevColor.value()) : color;
|
||||
}
|
||||
|
||||
if (next && prevColor != currColor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (currColor.has_value()) {
|
||||
_this->m_memoryEditor.HighlightColor = currColor.value();
|
||||
if (currColor.has_value() && (currColor.value() & 0x00FFFFFF) != 0x00) {
|
||||
_this->m_memoryEditor.HighlightColor = (currColor.value() & 0x00FFFFFF) | 0x40000000;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user