From bdde77f6ba84c28c1974345eea42aa270bfbbf9f Mon Sep 17 00:00:00 2001 From: Mc-muffin <8714476+Mc-muffin@users.noreply.github.com> Date: Thu, 18 Jan 2024 04:46:54 -0500 Subject: [PATCH] isotool fixes Fixed errata on directory record seeking and added detection for records bigger than a sector. Fixes Rockman X7 not working and Dual Layer images not dumping folders beyond the first one --- isotool.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/isotool.py b/isotool.py index 234e6e6..2fdd85f 100644 --- a/isotool.py +++ b/isotool.py @@ -5,7 +5,7 @@ from pathlib import Path from dataclasses import dataclass, field from typing import BinaryIO -SCRIPT_VERSION = "1.5" +SCRIPT_VERSION = "1.6" SECTOR_SIZE = 0x800 READ_CHUNK = 0x50_0000 # 5MiB SYSTEM_AREA_SIZE = 0x10 * SECTOR_SIZE @@ -171,12 +171,23 @@ def dump_dir_records(iso: BinaryIO, pvd_loc: int, pvd_off: int) -> FileListInfo: # Otherwise keep reading the previous one record_ends.pop() path_parts.pop() - iso.seek(record_pos.pop() + pvd_off) + iso.seek(record_pos.pop()) continue # Parse the record inode = iso.tell() + dr_len = struct.unpack("