From e7f84596810d5ff71ed67e236b5889a5f479de7e Mon Sep 17 00:00:00 2001 From: Psyi Rius <99079175+psyirius@users.noreply.github.com> Date: Sun, 28 Apr 2024 02:14:16 +0530 Subject: [PATCH] fix: bin_stream get_u8 returning bytes --- miasm/core/bin_stream.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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): """