saramibreak / DiscImageCreator

This is the disc (CD, GD, DVD, HD-DVD, BD, GC/Wii, XBOX, XBOX 360) and disk (Floppy, MO, USB etc) image creation tool
http://forum.redump.org/topic/10483/discimagecreator/
Apache License 2.0
538 stars 46 forks source link

Joliet identifiers in `_volDesc.txt` are incorrect. #273

Closed maxz closed 5 months ago

maxz commented 5 months ago

Version 64 bit, AnsiBuild, 20240401T222316

Describe the bug DIC decodes the bytes for the Joliet identifiers incorrectly. I mostly looked at the Volume Identifier and that was wrong across several discs I checked. It seems to log every first character. The software isoinfo also extracts it incorrectly, if that is of any help to you (Maybe you based your implementation on theirs.)

Three examples: Disc Bytes 40-72 of the Joliet SVD (encoded as hex) UCS-2BE decoded (w/o trailing spaces) DIC log
Command & Conquer: Teil 3: Operation Tiberian Sun: Feuersturm 00 46 00 49 00 52 00 45 00 53 00 54 00 4F 00 52 00 4D 00 20 00 20 00 20 00 20 00 20 00 20 00 20 FIRESTORM FRSOM
Computer Bild Spiele 2000-06 00 54 00 62 00 72 00 69 00 67 00 61 00 64 00 65 00 00 00 20 00 20 00 20 00 20 00 20 00 20 00 00 Tbrigade Trgd
Myth III: The Wolf Age 00 4D 00 59 00 54 00 48 00 33 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20 MYTH3 MT3

But I think this happened for every disc with a Joliet Volume Identifier I've checked so far.

Log files Command & Conquer: Teil 3: Operation Tiberian Sun: Feuersturm.zip Computer Bild Spiele 2000-06.zip Myth III: Die Zeit des Wolfs.zip

saramibreak commented 5 months ago

It's a known issue. (#60)

added -fshort-wchar DiscImageCreator_test.tar.gz

maxz commented 5 months ago

Thank you for the information. I did not realise that it was known.

Sadly your provided test version is strictly worse than the regular version. It leaves the Joliet identifier fields empty in the log.

Additionally there are these new errors message:

[F:OutputFsVolumeDescriptorForJoliet][L:479] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:494] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:505] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:516] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:527] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:538] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:549] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:560] GetLastError: 84, Invalid or incomplete multibyte or wide character
[F:OutputFsVolumeDescriptorForJoliet][L:571] GetLastError: 84, Invalid or incomplete multibyte or wide character

@garyww also pretty much writes exactly that in your referred issue:

When compiling with -fshort-wchar (forces wchar_t to be 16-bit) everything about Joliet parsing fails but all other warnings I got previously (see below) were gone.

