Update segafs/makesegafs.py

This commit is contained in:
beerpsi 2024-07-22 05:35:26 +00:00
parent fc8b5dc3d8
commit fcde905a13

View File

@ -129,7 +129,7 @@ BootID = Struct(
"derive_iv" / Int8ul,
"game_id" / Bytes(4),
"game_timestamp" / Timestamp,
"game_version" / IfThenElse(lambda ctx: ctx.type == 0x0201, Bytes(4), Version),
"game_version" / IfThenElse(lambda ctx: ctx.type == 0x02, Bytes(4), Version),
"block_count" / Int64ul,
"block_size" / Int64ul,
"header_block_count" / Int64ul,
@ -149,7 +149,7 @@ def get_page_iv(iv: bytes, offset: int):
iv = secrets.token_bytes(16)
if BOOTID["type"] == 0x0201:
if BOOTID["type"] == 0x02:
iv = bytes(x ^ EXFAT_HEADER[i] ^ OPTION_IV[i] for (i, x) in enumerate(iv))
print(f"Generated IV: {iv.hex()}")