From dd446d5a621e603cdfd4588b01c8ba3406c22f0f Mon Sep 17 00:00:00 2001 From: Stewie Date: Sat, 2 Jul 2022 14:22:55 -0400 Subject: [PATCH] Adjust peek operation --- ToolsTales.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ToolsTales.py b/ToolsTales.py index 07a595a..90ed281 100644 --- a/ToolsTales.py +++ b/ToolsTales.py @@ -509,20 +509,25 @@ class ToolsTales: elif b in (0x13, 0x17, 0x1A): tag_name = f"unk{b:02X}" hex_value = "" - while fileRead.peek(1)[:1] != b"\x80": + + while fileRead.read(1) != b"\x80": + fileRead.seek(fileRead.tell()-1) mark = fileRead.read(1) hex_value += mark.hex() if mark == "\x38": hex_value += f"{struct.unpack('