The log of your provided `_test` version. ``` AppVersion 64 bit, AnsiBuild, 20240504T004230 /c2 val3 was omitted. set [0] /c2 val4 was omitted. set [0] valid extension was omitted. -> set .bin CurrentDirectory /tmp/TBRIGADE WorkingPath Argument: /tmp/TBRIGADE/TBRIGADE.bin FullPath: /tmp/TBRIGADE/TBRIGADE.bin Drive: / Directory: tmp/TBRIGADE/ Filename: TBRIGADE Extension: .bin StartTime: 2024-05-04T14:16:55+0200 Set the drive speed: 7056KB/sec Block Size: 4096 Flagment Size: 4096 All Block Num: 24635381 Free Block Num: 2412347 Available Block Num: 1154389 I Node Num: 6275072 Free I Node Num: 4762694 Available I Node Num: 4762694 File System ID: 6749354239398096367 Mount Flag: 1024 Max Filename Length: 255 DiskSize of [/tmp/TBRIGADE] Total: 100906520576 bytes Used: 91025547264 bytes --------------------------- Space: 9880973312 bytes => There is enough disk space for dumping Check if subchannel pack mode is supported [INFO] This drive supports subchannel pack mode Checking SubRtoW (Track) 10/10 This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 0] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 1] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 2] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 8] Checking Pregap sync, msf, mode (LBA) -8035 [F:OutputFsVolumeDescriptorForJoliet][L:479] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:494] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:505] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:516] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:527] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:538] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:549] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:560] GetLastError: 84, Invalid or incomplete multibyte or wide character [F:OutputFsVolumeDescriptorForJoliet][L:571] GetLastError: 84, Invalid or incomplete multibyte or wide character Reading DirectoryRecord 102/ 102 LBA[000000, 0000000]: [F:ReadTOCText][L:546] Opcode: 0x43 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 02-04-01 = NOT_READY - LUN_NOT_READY - BECOMING_READY LBA[000000, 0000000]: [F:ReadCDForCheckingSubQAdr][L:1109] Opcode: 0xd8 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 06-29-00 = UNIT_ATTENTION - POWER ON, RESET, OR BUS DEVICE RESET OCCURRED Please wait for 40000 milliseconds until the device is returned lpCmd: d8, 00, 00, 00, 00, 00, 00, 00, 00, 02, 08, 00 dwBufSize: 5484 Checking SubQ adr (Track) 10/10 Creating (Track AA).bin & .sub (LBA) 306717/ 306717 There is not non-zero byte in the (Track AA) Creating (Track 00).scm & .sub, (Track 01)(-LBA).scm & .sub (LBA) -8027/ -10000 Set OpCode: 0xd8, SubCode: 8(Raw) Checking SubQ ctl (Track) 10/10 Creating .scm (LBA) 306618/306618 No C2 errors Copying .scm to .img Set LBA to descramble sector 306617/306617 Descrambling data sector of img: 228431/228431 Exec ./EccEdc.out check Sub "/tmp/TBRIGADE/TBRIGADE.img" Checking sectors: 306617/306617 [NO ERROR] User data vs. ecc/edc match all Creating cue and ccd (Track) 10/10 Creating bin (Track) 10/10 Hashing: TBRIGADE.scm Hashing: TBRIGADE.img Hashing: TBRIGADE (Track 01).bin Hashing: TBRIGADE (Track 02).bin Hashing: TBRIGADE (Track 03).bin Hashing: TBRIGADE (Track 04).bin Hashing: TBRIGADE (Track 05).bin Hashing: TBRIGADE (Track 06).bin Hashing: TBRIGADE (Track 07).bin Hashing: TBRIGADE (Track 08).bin Hashing: TBRIGADE (Track 09).bin Hashing: TBRIGADE (Track 10).bin EndTime: 2024-05-04T14:27:57+0200 ```
And for comparison the log of the regular version. ``` AppVersion 64 bit, AnsiBuild, 20240401T222316 /c2 val3 was omitted. set [0] /c2 val4 was omitted. set [0] valid extension was omitted. -> set .bin CurrentDirectory /tmp/TBRIGADE WorkingPath Argument: /tmp/TBRIGADE/TBRIGADE.bin FullPath: /tmp/TBRIGADE/TBRIGADE.bin Drive: / Directory: tmp/TBRIGADE/ Filename: TBRIGADE Extension: .bin StartTime: 2024-05-04T13:57:32+0200 Set the drive speed: 7056KB/sec Block Size: 4096 Flagment Size: 4096 All Block Num: 24635381 Free Block Num: 2413444 Available Block Num: 1155486 I Node Num: 6275072 Free I Node Num: 4763285 Available I Node Num: 4763285 File System ID: 6749354239398096367 Mount Flag: 1024 Max Filename Length: 255 DiskSize of [/tmp/TBRIGADE] Total: 100906520576 bytes Used: 91021053952 bytes --------------------------- Space: 9885466624 bytes => There is enough disk space for dumping Check if subchannel pack mode is supported [INFO] This drive supports subchannel pack mode Checking SubRtoW (Track) 10/10 This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 0] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 1] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 2] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 8] Checking Pregap sync, msf, mode (LBA) -8018 [F:OutputFsVolumeDescriptorForJoliet][L:571] GetLastError: 84, Invalid or incomplete multibyte or wide character Reading DirectoryRecord 102/ 102 LBA[000000, 0000000]: [F:ReadTOCText][L:546] Opcode: 0x43 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 02-04-01 = NOT_READY - LUN_NOT_READY - BECOMING_READY LBA[000000, 0000000]: [F:ReadCDForCheckingSubQAdr][L:1109] Opcode: 0xd8 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 06-29-00 = UNIT_ATTENTION - POWER ON, RESET, OR BUS DEVICE RESET OCCURRED Please wait for 40000 milliseconds until the device is returned lpCmd: d8, 00, 00, 00, 00, 00, 00, 00, 00, 02, 08, 00 dwBufSize: 5484 Checking SubQ adr (Track) 10/10 Creating (Track AA).bin & .sub (LBA) 306717/ 306717 There is not non-zero byte in the (Track AA) Creating (Track 00).scm & .sub, (Track 01)(-LBA).scm & .sub (LBA) -7992/ -10000 Set OpCode: 0xd8, SubCode: 8(Raw) Checking SubQ ctl (Track) 10/10 Creating .scm (LBA) 306618/306618 No C2 errors Copying .scm to .img Set LBA to descramble sector 306617/306617 Descrambling data sector of img: 228431/228431 Exec ./EccEdc.out check Sub "/tmp/TBRIGADE/TBRIGADE.img" Checking sectors: 306617/306617 [NO ERROR] User data vs. ecc/edc match all Creating cue and ccd (Track) 10/10 Creating bin (Track) 10/10 Hashing: TBRIGADE.scm Hashing: TBRIGADE.img Hashing: TBRIGADE (Track 01).bin Hashing: TBRIGADE (Track 02).bin Hashing: TBRIGADE (Track 03).bin Hashing: TBRIGADE (Track 04).bin Hashing: TBRIGADE (Track 05).bin Hashing: TBRIGADE (Track 06).bin Hashing: TBRIGADE (Track 07).bin Hashing: TBRIGADE (Track 08).bin Hashing: TBRIGADE (Track 09).bin Hashing: TBRIGADE (Track 10).bin EndTime: 2024-05-04T14:08:41+0200 ```

