diff --git a/miasm/core/bin_stream.py b/miasm/core/bin_stream.py index 9224053f7..46165d49a 100644 --- a/miasm/core/bin_stream.py +++ b/miasm/core/bin_stream.py @@ -124,7 +124,10 @@ def get_u8(self, addr, endianness=None): if endianness is None: endianness = self.endianness data = self.getbytes(addr, 1) - return data + if endianness == LITTLE_ENDIAN: + return upck8le(data) + else: + return upck8be(data) def get_u16(self, addr, endianness=None): """