mirror of https://github.com/WerWolv/ImHex.git
patterns: Potentially fix issues with nested pointers with custom base addresses
Closes #367
This commit is contained in:
parent
490eaef5c1
commit
f45cc3fc73
|
@ -1138,6 +1138,8 @@ namespace hex::pl {
|
|||
auto pattern = new PatternDataPointer(offset, sizePattern->getSize(), evaluator);
|
||||
pattern->setVariableName(this->m_name);
|
||||
|
||||
applyVariableAttributes(evaluator, this, pattern);
|
||||
|
||||
offset = evaluator->dataOffset();
|
||||
|
||||
{
|
||||
|
@ -1155,8 +1157,6 @@ namespace hex::pl {
|
|||
|
||||
evaluator->dataOffset() = offset;
|
||||
|
||||
applyVariableAttributes(evaluator, this, pattern);
|
||||
|
||||
return { pattern };
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue