• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Mr. N00b

#1
Hi.

Wireshark displays this message when I view a network log of my program recorded with dumpcap.  Specifically, I receive this sequence:


Server -> Client [TCP Previous Segment Lost PSH ACK]
Client  -> Server [TCP DUP ACK #1]
Server -> Client [PSH ACK]
Client  -> Server [TCP DUP ACK #2]
Server -> Client [PSH ACK]
Client  -> Server [TCP DUP ACK #3]
Server -> Client [ACK]
Server -> Client [TCP Retransmission]


It happens infrequently, but when it does, it causes problems with my receive buffer and data integrity, or so it seems. Does anyone know what causes it, and how to deal with it?
#2
Okay, I've got it working. It seems the problems were mainly due to endianess and inclusion of the message length which bnet does not encode.

The working code as it stands:
http://pastebin.org/195541

So thanks Hdx for the example code and exposition, and also to rabbit for the javaop link.
#3
Firstly, thanks for the explanation and example code Hdx.

I tried modifying my code as per your instructions, however It still produces the wrong hashes. No doubt this is a failing on my behalf.

The modified code:
http://pastebin.org/195121

I do have some questions regarding your example, for instance, is the length of the message still encoded in big endian?

Edit:
I'm going to try running both the codes side by side and compare them.
#4
Okay, I'll look at that, thanks Rabbit.

Edit:

I just took a look at the javaop code. It's much closer to the standard sha1 code, just what I need, thanks again rabbit.
#5
Battle.net Bot Development / Sha1 vs Bnet Sha1
April 29, 2010, 09:38 AM
Hi,

I'm new to battle.net development, and I'm trying to implement the sha1 hashing for packet 0x51, however, because I already wrote sha1 for a torrent client I made, I assumed it would work for bnet, which now appears not to be the case.

Here is the code I'm using:
http://pastebin.org/192263

It includes the standard sha1 I implemented, and the sha1_bnet_encrypt() function which produces the hashes bnet expects. I would like to use the standard sha1 code if possible, so can any one tell me the offsets of the client's implementation, explain the differences, or both :). The code for the sha1_bnet_encrypt() function is a mess, so I'd rather not base the changes on that :(