From c2d1589e74f51842ea38d91b5786edf5c3d72d44 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 5 Dec 2021 21:54:09 +0100 Subject: [PATCH] patterns: Fixed variable access inside pointer pattern yielding invalid results --- plugins/libimhex/include/hex/pattern_language/ast_node.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/libimhex/include/hex/pattern_language/ast_node.hpp b/plugins/libimhex/include/hex/pattern_language/ast_node.hpp index 86f7b9381..f3bd9192e 100644 --- a/plugins/libimhex/include/hex/pattern_language/ast_node.hpp +++ b/plugins/libimhex/include/hex/pattern_language/ast_node.hpp @@ -1090,13 +1090,13 @@ namespace hex::pl { offset = evaluator->dataOffset(); { - auto pointedAtPattern = this->m_type->createPatterns(evaluator).front(); - u128 pointerAddress = 0; evaluator->getProvider()->read(pattern->getOffset(), &pointerAddress, pattern->getSize()); pointerAddress = hex::changeEndianess(pointerAddress, sizePattern->getSize(), sizePattern->getEndian()); - pointedAtPattern->setOffset(pointerAddress); + evaluator->dataOffset() = pointerAddress; + + auto pointedAtPattern = this->m_type->createPatterns(evaluator).front(); pattern->setPointedAtPattern(pointedAtPattern); pattern->setEndian(sizePattern->getEndian());