BT seed structure and coding analysis

Keywords: encoding Unix SHA1 Spark

1, Data type

There are four types of data: string, integer, list and dictionary.

Strings (string)

Code to: < string len gt h >: < string >
For example: 4:test is represented by the string "test"
4: Examples are represented as string "examples"
String length in bytes
No start or end tag

Integers (integer)

Code as: I < integer > e
Start tag i, end tag e
For example: i1234e is expressed as an integer 1234
i-1234e is expressed as an integer - 1234
Integer has no size limit
i0e is expressed as the integer 0
i-0e is illegal
Those starting with 0 are illegal. For example, i01234e is illegal

Lists

Code: l < coding code type > e
Start marked l, end marked e
The list can contain any encoding type, including integer, string, list and dictionary.
For example: l4:test5abcdee is represented as two strings ["test","abcde"]

Dictionaries

Code as d < encoding string > < encoding encoding type > e
Start marked d, end marked e
Keyword must be a encoding string
Value can be any encoding type
For example: d3:agei20ee is expressed as {"age"=20}
d4:path3:C:/8:filename8:test.txte is represented by {"path"="C:/","filename"="test.txt"}

 

2, Keywords

All content must be of encoding type.

The whole file is a dictionary structure, including the following keywords
Announcement: the URL (string) of the tracker server
Announcement list (optional): list of standby tracker servers (list)
Creation date (optional): seed creation time, Unix standard time format, seconds from 00:00:00, January 1, 1970 to creation time (integer)
Comment (optional): comment (string)
Created by (optional): information of creator or creator (string)
info: a dictionary structure that contains the main information of a file. There are two situations: single file structure or multi file structure
The single file structure is as follows:
Length: file length, unit byte (integer)
Md5sum (optional): MD5 checksums of 32 character long files. BT does not use this value, just for compatibility with some programs! (string)
Name: file name (string)
piece length: the size of each block, in bytes (integer)
pieces: the value of SHA1 Hash of 20 bytes per block (in binary format)
The multi file structure is as follows:
files: a dictionary structure
Length: file length, unit byte (integer)
Md5sum (optional): same as in single file structure
Path: the path and name of the file. It is a list structure. For example, the / test/test.txt list is l4:test8test.txte
Name: top directory name (string)
piece length: same as in single file structure
pieces: same as in single file structure

Three, example