Log files for the test version TBRIGADE.zip

saramibreak commented 5 months ago

Updated. (It has not tested yet) DiscImageCreator_test.tar.gz

maxz commented 5 months ago

I can't tell what your changes and your goal were with the version, so I can't determine whether you succeeded.

There now are no error messages related to the Joliet identifiers, but also no lines in the log files displaying the Joliet identifiers. So maybe you decided not to display them if you can't do so correctly right now. Or maybe the fix is just not working as expected.

Here is the relevant section of the SVD:

========== LBA[000017, 0x00011]: Volume Descriptor ==========
                               Volume Descriptor Type: 2
                                  Standard Identifier: CD001
                            Volume Descriptor Version: 1
                                     Escape Sequences: %/E
                                      Volume Set Size: 1
                               Volume Sequence Number: 1
                                   Logical Block Size: 2048
Output ``` AppVersion 64 bit, AnsiBuild, 20240505T112014 /c2 val3 was omitted. set [0] /c2 val4 was omitted. set [0] valid extension was omitted. -> set .bin CurrentDirectory /tmp/TBRIGADE WorkingPath Argument: /tmp/TBRIGADE/TBRIGADE.bin FullPath: /tmp/TBRIGADE/TBRIGADE.bin Drive: / Directory: tmp/TBRIGADE/ Filename: TBRIGADE Extension: .bin StartTime: 2024-05-05T13:50:00+0200 Set the drive speed: 7056KB/sec Block Size: 4096 Flagment Size: 4096 All Block Num: 24635381 Free Block Num: 2984981 Available Block Num: 1727023 I Node Num: 6275072 Free I Node Num: 4763741 Available I Node Num: 4763741 File System ID: 6749354239398096367 Mount Flag: 1024 Max Filename Length: 255 DiskSize of [/tmp/TBRIGADE] Total: 100906520576 bytes Used: 88680038400 bytes --------------------------- Space: 12226482176 bytes => There is enough disk space for dumping Check if subchannel pack mode is supported [INFO] This drive supports subchannel pack mode Checking SubRtoW (Track) 10/10 This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 0] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 1] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 2] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 8] Checking Pregap sync, msf, mode (LBA) -8029 Reading DirectoryRecord 102/ 102 LBA[000000, 0000000]: [F:ReadTOCText][L:546] Opcode: 0x43 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 02-04-01 = NOT_READY - LUN_NOT_READY - BECOMING_READY LBA[000000, 0000000]: [F:ReadCDForCheckingSubQAdr][L:1109] Opcode: 0xd8 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 06-29-00 = UNIT_ATTENTION - POWER ON, RESET, OR BUS DEVICE RESET OCCURRED Please wait for 40000 milliseconds until the device is returned lpCmd: d8, 00, 00, 00, 00, 00, 00, 00, 00, 02, 08, 00 dwBufSize: 5484 Checking SubQ adr (Track) 10/10 Creating (Track AA).bin & .sub (LBA) 306717/ 306717 There is not non-zero byte in the (Track AA) Creating (Track 00).scm & .sub, (Track 01)(-LBA).scm & .sub (LBA) -7842/ -10000 Set OpCode: 0xd8, SubCode: 8(Raw) Checking SubQ ctl (Track) 10/10 Creating .scm (LBA) 306618/306618 No C2 errors Copying .scm to .img Set LBA to descramble sector 306617/306617 Descrambling data sector of img: 228431/228431 Exec ./EccEdc.out check Sub "/tmp/TBRIGADE/TBRIGADE.img" Checking sectors: 306617/306617 [NO ERROR] User data vs. ecc/edc match all Creating cue and ccd (Track) 10/10 Creating bin (Track) 10/10 Hashing: TBRIGADE.scm Hashing: TBRIGADE.img Hashing: TBRIGADE (Track 01).bin Hashing: TBRIGADE (Track 02).bin Hashing: TBRIGADE (Track 03).bin Hashing: TBRIGADE (Track 04).bin Hashing: TBRIGADE (Track 05).bin Hashing: TBRIGADE (Track 06).bin Hashing: TBRIGADE (Track 07).bin Hashing: TBRIGADE (Track 08).bin Hashing: TBRIGADE (Track 09).bin Hashing: TBRIGADE (Track 10).bin EndTime: 2024-05-05T14:00:57+0200 ```

