Hi,

i meanwhile had a chance to inspect the image file and found that it
shows a repeating pattern of bytes with value 255 every 2352 bytes.
This corresponds to the size of medium level CD sectors, as can be obtained
by SCSI command "READ CD" (e.g. via Linux ioctl CDROMREADRAW).

CD-DA audio sectors have this whole size filled with audio payload.
Data sectors consist of meta-data and payload data. There are various forms
of data sectors. See
  https://en.wikipedia.org/wiki/CD-ROM#Sector_structure

The magic number of ISO 9660 which in the data payload world is at byte
position 16 * 2048 is in the image file at position 16 * 2352 + 16.
This means that the header size of the data sector format is 16.
I expect a payload size of 2048 bytes.
(These parameters match the format "CD-ROM Mode 1". The remaining 288 bytes
 of the sector are error correcting data.)

So i wrote a little C program which reads chunks of 2352 bytes from standard
input and writes 2048 bytes from offset 16 to standard output.
Filtering the image file through this program yielded a new image file
which can be mounted as ISO 9660 filesystem.

The program has 55 lines, including rudimentary error handling. I am sure
that the ongoing awk programming contest can provide a shorter solution.


Have a nice day :)

Thomas

Reply via email to