From 08e5a1088cffa0cd194e6023a366212986cccfe9 Mon Sep 17 00:00:00 2001 From: Mc-muffin <8714476+Mc-muffin@users.noreply.github.com> Date: Wed, 17 Jan 2024 09:16:06 -0500 Subject: [PATCH] fix isotool chunked save blunder --- isotool.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/isotool.py b/isotool.py index d38315e..a73c123 100644 --- a/isotool.py +++ b/isotool.py @@ -227,8 +227,12 @@ def save_iso_files( iso.seek(file.lba) with open(final_path, "wb+") as f: - while data := iso.read(0x80000): - f.write(data) + for _ in range(file.size // SECTOR_SIZE): + f.write(iso.read(SECTOR_SIZE)) + + if (file.size % SECTOR_SIZE) != 0: + f.write(iso.read(file.size % SECTOR_SIZE)) + def check_iso(iso: typing.BinaryIO) -> tuple[bool, int, int]: