clalancette / pycdlib

Python library to read and write ISOs
GNU Lesser General Public License v2.1
143 stars 38 forks source link

Parsing ISO images created with 'makeps3iso' fails #99

Closed sahlberg closed 2 years ago

sahlberg commented 2 years ago

Parsing an iso created usign the tool 'makeps3iso' fails with the exception : Traceback (most recent call last): File "/data/sahlberg/pop-fe/./ps3discid.py", line 23, in iso.open(path) File "/home/sahlberg/.local/lib/python3.10/site-packages/pycdlib/pycdlib.py", line 4123, in open self._open_fp(fp) File "/home/sahlberg/.local/lib/python3.10/site-packages/pycdlib/pycdlib.py", line 2255, in _open_fp self._parse_volume_descriptors() File "/home/sahlberg/.local/lib/python3.10/site-packages/pycdlib/pycdlib.py", line 635, in _parse_volume_descriptors vdst.parse(vd, curr_extent) File "/home/sahlberg/.local/lib/python3.10/site-packages/pycdlib/headervd.py", line 1036, in parse raise pycdlibexception.PyCdlibInvalidISO('Invalid VDST version') pycdlib.pycdlibexception.PyCdlibInvalidISO: Invalid VDST version

It turns out this too sets VDST version to 0, but pycdlib only accepts 1. I do not know if this is a bug in makeps3iso and this field MUST be set to 1, if so then I can open a bug with makeps3iso.

For me, I changed headervd.py to instead use the check :

if version != 1 and version != 0: raise pycdlibexception.PyCdlibInvalidISO('Invalid VDST version')

and then my tool can open and read these ISO images.

clalancette commented 2 years ago

Sorry for the very long delay in answering you here.

I took a look at makep3iso, and that program does indeed have a bug. Version Descriptor Set Terminators (VDST) are defined by ISO to have a version of always equal to 0x1. So I'd encourage you to open a bug with https://github.com/bucanero/ps3iso-utils , since that is the proper place to fix it.

Nonetheless, pycdlib aims to be as compatible as possible, so I've also put a workaround into it so that it will accept ISOs with a VDST of 0x0. That is in 37233f30e80613b7624fca90b83f7ff56a29bd54 .

So with that, I'm going to close this out. Thanks for the bug report!