From Michal:
The most correct way to detect the format would probably be to first
check for 'STOP' at the end, read the unsigned long preceding it and use
it as (negative) offset from end of file where 'XPAKPACK' is to be
found. However, file does not seem to support that kind of lookup.
Therefore, I went for the second best thing and checking for additional
'XPAKSTOP' terminating the metadata blob.
Technically, the information could be usefully amended by stating
the compression used. However, it seems that positive offsets following
negative offsets do not work, and reversing the logic would require
a lot of repetition, so I presumed it's not worth the effort.
You can view, comment on, or merge this pull request online at:
[This note is for me to fix positive offset from starting from negative
offsets.]