clalancette / pycdlib

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

Error extracting data from Windows/Parted Magic ISOs #23

Closed clalancette closed 4 years ago

clalancette commented 5 years ago

@amlamarra This is the second issue split out of #21

pycdlib-extract-files can give an error on certain other ISOs. This is seen on Windows install ISOs for older versions (which are hard to find anymore) and for the latest free version of "Parted Magic" (pmagic_2013_08_01.iso), which you can get from here: https://www.majorgeeks.com/files/details/parted_magic.html The error I get:

(venv) andrew ~/iso $ ./pycdlib-extract-files.py pmagic_2013_08_01.iso
Opening pmagic_2013_08_01.iso
Traceback (most recent call last):
  File "./pycdlib-extract-files.py", line 107, in <module>
    sys.exit(main())
  File "./pycdlib-extract-files.py", line 59, in main
    iso.open(args.iso)
  File "/usr/local/lib/python3.5/dist-packages/pycdlib/pycdlib.py", line 4041, in open
    self._open_fp(fp)
  File "/usr/local/lib/python3.5/dist-packages/pycdlib/pycdlib.py", line 2511, in _open_fp
    self._parse_udf_descriptors()
  File "/usr/local/lib/python3.5/dist-packages/pycdlib/pycdlib.py", line 2192, in _parse_udf_descriptors
    anchor_tag.parse(anchor_data, extent)
  File "/usr/local/lib/python3.5/dist-packages/pycdlib/udf.py", line 560, in parse
    raise pycdlibexception.PyCdlibInvalidISO('Tag version not 2 or 3')
pycdlib.pycdlibexception.PyCdlibInvalidISO: Tag version not 2 or 3
clalancette commented 5 years ago

Yeah, I see what you mean.

The UDF support in pycdlib is the newest part and doesn't have nearly as much real world testing as the rest. In this case, the UDF filesystem is structured in a way I haven't seen before, and hence it doesn't understand it. Likely this will be fixed when I fix #19, but I'll leave this open just in case.

amlamarra commented 5 years ago

So I git cloned the latest version of everything and I'm not getting that Tag version not 2 or 3 error on Windows 10 ISOs like I was before (still happening with PartedMagic). But now it's saying 'UDFFileEntry' object has no attribute 'rock_ridge'. I'm letting it use the "auto" mode for path-type and I guess it's selecting UDF.

andrew ~/iso $ ./pycdlib-extract-files -extract-to win10/ Windows_10_Enterprise_EVAL_en-us.iso
Opening Windows_10_Enterprise_EVAL_en-us.iso
Using path type of 'udf_path'

autorun.inf
Traceback (most recent call last):
  File "./pycdlib-extract-files", line 126, in <module>
    sys.exit(main())
  File "./pycdlib-extract-files", line 118, in main
    if dir_record.rock_ridge is None or not dir_record.rock_ridge.is_symlink():
AttributeError: 'UDFFileEntry' object has no attribute 'rock_ridge'
clalancette commented 5 years ago

So I git cloned the latest version of everything and I'm not getting that Tag version not 2 or 3 error on Windows 10 ISOs like I was before (still happening with PartedMagic). But now it's saying 'UDFFileEntry' object has no attribute 'rock_ridge'. I'm letting it use the "auto" mode for path-type and I guess it's selecting UDF.

By the way, this particular issue should be solved by 8afbab4432ef7f497118c273e6e202e589cc04a6 that I pushed last night.

I have been (slowly) working on the overall UDF only support, and I have made some progress. Right now, I can open up the partition magic UDF ISO successfully. But I still can't write it back up or create new ones, and I need to write tests. So there's still a bunch of work to get this finished.

clalancette commented 4 years ago

I believe that this particular issue is now fixed in the latest release. At least, I can now extract data from the Partition Magic ISO without errors.

I'm going to close this out. Please feel free to reopen if you find this still doesn't work for you.

Thanks for the bug report.