Log files TBRIGADE (20240505T112014).zip

saramibreak commented 5 months ago

fixed again. It has been confirmed on console. DiscImageCreator_test.tar.gz

maxz commented 5 months ago

Looks good. The Joliet identifiers seem to be logged correctly without introducing any other regression (But I only checked that the Joliet identifiers are correct and that the track checksums still match.)

Output ``` AppVersion 64 bit, AnsiBuild, 20240505T224725 /c2 val3 was omitted. set [0] /c2 val4 was omitted. set [0] valid extension was omitted. -> set .bin CurrentDirectory /tmp/TBRIGADE WorkingPath Argument: /tmp/TBRIGADE/TBRIGADE.bin FullPath: /tmp/TBRIGADE/TBRIGADE.bin Drive: / Directory: tmp/TBRIGADE/ Filename: TBRIGADE Extension: .bin StartTime: 2024-05-05T16:06:49+0200 Set the drive speed: 7056KB/sec Block Size: 4096 Flagment Size: 4096 All Block Num: 24635381 Free Block Num: 2971098 Available Block Num: 1713140 I Node Num: 6275072 Free I Node Num: 4761547 Available I Node Num: 4761547 File System ID: 6749354239398096367 Mount Flag: 1024 Max Filename Length: 255 DiskSize of [/tmp/TBRIGADE] Total: 100906520576 bytes Used: 88736903168 bytes --------------------------- Space: 12169617408 bytes => There is enough disk space for dumping Check if subchannel pack mode is supported [INFO] This drive supports subchannel pack mode Checking SubRtoW (Track) 10/10 This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 0] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 1] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 2] This drive (CD-R PX-W4012A 1.07 03/22/06 09:00 ) supports [OpCode: 0xd8, SubCode: 8] Checking Pregap sync, msf, mode (LBA) -8178 Reading DirectoryRecord 102/ 102 LBA[000000, 0000000]: [F:ReadTOCText][L:546] Opcode: 0x43 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 02-04-01 = NOT_READY - LUN_NOT_READY - BECOMING_READY LBA[000000, 0000000]: [F:ReadCDForCheckingSubQAdr][L:1109] Opcode: 0xd8 ScsiStatus: 0x02 = CHECK_CONDITION SenseData Key-Asc-Ascq: 06-29-00 = UNIT_ATTENTION - POWER ON, RESET, OR BUS DEVICE RESET OCCURRED Please wait for 40000 milliseconds until the device is returned lpCmd: d8, 00, 00, 00, 00, 00, 00, 00, 00, 02, 08, 00 dwBufSize: 5484 Checking SubQ adr (Track) 10/10 Creating (Track AA).bin & .sub (LBA) 306717/ 306717 There is not non-zero byte in the (Track AA) Creating (Track 00).scm & .sub, (Track 01)(-LBA).scm & .sub (LBA) -8616/ -10000 Set OpCode: 0xd8, SubCode: 8(Raw) Checking SubQ ctl (Track) 10/10 Creating .scm (LBA) 306618/306618 No C2 errors Copying .scm to .img Set LBA to descramble sector 306617/306617 Descrambling data sector of img: 228431/228431 Exec ./EccEdc.out check Sub "/tmp/TBRIGADE/TBRIGADE.img" Checking sectors: 306617/306617 [NO ERROR] User data vs. ecc/edc match all Creating cue and ccd (Track) 10/10 Creating bin (Track) 10/10 Hashing: TBRIGADE.scm Hashing: TBRIGADE.img Hashing: TBRIGADE (Track 01).bin Hashing: TBRIGADE (Track 02).bin Hashing: TBRIGADE (Track 03).bin Hashing: TBRIGADE (Track 04).bin Hashing: TBRIGADE (Track 05).bin Hashing: TBRIGADE (Track 06).bin Hashing: TBRIGADE (Track 07).bin Hashing: TBRIGADE (Track 08).bin Hashing: TBRIGADE (Track 09).bin Hashing: TBRIGADE (Track 10).bin EndTime: 2024-05-05T16:17:45+0200 ```

Log files TBRIGADE (20240505T224725).zip