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