fix: Parent offset calculation with non-zero base addresses
This commit is contained in:
parent
d097f6ada0
commit
a8ad045248
@ -1529,9 +1529,11 @@ namespace hex::plugin::builtin {
|
|||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
{
|
{
|
||||||
|
const auto provider = ImHexApi::Provider::get();
|
||||||
|
const auto baseAddress = provider != nullptr ? provider->getBaseAddress() : 0x00;
|
||||||
const auto parent = pattern->getParent();
|
const auto parent = pattern->getParent();
|
||||||
const auto parentAddress = parent == nullptr ? 0x00 : parent->getOffset();
|
const auto parentAddress = parent == nullptr ? baseAddress : parent->getOffset();
|
||||||
const auto parentSize = parent == nullptr ? 0x00 : parent->getSize();
|
const auto parentSize = parent == nullptr ? baseAddress : parent->getSize();
|
||||||
const auto patternAddress = pattern->getOffset();
|
const auto patternAddress = pattern->getOffset();
|
||||||
|
|
||||||
if (patternAddress >= parentAddress && patternAddress + pattern->getSize() <= parentAddress + parentSize) {
|
if (patternAddress >= parentAddress && patternAddress + pattern->getSize() <= parentAddress + parentSize) {
|
||||||
|
Loading…
Reference in New Issue
Block a user