1
0
mirror of synced 2025-01-18 09:04:52 +01:00

fix: More provider display issues

This commit is contained in:
WerWolv 2022-08-14 14:45:18 +02:00
parent dea6caccf1
commit 78785ddc3c
6 changed files with 22 additions and 3 deletions

View File

@ -266,7 +266,7 @@ namespace hex::prv {
}
std::pair<Region, bool> Provider::getRegionValidity(u64 address) const {
if (address < this->getActualSize())
if (address > this->getActualSize())
return { Region::Invalid(), false };
bool insideValidRegion = false;

View File

@ -45,6 +45,8 @@ namespace hex::plugin::builtin::prv {
return "hex.builtin.provider.disk";
}
std::pair<Region, bool> getRegionValidity(u64 address) const override;
protected:
void reloadDrives();

View File

@ -49,6 +49,8 @@ namespace hex::plugin::builtin::prv {
return "hex.builtin.provider.gdb";
}
std::pair<Region, bool> getRegionValidity(u64 address) const override;
protected:
hex::Socket m_socket;

View File

@ -357,4 +357,11 @@ namespace hex::plugin::builtin::prv {
this->reloadDrives();
}
std::pair<Region, bool> DiskProvider::getRegionValidity(u64 address) const {
if (address < this->getActualSize())
return { Region { address, this->getActualSize() - address }, true };
else
return { Region::Invalid(), false };
}
}

View File

@ -324,4 +324,11 @@ namespace hex::plugin::builtin::prv {
return Provider::storeSettings(settings);
}
std::pair<Region, bool> GDBProvider::getRegionValidity(u64 address) const {
if (address < this->getActualSize())
return { Region { address, this->getActualSize() - address }, true };
else
return { Region::Invalid(), false };
}
}

View File

@ -221,8 +221,9 @@ namespace hex::plugin::builtin::prv {
std::pair<Region, bool> IntelHexProvider::getRegionValidity(u64 address) const {
auto intervals = this->m_data.findOverlapping(address, address);
if (intervals.empty())
return { Region::Invalid(), false };
if (intervals.empty()) {
return Provider::getRegionValidity(address);
}
auto closestInterval = intervals.front();
for (const auto &interval : intervals) {