xref: /freebsd/contrib/file/magic/Magdir/aria (revision ae316d1d1cffd71ab7751f94e10118777a88e027)
1
2#------------------------------------------------------------------------------
3# $File: aria,v 1.2 2024/06/10 23:09:52 christos Exp $
4# aria:		file(1) magic for download manager aria
5# URL: 		https://de.wikipedia.org/wiki/Aria_(Software)
6# Reference:	https://github.com/aria2/aria2/blob/master/doc/manual-src/en/technical-notes.rst
7# From:		Joerg Jenderek
8# Note:		only version 1 suited
9# check for valid version one
100		beshort		0x0001
11# skip most uncompressed DEGAS med-res bitmap *.PI2 and GEM bitmap (v1) *.IMG
12# by test for valid infoHashCheck extension
13>2		ubelong&0xffFFffFE	0x00000000
14# skip DEGAS med-res bitmap DIAGRAM1.PI2 by test for valid length of download
15>>(6.L+14)	ubequad			>0
16>>>0	use     aria
170	name	aria
18# version; (0x0000) or (0x0001); for 0 all multi-byte are in host byte order. For 1 big endian
19>0	beshort		x	aria2 control file, version %u
20#!:mime	application/octet-stream
21!:mime	application/x-aria
22!:ext	aria2
23# EXTension; if EXT[3]&1 == 1 checks whether saved InfoHash and current downloading the same; infoHashCheck extension
24>2		ubelong		!0	\b, infoHashCheck %#x
25# info hash length like: 0 14h
26>6		ubelong		!0	\b, %#x bytes info hash
27# info hash; BitTorrent InfoHash
28>>10		ubequad		x	%#16.16llx...
29# piece length; the length of the piece like: 400h 100000h
30>(6.L+10)	ubelong		x	\b, piece length 0x%x
31# total length; the total length of the download
32>(6.L+14)	ubequad		x	\b, total length %llu
33#>(6.L+14)	ubequad		x	\b, total length %#llx
34# upload length; the uploaded length of download like: 0 400h
35>(6.L+22)	ubequad		!0	\b, upload length %#llx
36# bitfield length; the length of bitfield like: 4 6 Ah 10h 13h 167h
37>(6.L+30)	ubelong		x	\b, %#x bytes bitfield
38# bitfield; bitfield which represents current download progress
39>(6.L+34)	ubequad		!0	%#llx...
40
41