Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Warrior on July 09, 2005, 04:35 AM

Title: BNLS_HASHDATA (0x0B) Troubles..
Post by: Warrior on July 09, 2005, 04:35 AM
For the client I'm writing I send a packet to BNLS and it just simply ignores
the request for the data to be hashed

I tried it on JBLS and it worked fine, I know JBLS may be more leniant than BNLS but I really don't know what I'm doing wrong.

As always, help is appreciated.

Information: Language is VB6, client is Starcraft and my password
was converted to lowercase before sending

Code to build BNLS_HASHDATA

Public Function SendHashData(ByVal Data As String, ByVal DataLen As Long, ByVal HashType As Long)
    Dim Cookie As Long
   
    With Buffer
        .Add DataLen
        .Add HashType
        .Add Data
       
        If (HashType = HASH_DOUBLE) Then
            .Add BNCSConstants.ClientToken
            .Add BNCSConstants.ServerToken
        ElseIf (HashType = HASH_COOKIE) Then
            Cookie = GetTickCount
            .Add Cookie
            BNLSConstants.RequestedCookie = True
        End If
       
        .SendPacket BNLS, BNLS_HASHDATA
    End With
End Function


Here is the BnetDocs format: (S->C)


(DWORD[5])    The data hash.

Optional:
(DWORD)       Cookie. Same as the cookie from the request.
Title: Re: BNLS_HASHDATA (0x0B) Troubles..
Post by: UserLoser. on July 09, 2005, 06:26 AM

.Add DataLen + 1


Will work.  I'm assuming so, anyways, since your buffer class probably will add on a null byte at the end after Data is appended since it's a string
Title: Re: BNLS_HASHDATA (0x0B) Troubles..
Post by: Warrior on July 09, 2005, 06:39 AM
Wow, that fixed it. Thanks.