From abb6966add9a013f0bbe52c84a5da30ca568932e Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Thu, 18 Jun 2020 13:14:32 -0400 Subject: support for big-endian values in structureddataviews --- python/binaryview.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index e78bc4aa..6b6adffc 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -5960,10 +5960,11 @@ class BinaryWriter(object): core.BNSeekBinaryWriterRelative(self.handle, offset) class StructuredDataValue(object): - def __init__(self, type, address, value): + def __init__(self, type, address, value, endian): self._type = type self._address = address self._value = value + self._endian = endian def __str__(self): decode_str = "{}B".format(self._type.width) @@ -5974,13 +5975,25 @@ class StructuredDataValue(object): def __int__(self): if self._type.width == 1: - code = "B" + if self._endian == Endianness.LittleEndian: + code = "