[File] [PATCH] Magdir/windows CloneCD *.CCD described as Generic INI

Christos Zoulas christos at zoulas.com
Sat Mar 11 18:54:42 UTC 2023


Committed, thanks!

christos

> On Mar 10, 2023, at 5:13 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> Some days ago i handle some CD-ROM images. The standard format has a
> suffix like iso. But especially on Windows also some other formats
> are used. One format use CCD as suffix. When running file command
> version 5.44 and newer on such CCD samples i get an output like:
> 
> ultraiso11.ccd: Generic INItialization configuration [Disc]
> 
> Then of course with option --extension only generic ini/inf instead
> of 3 byte sequence ccd is shown and with -i option only
> application/x-wine-extension-ini mime type is shown.
> 
> When excluding the test consulting magic file by option -e soft now i
> get an output like:
> ultraiso11.ccd: ASCII text, with CRLF line terminators
> Here now generic mime type text/plain is shown.
> 
> For comparison reason i run the file format identification utility
> TrID ( See https://mark0.net/soft-trid-e.html). The samples are
> also described with low priority as "Generic INI configuration" by
> ini.trid.xml. The samples are described with high priority as
> "CloneCD CDImage (description)" by cdimage-clonecd-cue.trid.xml
> with correct suffix CCD. But here only application/octet-stream as
> generic mime type is shown (See appended trid-v-ccd.txt.gz).
> 
> For comparison reason i also run the file format identification
> utility DROID ( See https://sourceforge.net/projects/droid/).
> Here my CCD examples are described as "CloneCD Control File" by PUID
> fmt/1760. Here also correct extension CCD is shown, but mime type
> field is empty (See appended droid-ccd.csv.gz).
> 
> The INI based samples should be recognized by subroutine ini-file
> inside Magdir/windows. If the samples are only described as Generic
> INItialization configuration that means a suited branch for sub
> classification is missing inside sub routine.
> 
> The first step in sub routine is look for left bracket which is the
> beginning of section.
> 
> Then look for known keywords or section names. If it find one then
> display specific describing text with corresponding mime type and
> file suffix. For the Windows Boot Loader this for example looks like:
>>> &0	regex/c	\^boot\x20loader]	Windows boot.ini
> !:mime application/x-wine-extension-ini
> !:ext	ini
> 
> Unfortunately the rules for INI file are not so strict. So it can
> happens that the relevant section name is not the first one.
> So if no known keyword is found after opening bracket, then look for
> bracket of second section. This is done by lines like:
>>> &0	default				x
>>>> &0	search/8192			[
> Then look again for known keyword like before. So some Windows setup
> INFormation are detected now. If no known keyword is found in second
> section than handle such samples by lines like:
>>>>> &0	default				x
>>>>>> &0	ubyte				x
>>>>>>> &-1 regex/T \^([A-Za-z0-9_\(\)\ ]+)\]\r	\
> 	Generic INItialization configuration [%-.40s
> !:mime	application/x-wine-extension-ini
> !:ext	ini/inf
> 
> So for my CCD examples the second section line entry [Disc] is here
> shown.
> 
> Unfortunately i found no page about the used text file format for
> CCD. But with the help of TrID command i found sufficient pages
> CloneCD and the corresponding Control File on Wikipedia. That is
> expressed by comment lines like:
> # URL:		https://en.wikipedia.org/wiki/CloneCD
> # Reference:	https://en.wikipedia.org/wiki/CloneCD_Control_File
> #		http://mark0.net/download/triddefs_xml.7z
> #		defs/c/cdimage-clonecd-cue.trid.xml
> According to TrID, DROID and Wikipedia the first line looks like:
> [CloneCD]
> So i choose this as test criterium. So in branch handling first
> section after last entry handling Flatpack and before handling
> second section names this is now done by additional lines like:
>>> &0	string		CloneCD]	CloneCD CD-image Description
> !:mime	text/x-ccd
> !:ext	ccd
> Because the CCD files are just "simply text" files i could choose
> generic mime type text/plain. But instead i choose a more suited user
> defined text type. There exist other files with CCD suffix ( like
> CorelCAD Drawing) but these seems to be not text files.
> 
> After applying the above mentioned modifications by patch
> file-windows-ccd.diff then my samples are now described
> with more details and correct name suffix. This now then looks like:
> 
> ultraiso11.ccd: CloneCD CD-image Description
> 
> I hope my diff file can be applied in future version of file
> utility. Especially for people willing to switch to Linux (like the
> author of ccd2iso tool) from Windows with personal files with formats
> suited for Windows.
> 
> As far as i can see there exist more CD-images formats used mainly on
> Windows, which are not recognized by file command.
> 
> With best wishes,
> Jörg Jenderek
> - --
> Jörg Jenderek
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCZAurpAAKCRCv8rHJQhrU
> 1pqZAKDKYZfQzhIpWvnz50EVbzwEsTIVWQCg1ztoFJjMnAfXs7qZys4XWznlhCA=
> =DkaZ
> -----END PGP SIGNATURE-----
> <droid-ccd.csv.gz><trid-v-ccd.txt.gz><file-windows-ccd_diff.DEFANGED-2613><file-windows-ccd_diff_sig.DEFANGED-2614>--
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20230311/194e5379/attachment.asc>


More information about the File mailing list