Menu

#201 7zip failed to open some ISO files made by PowerISO

v1.0 (example)
open
my p7zip
None
3
2017-12-05
2017-11-22
aXqd
No

In "Volume Descriptor", we have two fields called “Expiration Date & Time” and “Effective Date & Time”.
In most cases, these two fields are not in-use, hence not specified.

However, in this case, PowerISO could fill them up with 0x20 (a.k.a. a white space) instead of ‘0’ or 0x0, which causes 7zip to throw with a CHeaderErrorException.

Possible fix as below:

$ diff ~/IsoIn.cpp p7zip_16.02/CPP/7zip/Archive/Iso/IsoIn.cpp
187c187,189
<       if (b == 0) // it's bug in some CD's
---
>       // If `volume modification or expiration datetime` is not specified in `volume descriptor`,
>       // all bytes filled by PowerISO could be 0x20 instead.
>       if (b == 0 || b == 32) // it's bug in some CD's

Parsed sample as below:

01                                                (type code - primary volume descriptor)
43 44 30 30 31                                    (standard identifier - CD001)
01                                                (version - 01)
00                                                (unused)
57 69 6e 33 32 20 20 20                                                                      |.CD001..Win32   |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20                           (system identifier - Win32)
32 30 31 37 30 39 31 31                                                                      |        20170911|
30 37 33 35 20 20 20 20  20 20 20 20 20 20 20 20                                             |0735            |
20 20 20 20 20 20 20 20                           (volume identifier - 201709110735)
00 00 00 00 00 00 00 00                           (zeros)                                    |        ........|
32 01 00 00 00 00 01 32                           (volume space size - 306)
00 00 00 00 00 00 00 00                                                                      |2......2........|
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00                                             |................|
00 00 00 00 00 00 00 00                           (escape sequence - all zeros)
01 00 00 01                                       (volume set size - 1)
01 00 00 01                                       (volume sequence number - 1)               |................|
00 08 08 00                                       (logical block size - 2048)
0a 00 00 00  00 00 00 0a                          (path table size - 10)
14 00 00 00                                       (LPathTableLocation - 20)                  |................|
00 00 00 00                                       (LOptionalPathTableLocation - 0)
00 00 00 16                                       (MPathTableLocation - 22)
00 00 00 00                                       (MOptionalPathTableLocation - 0)
--------------- root directory record ---------------
22                                                (length - 34)
00                                                (extended attribute record len - 0)
1c 00                                                                                        |............"...|
00 00 00 00 00 1c                                 (extent location - 28)
00 08  00 00 00 00 08 00                          (size - 2048)
75                                                (recording datetime - year      - 117)
09                                                (recording datetime - month     - 9  )     |..............u.|
0b                                                (recording datetime - day       - 11 )
07                                                (recording datetime - hour      - 7  )
23                                                (recording datatime - minute    - 35 )
08                                                (recording datetime - seconds   - 8  )
04                                                (recording datetime - gmtoffset - 4  )
02                                                (file flags - 2
00                                                (file unit size - 0)
00                                                (interleave gap size - 0)
01 00 00 01                                       (volume sequence number - 1)
01                                                (file id length - 1)
00                                                (file id with zero padding)
--------------- end of root directory record ---------------
20 20                                                                                        |..#...........  |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20        (volume set identifier)
20 20                                                                                        |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20        (publisher id)
20 20                                                                                        |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20        (data preparer id)
50 6f                                                                                        |              Po|
77 65 72 49 53 4f 20 20  20 20 20 20 20 20 20 20                                             |werISO          |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20        (application identifier - PowerISO)
20 20                                                                                        |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20                                       (copyright file id)
20 20 20 20              20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20                           (abstract file id)
20 20 20 20 20 20 20 20                                                                      |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20 20 20 20 20 20 20 20  20 20 20 20 20           (bibliographic file id)
32 30 31                                                                                     |             201|
37                                                (volume creation     - year   - 2017)
30 39                                             (volume creation     - month  - 9   )
31 31                                             (volume creation     - day    - 11  )
30 37                                             (volume creation     - hour   - 7   )
33 35                                             (volume creation     - min    - 35  )
30 38                                             (volume creation     - sec    - 8   )
30 30                                             (volume creation     - hund   - 0   )
04                                                (volume creation     - offset - 4   )
32 30                                                                                        |7091107350800.20|
31 37                                             (volume modification - year   - 2017)
30 39                                             (volume modification - month  - 9   )
31 31                                             (volume modification - day    - 11  )
30 37                                             (volume modification - hour   - 7   )
33 35                                             (volume modification - min    - 35  )
30 38                                             (volume modification - sec    - 8   )
30 30                                             (volume modification - hund   - 0   )
04                                                (volume modification - offset - 4   )
20                                                                                           |17091107350800. |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  (volume expiration datetime)               |                |
20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20                                             |                |
20                                                (volume effective  datetime)
01                                                (file structure version - 1)
00                                                (unused - 0)
20 20 20 20 20  20 20 20 20 20 20 20 20                                                      | ..             |

Discussion

  • aXqd

    aXqd - 2017-11-22

    Command line output as below:

    $ 7z x test.iso
    
    7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
    p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz (306F2),ASM,AES-NI)
    
    Scanning the drive for archives:
    1 file, 626688 bytes (612 KiB)
    
    Extracting archive: test.iso
    ERROR: test.iso
    Can not open the file as archive
    
    
    Can't open as archive: 1
    Files: 0
    Size:       0
    Compressed: 0
    
     
  • aXqd

    aXqd - 2017-11-22

    Output after the fix:

    $ p7zip_16.02/bin/7z x test.iso
    
    7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
    p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU x64)
    
    Scanning the drive for archives:
    1 file, 626688 bytes (612 KiB)
    
    Extracting archive: test.iso
    --
    Path = test.iso
    Type = Iso
    Physical Size = 626688
    Created = 2017-09-11 06:35:08
    Modified = 2017-09-11 06:35:08
    
    Everything is Ok
    
    Size:       565248
    Compressed: 626688
    
     
  • Igor Pavlov

    Igor Pavlov - 2017-11-22

    Please attach example of such "bad" iso file.

     
  • aXqd

    aXqd - 2017-12-05

    sorry. I cannot share the original iso files, and we do get many cases like this.
    the partial dump above is the exact output of 'hexdump' against the sample.

    I tried to use the latest version of PowerISO to generate a new file, but it does not have this issue anymore. my best guess is that this only happens to ealier versions of PowerISO, which I don't have access to.

     
  • Igor Pavlov

    Igor Pavlov - 2017-12-05

    OK.
    I'll fix it in next version of 7-Zip.
    Thanks!

     

Log in to post a comment.