diff --git a/plugins/builtin/source/content/views/view_find.cpp b/plugins/builtin/source/content/views/view_find.cpp index 37d43ba13..8347cc6be 100644 --- a/plugins/builtin/source/content/views/view_find.cpp +++ b/plugins/builtin/source/content/views/view_find.cpp @@ -150,13 +150,15 @@ namespace hex::plugin::builtin { } template - static std::string formatBytes(const std::vector &bytes) { + static std::string formatBytes(const std::vector &bytes, std::endian endian) { if (bytes.size() > sizeof(T)) return { }; T value = 0x00; std::memcpy(&value, bytes.data(), bytes.size()); + value = hex::changeEndianess(value, bytes.size(), endian); + if (std::signed_integral) value = hex::signExtend(bytes.size() * 8, value); @@ -507,16 +509,16 @@ namespace hex::plugin::builtin { result += hex::encodeByteString({ bytes[i] }); break; case Unsigned: - result += formatBytes(bytes); + result += formatBytes(bytes, occurrence.endian); break; case Signed: - result += formatBytes(bytes); + result += formatBytes(bytes, occurrence.endian); break; case Float: - result += formatBytes(bytes); + result += formatBytes(bytes, occurrence.endian); break; case Double: - result += formatBytes(bytes); + result += formatBytes(bytes, occurrence.endian); break; } }