Tuesday, November 5, 2013

How to edit your uTorrent statistics

  • How to edit your uTorrent statistics

    Hello everyone,
    there are many posts all around the forum with bits of information about editing the traffic stats in uTorrent. Since I have some free time today, I thought I'd collect them all into a single thread. This will teach you how to edit most of the values you see in Help -> Show Statistics menu.

    First, you will have to close uTorrent if it's running. You can't perform this procedure while it's running.

    You must know where your setting files are. This will be %appdata%\uTorrent if you've installed the client, or the same directory as the executable if you're running a portable install.

    Now you need to download the program BEncode Editor. You can do it here.

    Run BEncode Editor and open your settings.dat file in it. You will see something like this:


    Now you can edit the following:


    • Total Uploaded = tu (bytes). 1 MB = 1048576 bytes.
    • Total Downloaded = td (bytes). 1 MB = 1048576 bytes. The Total Ratio is automatically calculated by uTorrent from these two values.
    • Total Running Time = rt (seconds). 1 hour = 3600 seconds.
    • Number of torrents added = fd
    • Number of times started = st


    OK, that was easy so far. Now it gets slightly harder.


    • Uploaded Today = daily_upload_hist (binary array; first of the 31 64-bit integers in reverse byte order)
    • Downloaded Today = daily_download_hist (binary array; first of the 31 64-bit integers in reverse byte order)
    • Transferred last 31 days = the sum of all integers in daily_upload_hist and daily_download_hist (binary arrays; each having 31 64-bit integers in reverse byte order)


    You might wonder what's up with this. You only had to edit bytes before. It was pretty straightforward. And even worse, if you open these values, you see something like this!

    Quote:

    0x5BF74D0600000000C3075906000000008C0A269501000000 318EA305000000008D17360600000000AE51921E00000000F1 10C80200000000E846B243010000009BB24E1501000000B0FE 760700000000D50DD0BA000000003EDB5104000000007B1F4C 600000000046634F1B000000008A9FC004000000002EBA5104 00000000029EA104000000001B166CF4010000003E7F360400 0000007C46440400000000DE8FAC1C00000000513A4B040000 0000C3B34B04000000001E6B58040000000021B35704000000 000E32BEA900000000B0515704000000007580390400000000 D6302233000000001F965504000000009C7E5E0400000000

    Now I will show you that same data but arranged differently. Add a line break after "0x", then another every 16 characters.

    HTML Code:

    0x
    5BF74D0600000000 <- br="" today=""> C307590600000000 <- br="" yesterday=""> 8C0A269501000000 <- 2="" ago="" br="" days=""> 318EA30500000000 <- 3="" ago="" br="" days=""> 8D17360600000000 <- 4="" ago="" br="" days=""> AE51921E00000000 ...and so on...
    F110C80200000000
    E846B24301000000
    9BB24E1501000000
    B0FE760700000000
    D50DD0BA00000000
    3EDB510400000000
    7B1F4C6000000000
    46634F1B00000000
    8A9FC00400000000
    2EBA510400000000
    029EA10400000000
    1B166CF401000000
    3E7F360400000000
    7C46440400000000
    DE8FAC1C00000000
    513A4B0400000000
    C3B34B0400000000
    1E6B580400000000
    21B3570400000000
    0E32BEA900000000
    B051570400000000
    7580390400000000
    D630223300000000
    1F96550400000000 <- 30="" ago="" br="" days=""> 9C7E5E0400000000 <- 31="" ago="" code="" days="">


    If it still makes no sense: each one of those grouped numbers is a 64-bit integer stored in hexadecimal. This means uTorrent can remember up to 18,446,744,073,709,551,615 bytes (that's 16384 petabytes) of data transferred in each direction every day. I doubt even the fastest seedbox can pull that off.
    Anyway, this doesn't mean you can just convert decimal to hex. Remember what we said about byte order? uTorrent stores these numbers in reverse order. 5BF74D0600000000, which is how many bytes you moved today in the above example, would be stored as 00000000064DF75B in normal order. For those unexperienced with bytes, this doesn't mean you have to flip every letter and number, but rather do so in groups of two. This will help you:


    Code:

    Reverse order
    8  7  6  5  4  3  2  1
    5B-F7-4D-06-00-00-00-00

    Normal order
    1  2  3  4  5  6  7  8
    00-00-00-00-06-4D-F7-5B


    So, in a nutshell:

    • Open daily_upload_hist or daily_download_hist (depending on what you want to edit) in BEncode Editor.
    • Copy the value to a Notepad window.
    • Add a line break after "0x", then another every 16 characters.
    • Go here to convert decimal to hexadecimal. 93136 becomes 16BD0
    • If the resulting hexadecimal number doesn't have an even number of digits, put a 0 in front of it. 16BD0 becomes 016BD0
    • Change the byte order as we discussed above. 016BD0 becomes D06B01
    • In Notepad, replace the line for the day whose traffic you want to edit with that number. Then, fill the rest with zeros. D06B01 becomes D06B010000000000
    • Repeat this for all the other days you want to edit.


    When done, remove all line breaks so that everything is a single continuous line. Paste the value in the BEncode Editor edit window and press OK.

    When you're done editing everything, find the .fileguard value at the top of the window and delete it. Go to File -> Save to store your changes. Go to the directory where settings.dat is and delete settings.dat.old (or better, move it elsewhere), which is a backup.

    Now run uTorrent, and your stats should be whatever you set them to.


    FAQ

    Q: I want to know in which format .dat files are stored.
    A: Bencode - Wikipedia, the free encyclopedia

    Q: I want to know why you have to arrange the bytes from right to left.
    A: Endianness - Wikipedia, the free encyclopedia

    Q: I think it's a bad thing that you help people create fake client proofs.
    A: You shouldn't believe everything you see. Ratio proofs can be faked, speed tests can be faked, stats can be faked. Don't use them as the one way to pick potential invitees.

    Q: I have a question not listed here.
    A: Post it in this thread.