patterns: Potentially fix issues with nested pointers with custom base addresses
Closes #367
This commit is contained in:
parent
490eaef5c1
commit
f45cc3fc73
plugins/libimhex/include/hex/pattern_language
@ -1138,6 +1138,8 @@ namespace hex::pl {
|
|||||||
auto pattern = new PatternDataPointer(offset, sizePattern->getSize(), evaluator);
|
auto pattern = new PatternDataPointer(offset, sizePattern->getSize(), evaluator);
|
||||||
pattern->setVariableName(this->m_name);
|
pattern->setVariableName(this->m_name);
|
||||||
|
|
||||||
|
applyVariableAttributes(evaluator, this, pattern);
|
||||||
|
|
||||||
offset = evaluator->dataOffset();
|
offset = evaluator->dataOffset();
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1155,8 +1157,6 @@ namespace hex::pl {
|
|||||||
|
|
||||||
evaluator->dataOffset() = offset;
|
evaluator->dataOffset() = offset;
|
||||||
|
|
||||||
applyVariableAttributes(evaluator, this, pattern);
|
|
||||||
|
|
||||||
return { pattern };
|
return { pattern };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,12 +440,14 @@ namespace hex::pl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void rebase(u64 base) {
|
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;
|
this->m_pointerBase = base;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PatternData *m_pointedAt;
|
PatternData *m_pointedAt = nullptr;
|
||||||
u64 m_pointerBase = 0;
|
u64 m_pointerBase = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user