Menu

#389 UDF 2.50 Support

open
nobody
None
5
2022-07-12
2022-06-19
No

Hi,

I have made some changes to 7-zip in order to support UDF 2.50.

The most interesting part is the support for a metadata partition, which resides inside another partition. A metadata partition is indicated by a partition map of type 2. Whenever we encounter such mapping, we dynamically add another partition to the partitions array in order to represent that metadata partition correctly. Then, the partition reference to it works as it should (rather than incorrectly reference the containing partition as before).

I generated some simple test images using CDBurnerXP and successfully handled them using my modified version of 7-zip.

I was even able to open the UDF 2.60 test image, but as far as I know, it doesn't exhibit any unique UDF 2.60 features.

I attach my patches, together with my test files.
I'm absolutely not UDF nor 7-zip expert, but I hope this is indeed useful.
Thank you for this wonderful project, keep up the good work!

Regards,
Rom

3 Attachments

Discussion

  • Igor Pavlov

    Igor Pavlov - 2022-06-20

    What specifcation document describes these things?

    pm.MetadataPartitionPos = Get32(buf + pos + 40);
    
     
  • Rom Cyncynatus

    Rom Cyncynatus - 2022-06-21

    Thanks for taking the time in going over this!

    See here: http://www.osta.org/specs/pdf/udf260.pdf

    Section 2.2.10, Metadata Partition Map.
    Offset 40 is Metadata File Location.

    Metadata File Location = address of the block containing the File Entry for the Metadata File.
    This address shall be interpreted as a logical block number within the physical or sparable
    partition associated with this Partition Map (see above “Partition Number” field).

    Section 2.2.13, Metadata Partition.
    Everything being accessed in the metadata partition should be treated as an offset into the metadata file and its ADs.

    The Extent Location field of any Allocation Descriptor referencing data recorded in the
    Metadata Partition shall be interpreted as a block offset into the Metadata File. For
    example logical block 40 in the Metadata Partition corresponds to byte offset (40 * logical block size) in the Metadata File, which in turn (through the Allocation
    Descriptors for the Metadata File) corresponds to some logical block in the associated
    physical/sparable partition

    Again, I'm not an expert. I embarked on this endeavor as an attempt to be able to handle some sample files I encountered. I may be inaccurate or even wrong. In fact, when reading the docs now, I see that Partition Map of type 2 actually divides into 3 types - Virtual Partition Map, Sparable Partition Map and Metadata Partition Map. They can be differentiated by the Partition Type Identifier field (offset 4). It probably would have been wise to verify that we are indeed dealing with a metadata partition by checking this field, even without supporting the other types.

    Regards,
    Rom

     
  • Rom Cyncynatus

    Rom Cyncynatus - 2022-07-04

    Hi again @ipavlov, I have updated the patches so I upload here the new ones. Here are the main changes compared to the previous patches:

    • Parse metadata partition file using the CItem class (moved relevant parsing code inside CItem). This should make metadata partition file parsing more robust than before.
    • Validate that the metadata partition file is not fragmented, instead of implicitly assuming so as before. As far as I can tell, this assumption should mostly hold true. Otherwise, it is required to implement a mechanism to read the metadata partition file when accessing such a partition, which I find unnecessary at this point.
    • Ensure that a partition mapping of type 2 is indeed a metadata one, rather than another type 2 mapping. Other type 2 mappings are not currently implemented.
    • Rebase changes over 7-Zip 22.00 sources.
    • Work on CRLF line-ending source files so patches should now apply without errors.

    I moved a little bit of code around so the total diff size has unfortunately increased. However, I think that the final result is preferable. Let me know if you have any questions.

    Regards,
    Rom

     
  • Igor Pavlov

    Igor Pavlov - 2022-07-12

    I've changed my code to support such files.
    But that new code is not directly from your patches, but it's similar.
    So please wait next version of 7-Zip for additional checks and tests.
    Thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.