patterns: Potentially fix issues with nested pointers with custom base addresses

Closes #367
This commit is contained in:
WerWolv
2021-12-31 11:05:02 +01:00
parent 490eaef5c1
commit f45cc3fc73
2 changed files with 6 additions and 4 deletions

View File

@@ -440,12 +440,14 @@ namespace hex::pl {
}
void rebase(u64 base) {
this->m_pointedAt->setOffset((this->m_pointedAt->getOffset() - this->m_pointerBase) + base);
if (this->m_pointedAt != nullptr)
this->m_pointedAt->setOffset((this->m_pointedAt->getOffset() - this->m_pointerBase) + base);
this->m_pointerBase = base;
}
private:
PatternData *m_pointedAt;
PatternData *m_pointedAt = nullptr;
u64 m_pointerBase = 0;
};