From aa1a19d675f55d82d5b92e0a4d97a06bae57480b Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Sat, 27 Jul 2024 13:43:07 +1000 Subject: [PATCH] moved struct.pack to struct.unpack --- src/ccsaveparser.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/ccsaveparser.py b/src/ccsaveparser.py index 1c17232..ede4f2f 100644 --- a/src/ccsaveparser.py +++ b/src/ccsaveparser.py @@ -8,9 +8,10 @@ import struct class OFFSETS: VERSION = 0x42e - KEYS_LABEL = 0x12DB - KEYS_VALUE = 0x12F9 - ACCOUNT_LEVEL = 0x12AD + KEYS_LABEL = 0x12DB # These are not static + KEYS_VALUE = 0x12F9 # These are not static + ACCOUNT_LEVEL = 0x12AD # These are not static + START_OF_OPTIONS = 0x42a # This appears to be static across multiple saves def _bytes_to_string(bytes): @@ -36,8 +37,10 @@ def get_key_value(save): def verify_save(save): try: - struct.pack("bbbb", *save[:4]) == b"GVAS" - token = _bytes_to_string(read_token_at_offset(save, OFFSETS.VERSION)) + struct.unpack("