Domanda

So I'm writing a Bittorrent client in C++ and I can communicate with the tracker, however when I get the announce response my IP address is the only one I get in return. After looking at my traffic over wireshark and comparing it to the traffic to the same tracker in transmission I've concluded that I must be sending the info-hash of the torrent incorrectly.

So, I'm sending this as my info-hash of my test torrent (TPB AFK (totally legal to torrent!)):

99FEAE0A05C6A5DD9AF939FFCE5CA9B0D16F31B0

From reading a few other posts around the net I got the idea that I have to encode this somehow, and also that it needs to be 20 bytes (which I stupidly didn't realize it wasn't before...didn't count).

So there must be some sort of encoding that I must feed this hash into, but what is it?

È stato utile?

Soluzione

Okay, so That string of 40 characters, is just 20 bytes...so the correct way to send the info_hash is:

0x99 0xFE 0xAE 0x0A 0x05 0xC6 0xA5 0xDD 0x9A 0xF9 0x39 0xFF 0xCE 0x5C 0xA9 0xB0 0xD1 0x6F 0x31 0xB0

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top