[File] [PATCH] of Magdir/archive for XBMC texture package; extension *.xbt

Jörg Jenderek joerg.jen.der.ek at gmx.net
Tue Apr 2 00:19:50 UTC 2019


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
some days ago i run file command version 5.36 inside my kodi
formerly known as XBMC media software. Some samples with "xbt"
extension are only described as "data".

Most information is found on wiki page of kodi software. So add
comment line like
 # URL:		https://kodi.wiki/view/TexturePacker
According to that page a xbt file contains images used by kodi for
faster access. So add lines to Magdir/archive. File format
information is available by looking in header files like XBTF.h of
kodi sources.

Such files start with a 4 byte magic expressed as magic line like
 0	string	XBTF
Afterward comes the version. At the moment there exist only version
2. So display version information only if not standard by line like:
 >>4	string	!2		\b, version %-.1s

According to c-source XBTFReader.cpp afterwards the number of files
inside package is stored. This is now shown by lines
 >>5	ulelong	x		\b, %u file
 >>5	ulelong	>1		\bs

Afterwards comes information about stored files starting with path
string of first archive member. This is shown by line like
 >>9	string	x		\b, 1st %s
The string is null terminated and has a maximal length of 256 chars.
So look at the last char of path. This must be null. This can be
used to distinguish binary xbt file from ASCII text starting with
phrase "XBTF" like sample XBTF.txt by second magic line
 >264	ubyte	0		XBMC texture package
After detection show used defined mime type and filename extension
by lines:
 !:mime	application/x-xbmc-xbt
 !:ext	xbt

After applying the above mentioned modifications by patch
file-5.36-archive-xbt.diff then all inspected examples are now
described like:
curial.xbt:   XBMC texture package, 6 files,
	1st buttons/button-nofo.png
flat.xbt:     XBMC texture package, 3 files,
	1st buttons/button-nofo.png
Textures.xbt: XBMC texture package, 809 files,
	1st black/osd/loading.png
XBTF.txt:     ASCII text, with CRLF line terminators

I hope my diff file can be applied in future version of file utility.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek





















-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXKKqnwAKCRCv8rHJQhrU
1p9OAJ4ms8ktcnSDcej19dz+JP0rjaKBbwCgplax8Ssqa7UyDHBxLD46c3+wU+Y=
=QHmg
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.36/magic/Magdir/archive.old	2019-02-20 15:07:44 +0000
+++ file-5.36/magic/Magdir/archive	2019-04-02 00:15:30 +0000
@@ -1494 +1494,21 @@
 >-16	string	XPAKSTOP	Gentoo binary package (XPAK)
+
+# From:		Joerg Jenderek
+# URL:		https://kodi.wiki/view/TexturePacker
+# Reference:	http://mirrors.kodi.tv/releases/source/17.3-Krypton.tar.gz
+# /xbmc-Krypton/xbmc/guilib/XBTF.h
+# /xbmc-Krypton/xbmc/guilib/XBTF.cpp 
+0	string	XBTF
+# skip ASCII text by looking for terminating \0 of path
+>264	ubyte	0		XBMC texture package
+!:mime	application/x-xbmc-xbt
+!:ext	xbt
+# XBTF_VERSION 2
+>>4	string	!2		\b, version %-.1s
+# nofFiles /xbmc-Krypton/xbmc/guilib/XBTFReader.cpp
+>>5	ulelong	x		\b, %u file
+# plural s
+>>5	ulelong	>1		\bs
+# path[CXBTFFile[MaximumPathLength=256]
+>>9	string	x		\b, 1st %s
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.36-archive-xbt.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20190402/36aef523/attachment.obj>


More information about the File mailing list