Support negative magic offsets
I don't know if that's a crazy idea or not, or even if it already exists, but as some formats don't have their magic number in a header but in a footer, what if we supported negative offsets which would count from the end of the file? -1 would be the last byte, -2 the byte just before, etc…
E.g. application/x-virtual-boy-rom
has a magic value, but it's at the end of its file, so
<mime-type type="application/x-virtual-boy-rom">
<comment>Virtual Boy ROM</comment>
<generic-icon name="application-x-executable"/>
<glob pattern="*.vb"/>
</mime-type>
could become something like
<mime-type type="application/x-virtual-boy-rom">
<comment>Virtual Boy ROM</comment>
<generic-icon name="application-x-executable"/>
<magic priority="60">
<match type="string" value="\x00\x00\x00\x00\x00" offset="-524"/>
</magic>
<glob pattern="*.vb"/>
</mime-type>
That would help differentiating it from Visual Basic files.