d
8:announce35:http://torrentsmd.com:8080/announce
13:announce-list
    l
        l35:http://torrentsmd.com:8080/announcee
        l34:http://torrentsmd.me:8080/announcee
        l44:udp://tracker2.christianbro.pw:6969/announcee
        l34:udp://allesanddro.de:1337/announcee
        l48:udp://tracker.internetwarriors.net:1337/announcee
        l32:udp://peerfect.org:6969/announcee
        l34:http://torrentsmd.eu:8080/announcee
        l44:udp://ulfbrueggemann.no-ip.org:6969/announcee
        l42:udp://tracker.swateam.org.uk:2710/announcee
        l42:udp://tracker.cypherpunks.ru:6969/announcee
        l44:http://tracker.devil-torrents.pl:80/announcee
        l38:udp://tracker.cyberia.is:6969/announcee
        l39:http://retracker.bashtel.ru:80/announcee
        l44:https://open.kickasstracker.com:443/announcee
        l30:http://grifon.info:80/announcee
        l42:udp://tracker.opentrackr.org:1337/announcee
        l49:udp://tracker.leechers-paradise.org:6969/announcee
        l40:udp://tracker.tiny-vps.com:6969/announcee
        l43:udp://tracker.coppersurfer.tk:6969/announcee
        l41:udp://tracker.halfchub.club:6969/announcee
        l45:http://tracker.electro-torrent.pl:80/announcee
        l39:udp://tracker.justseed.it:1337/announcee
        l39:http://retracker.telecom.by:80/announcee
        l39:http://tracker.city9x.com:2710/announcee
        l34:udp://tracker.acg.gg:2710/announcee
        l44:http://retracker.spark-rostov.ru:80/announcee
        l37:udp://zephir.monocul.us:6969/announcee
        l41:udp://tracker.vanitycore.co:6969/announcee
        l38:udp://bt.xxx-tracker.com:2710/announcee
        l28:http://pt.lax.mx:80/announcee
        l48:udp://tracker.tvunderground.org.ru:3218/announcee
        l32:udp://thetracker.org:80/announcee
        l29:http://asnet.pw:2710/announcee
        l36:udp://tracker.doko.moe:6969/announcee
        l36:http://retracker.mgts.by:80/announcee
        l36:http://t.nyaatracker.com:80/announcee
        l41:udp://tracker.torrent.eu.org:451/announcee
        l35:http://share.camoe.cn:8080/announcee
        l38:http://retracker.omsk.ru:2710/announcee
        l39:http://agusiq-torrents.pl:6969/announcee
        l26:http://fxtt.ru:80/announcee
        l43:http://tracker.filetracker.pl:8089/announcee
        l40:http://tracker.grepler.com:6969/announcee
        l41:http://tracker.torrentyorg.pl:80/announcee
        l44:http://tracker1.wasabii.com.tw:6969/announcee
        l44:http://tracker2.wasabii.com.tw:6969/announcee
        l53:https://opentracker-milanesi.rhcloud.com:443/announcee
        l39:udp://inferno.demonoid.pw:3418/announcee
        l33:udp://open.stealth.si:80/announcee
        l36:udp://tracker.files.fm:6969/announcee
        l39:udp://tracker.grepler.com:6969/announcee
        l40:http://ipv4.tracker.harry.lu:80/announcee
        l42:http://tracker.vanitycore.co:6969/announcee
        l33:udp://mgtracker.org:6969/announcee
        l36:udp://tracker.mg64.net:6969/announcee
        l37:http://tracker.mg64.net:6881/announcee
        l34:http://mgtracker.org:6969/announcee
        l38:udp://tracker.zer0day.to:1337/announcee
        l46:udp://public.popcorn-tracker.org:6969/announcee
        l33:udp://www.eddie4.nl:6969/announcee
        l42:udp://tracker.pirateparty.gr:6969/announcee
        l40:udp://tracker.leechers-paradise.org:6969e
        l34:udp://tracker.coppersurfer.tk:6969e
        l40:udp://inferno.demonoid.ooo:3389/announcee
        l32:udp://62.138.0.158:6969/announcee
        l39:http://tracker3.itzmx.com:6961/announcee
        l41:http://tracker.kamigami.org:2710/announcee
        l37:http://tracker.dler.org:6969/announcee
        l33:http://t.nyaatracker.com/announcee
        l30:http://t.acg.rip:6699/announcee
        l39:http://ipv4.tracker.harry.lu:80/annoucee
        l37:http://ipv4.tracker.harry.lu/announcee
        l35:http://87.248.186.252:8080/announcee
        l33:http://retracker.mgts.by/announcee
        l38:http://tracker.xfsub.com:6868/announcee
        l39:http://tracker1.itzmx.com:8080/announcee
        l40:udp://inferno.demonoid.com:3418/announcee
        l31:udp://9.rarbg.com:2710/announcee
        l43:http://tracker.opentrackr.org:1337/announcee
        l43:udp://tracker1.wasabii.com.tw:6969/announcee
        l34:http://91.218.230.81:6969/announcee
        l39:udp://open.facedatabg.net:6969/announcee
        l39:udp://ipv4.tracker.harry.lu:80/announcee
        l33:udp://trackerxyz.tk:1337/announcee
        l43:udp://tracker2.wasabii.com.tw:6969/announcee
        l34:udp://tracker.xku.tv:6969/announcee
        l45:udp://tracker.edoardocolombo.eu:6969/announcee
        l35:udp://tracker.desu.sh:6969/announcee
        l43:udp://tracker.christianbro.pw:6969/announcee
        l39:udp://tracker.bluefrog.pw:2710/announcee
        l34:udp://tr.cili001.com:6666/announcee
        l32:udp://explodie.org:6969/announcee
        l33:udp://z.crazyhd.com:2710/announcee
        l35:udp://tracker1.xku.tv:6969/announcee
        l37:udp://tracker.skyts.net:6969/announcee
        l36:udp://tracker.safe.moe:6969/announcee
        l44:udp://tracker.piratepublic.com:1337/announcee
        l36:udp://tracker.kuroy.me:5944/announcee
        l40:udp://tracker.kamigami.org:2710/announcee
        l42:udp://tracker.filetracker.pl:8089/announcee
        l36:udp://tracker.dler.org:6969/announcee
        l37:udp://sandrotracker.biz:1337/announcee
        l42:udp://retracker.lanta-net.ru:2710/announcee
        l35:udp://p4p.arenabg.com:1337/announcee
        l39:udp://oscar.reyesleon.xyz:6969/announcee
        l32:udp://86.19.29.160:6969/announcee
        l33:udp://208.67.16.113:8000/announcee
        l39:https://tracker.bittor.xyz:443/announcee
        l37:http://tracker.kuroy.me:5944/announcee
        l38:http://sandrotracker.biz:1337/announcee
        l40:http://open.acgtracker.com:1096/announcee
        l51:udp://packages.crunchbangplusplus.org:6969/announcee
        l47:http://tracker.videodrugproject.com:80/announcee
        l35:http://tracker.tfile.me:80/announcee
        l33:http://explodie.org:6969/announcee
        l33:udp://santost12.xyz:6969/announcee
        l30:udp://wambo.club:1337/announcee
        l36:udp://retracker.nts.su:2710/announcee
        l45:udp://tracker.dutchtracking.com:6969/announcee
        l38:udp://tc.animereactor.ru:8082/announcee
    e
10:created by13:uTorrent/2210
13:creation datei1577851741e
8:encoding5:UTF-8
4:info
    d
        6:lengthi2073586611e
        4:name91:King of navigation: fanatical action.ONE.PIECE.STAMPEDE.2019.HD1080P.X264.AAC.Japanese&Mandarin.CHS.mkv
        12:piece lengthi2097152e
        6:pieces19780:@¥Yanۋ?ǁb)P¨.t8~\¿Г....(Omit here)....
    e
e

 

Among them, d E and d E are dictionaries, l e is lists and i E is integers.

It is easy to see that the whole file is a dictionary with the following keywords:

announce=http://torrentsmd.com:8080/announce

announce-list=http://torrentsmd.com:8080/announce,

                        http://torrentsmd.me:8080/announce,

                        .....,

                        udp://tc.animereactor.ru:8082/announce

created by=uTorrent/2210

creation date=1577851741

encoding=UTF-8

info=

        length=2073586611

name = King of navigation: fanaticism. One. Pie. Stampede. 2019. HD1080P. X264. AAC. Japanese & Mandarin. CHS. Mkv

        piece length=2097152

pieces = @ ¥ and b)P? (t8 ~ \? γ... (omitted here)

 

Reference resources

Detailed analysis of BT seed file encoding

https://blog.csdn.net/thanklife/article/details/54910294

Public BitTorrent Tracker

https://hao.su/3278/

torrent online analysis tool

https://tool.lu/torrent/

54 original articles published, praised 19, visited 100000+
Private letter follow

Posted by inkdrop on Sat, 01 Feb 2020 05:03:09 -0800