[File] [PATCH] Magdir/magic text file misitetifies Magicsee R1 controller Magicsee_R1.cfg
Christos Zoulas
christos at zoulas.com
Sat Jun 24 17:18:45 UTC 2023
Applied, thanks!
christos
> On Jun 24, 2023, at 8:27 AM, Jörg Jenderek (GMX) <joerg.jen.der.ek at gmx.net> wrote:
>
> Hello,
>
> some times ago i send patch of Magdir/mathematica to recognize
> Matlab files, which normally have file name suffix mat. Some times ago
> i must look for file with suffix bin. Some are misidentified as
> Matlab v4 mat-file (little endian). I found such samples in directory
> /usr/lib/firmware/radeon on Linux Mint 21.1.
>
> When running file command version 5.44 on such
>
> real Matlab examples and
> some misidentified samples i get an output like:
>
> Header: magic text file for file(1) cmd, ASCII text
> Magicsee_R1.cfg: ASCII text
> magic.mgc: magic binary file for file(1) cmd (version 18) (little
> endian)
>
>
>
> For comparison reason i run other utilities. The file identifier
> tool TrID (see http://mark0.net/soft-trid-e.html) does not recognize
> the files. All are described wrong as "Adobe PhotoShop Brush" by
> abr.trid.xml (See appended trid-v-mat.txt.gz).
>
> DROID (Digital Record and Object Identification) is a software tool
> developed by The National Archives of UK to perform automated batch
> identification of file formats. See
> https://digital-preservation.github.io/droid/
> According to that tool the real samples are described as "MATLAB Mat
> File " with version "Level 4" by PUID fmt/1550 via extension.
> (See appended droid-mat.csv.gz)
>
> First we see that we see that we get very high values for rows and
> columns. That is very unlikely but not forbidden. For real MAT samples
> after (little endian) phrase a matrix name is shown like:
> fit_params testmatrix testsparsecomplex teststringarray
> For misidentified samples i get here nothing.
>
> This output is done by subroutine matlab4 inside Magdir/mathematica.
> The relevant lines look like:
> #>16 ubelong x \b, name length %u
> #>20 string x \b, MATRIX NAME="%s"
> >16 pstring/L x %s
> For the firmware samples no pascal string is displayed for
> misidentified MATRIX NAME "\231" because name length is zero. Assuming
> that real MAT samples always have an embedded matrix name the radeon
> firmware samples can be skipped before calling subroutine by just
> checking for positive matrix name length. So the test lines before sub
> routine call now becomes like:
> >>>>>>16 ulelong <3
> >>>>>>>16 ubelong >0
> >>>>>>>>0 use \^matlab4
>
> After applying the above mentioned modifications by patch
> file-5.44-mathematica-mat.diff then i get an output like:
>
> BONAIRE_sdma.bin: data
> HAWAII_sdma.bin: data
> KABINI_sdma.bin: data
> KAVERI_sdma.bin: data
> MULLINS_sdma.bin: data
> testvec_4_GLNX86.mat: Matlab v4 mat-file (little endian) fit_params
> , numeric, rows 2, columns 1
>
> I hope my diff file can be applied in future version of
> file utility.
>
> With best wishes
> Jörg Jenderek
> --
> Jörg Jenderek
>
>
>
>
> <droid-mat.csv.gz><trid-v-mat.txt.gz><file-5_44-mathematica-mat_diff.DEFANGED-7378><file-5_44-mathematica-mat_diff_sig.DEFANGED-7379><Nachrichtenteil als Anhang.DEFANGED-7380>--
> 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/20230624/06b7e8e9/attachment.asc>
More information about the File
mailing list