From 4e0a93fc20662e8db3ac2b6c281832c6a6dcdfd9 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 27 Dec 2023 01:05:34 +0100 Subject: [PATCH] fix: MemoryProvider not having any valid regions --- lib/libimhex/include/hex/providers/memory_provider.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/libimhex/include/hex/providers/memory_provider.hpp b/lib/libimhex/include/hex/providers/memory_provider.hpp index ff24727b8..594fa3788 100644 --- a/lib/libimhex/include/hex/providers/memory_provider.hpp +++ b/lib/libimhex/include/hex/providers/memory_provider.hpp @@ -36,6 +36,14 @@ namespace hex::prv { [[nodiscard]] std::string getTypeName() const override { return "MemoryProvider"; } + std::pair getRegionValidity(u64 address) const { + address -= this->getBaseAddress(); + + if (address < this->getActualSize()) + return { Region { this->getBaseAddress() + address, this->getActualSize() - address }, true }; + else + return { Region::Invalid(), false }; + } private: void renameFile();