Christoph Biedl wrote...

> At a quick glance (I might be wrong) I failed to find the magic
> 0x4F524243 in the images attached to the initial report. OTOH, these
> images start with a huge amount (7.3 Mbyte) of \xff octets.
> file/libmagic don't look that far into files anyway to it might be
> impossible to detect coreboot image files properly. Rainer also
> provided some information that point into the same direction.

It's been a while ... good news, since stretch it's possible to override
the amount of data file/libmagic look into. In other words, using a
magic file (just a proof of concept) "coreboot.magic":

    0x700000    string LARCHIVE Coreboot image

you'll get want you want if your willing to increase the buffer:

    $ file -m coreboot.magic b1_coreboot.rom
    b1_coreboot.rom: ISO-8859 text, with very long lines, with no line 
terminators
    $ file --parameter bytes=10485760 -m coreboot.magic b1_coreboot.rom
    b1_coreboot.rom: Coreboot image

Now the bad parts: At first, as this fails using the default value (1M)
I'm not sure whether it's useful to ship magic for coreboot in libmagic
(after some improvement of course). But you could use an extra local
magic file for that anyway.

Second, libmagic's magic_setparam() function needed for this is not
available in the python bindings yet. This is tracked upstream at

    https://github.com/ahupp/python-magic/issues/163

Shouldn't be that difficult, even I am tempted to do that.

Cheers,
    Christoph

Attachment: signature.asc
Description: PGP signature

Reply via email to