mirror of https://github.com/WerWolv/ImHex.git
patterns: Added support for changing pointer endian
This commit is contained in:
parent
cd89b55f5b
commit
1f250e87a3
|
@ -692,6 +692,7 @@ namespace hex::pl {
|
||||||
if (auto pointerPattern = dynamic_cast<PatternDataPointer*>(pattern)) {
|
if (auto pointerPattern = dynamic_cast<PatternDataPointer*>(pattern)) {
|
||||||
u128 value = 0;
|
u128 value = 0;
|
||||||
evaluator->getProvider()->read(pattern->getOffset(), &value, pattern->getSize());
|
evaluator->getProvider()->read(pattern->getOffset(), &value, pattern->getSize());
|
||||||
|
value = hex::changeEndianess(value, pattern->getSize(), pattern->getEndian());
|
||||||
|
|
||||||
auto result = function.func(evaluator, { value });
|
auto result = function.func(evaluator, { value });
|
||||||
|
|
||||||
|
@ -1088,9 +1089,12 @@ namespace hex::pl {
|
||||||
|
|
||||||
u128 pointerAddress = 0;
|
u128 pointerAddress = 0;
|
||||||
evaluator->getProvider()->read(pattern->getOffset(), &pointerAddress, pattern->getSize());
|
evaluator->getProvider()->read(pattern->getOffset(), &pointerAddress, pattern->getSize());
|
||||||
|
pointerAddress = hex::changeEndianess(pointerAddress, sizePattern->getSize(), sizePattern->getEndian());
|
||||||
|
|
||||||
pointedAtPattern->setOffset(pointerAddress);
|
pointedAtPattern->setOffset(pointerAddress);
|
||||||
|
|
||||||
pattern->setPointedAtPattern(pointedAtPattern);
|
pattern->setPointedAtPattern(pointedAtPattern);
|
||||||
|
pattern->setEndian(sizePattern->getEndian());
|
||||||
}
|
}
|
||||||
|
|
||||||
evaluator->dataOffset() = offset;
|
evaluator->dataOffset() = offset;
|
||||||
|
|
Loading…
Reference in New Issue