[File] [PATCH] Magdir/mathematica Matlab v4 mat-file misidentifies radeon firmware
Christos Zoulas
christos at zoulas.com
Fri Jun 16 19:34:08 UTC 2023
Committed, thanks!
christos
> On Jun 15, 2023, at 5:24 PM, 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 firmware samples i get an output like:
>
> BONAIRE_sdma.bin: Matlab v4 mat-file (little endian)
> , numeric, rows 1087513604, columns 20938
> HAWAII_sdma.bin: Matlab v4 mat-file (little endian)
> , numeric, rows 1087513604, columns 20938
> KABINI_sdma.bin: Matlab v4 mat-file (little endian)
> , numeric, rows 1087513604, columns 20938
> KAVERI_sdma.bin: Matlab v4 mat-file (little endian)
> , numeric, rows 1087513604, columns 20938
> MULLINS_sdma.bin: Matlab v4 mat-file (little endian)
> , numeric, rows 1087513604, columns 20938
> testvec_4_GLNX86.mat: Matlab v4 mat-file (little endian) fit_params
> , numeric, rows 2, columns 1
>
> 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-173173><file-5_44-mathematica-mat_diff_sig.DEFANGED-173174>--
> 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/20230616/c5be4ff8/attachment-0001.asc>
More information about the File
mailing list