Valhalla Legends Forums Archive | Battle.net Bot Development | D2 Logon

AuthorMessageTime
Jaquio
Alright, well I am wondering..

What exactly is the correct logon sequence? I know it is posted on BNetDocs, but it doesn't say which BNLS packets to send with it. So could someone tell me that exact packets to send including BNLS packets?
February 7, 2007, 3:59 AM
Spilled[DW]
[quote author=Jaquio link=topic=16261.msg164200#msg164200 date=1170820798]
I know it is posted on BNetDocs
[/quote]

Everything You need is there, what else do you need? Are you trying to log on your character or as open character?

February 7, 2007, 4:32 AM
Jaquio
Closed BNet character.

Everything isn't there, it tells just the bncs packet sequence. It doesn't have the BNLS with it.
February 7, 2007, 5:08 AM
HdxBmx27
Well dua, anyone with 1/2 an IQ could figure out that 'Hay I need to get the Double hash of this string.. What BNLS Packet Hashes Strings... OMG BNLS_HASHDATA!!!!'
Basic things lik that...
You should actually TRY before youask for help.
~-~(HDX)~-~
February 7, 2007, 6:17 AM
Myndfyr
[quote author=Jaquio link=topic=16261.msg164200#msg164200 date=1170820798]
I know it is posted on BNetDocs[/quote]
Here's the BNLS protocol specification:
http://www.valhallalegends.com/yoni/bnlsprotocolspec.txt

I've typed it so many times I know it by memory.
February 7, 2007, 7:38 AM
Jaquio
Heh.. OKay I have gotten it up to hashing the CDKeys. On 0x0C where

"(STRING[]) CD-keys. No dashes or spaces."

Do I just insert two strings into the packet(one for each CDKey) or insert an actually array there? And if so, how would I do that...
February 7, 2007, 8:26 AM
Spilled[DW]
[quote author=Jaquio link=topic=16261.msg164212#msg164212 date=1170836771]
Heh.. OKay I have gotten it up to hashing the CDKeys. On 0x0C where

"(STRING[]) CD-keys. No dashes or spaces."

Do I just insert two strings into the packet(one for each CDKey) or insert an actually array there? And if so, how would I do that...
[/quote]

Well, What does BnetDocs say?

[quote author=BnetDocs]
(DWORD) Cookie. This value has no special meaning to the server and will simply be echoed to the client in the response.
(BYTE) Amount of CD-keys to encrypt. Must be between 1 and 32.
(DWORD) Flags.*
(DWORD or DWORDs) Server session key(s), depending on the flags.
(Optional DWORD or DWORDs) Client session key(s), depending on the flags.
(String or strings) CD-keys. No dashes or spaces. The client can use multiple types of CD-keys in the same packet.
[/quote]

hrmm, looks like "(string or Strings)" would mean if there are 2 keys, then there would be 2 strings.
so wouldn't that mean:

InsertNTString cdkey1
InsertNTString cdkey2

.... I believe so
February 7, 2007, 11:19 AM
Jaquio
[code]
1  192.168.1.105:2513  63.161.183.205:9367  7  Send 
0000  07 00 10 05 00 00 00                              .......

2  63.161.183.205:9367  192.168.1.105:2513  11  Recv 
0000  0B 00 10 05 00 00 00 0B 00 00 00                  ...........

3  192.168.1.105:2514  63.240.202.139:6112  59  Send 
0000  01 FF 50 3A 00 00 00 00 00 36 38 58 49 50 58 32    ..P:.....68XIPX2
0010  44 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00    D...............
0020  00 00 00 00 00 00 00 00 00 55 53 41 00 55 6E 69    .........USA.Uni
0030  74 65 64 20 53 74 61 74 65 73 00                  ted States.

4  63.240.202.139:6112  192.168.1.105:2514  8  Recv 
0000  FF 25 08 00 94 D7 38 21                            .%....8!

5  63.240.202.139:6112  192.168.1.105:2514  104  Recv 
0000  FF 50 68 00 00 00 00 00 56 AD E9 10 EB 89 25 00    .Ph.....V.....%.
0010  00 4D 89 7E 99 CB C6 01 76 65 72 2D 49 58 38 36    .M.~....ver-IX86
0020  2D 36 2E 6D 70 71 00 42 3D 32 37 36 32 36 32 37    -6.mpq.B=2762627
0030  39 33 37 20 41 3D 31 35 34 37 34 37 34 38 30 31    937 A=1547474801
0040  20 43 3D 33 37 37 34 34 32 36 35 36 32 20 34 20    C=3774426562 4
0050  41 3D 41 2B 53 20 42 3D 42 5E 43 20 43 3D 43 5E    A=A+S B=B^C C=C^
0060  41 20 41 3D 41 2B 42 00                            A A=A+B.

6  192.168.1.105:2513  63.161.183.205:9367  114  Send 
0000  72 00 1A 05 00 00 00 00 00 00 00 20 6B 43 03 32    r.......... kC.2
0010  39 38 30 35 34 36 35 20 32 31 32 32 39 32 37 33    9805465 21229273
0020  36 30 76 65 72 2D 49 58 38 36 2D 36 2E 6D 70 71    60ver-IX86-6.mpq
0030  00 42 3D 32 37 36 32 36 32 37 39 33 37 20 41 3D    .B=2762627937 A=
0040  31 35 34 37 34 37 34 38 30 31 20 43 3D 33 37 37    1547474801 C=377
0050  34 34 32 36 35 36 32 20 34 20 41 3D 41 2B 53 20    4426562 4 A=A+S
0060  42 3D 42 5E 43 20 43 3D 43 5E 41 20 41 3D 41 2B    B=B^C C=C^A A=A+
0070  42 00                                              B.

7  63.161.183.205:9367  192.168.1.105:2513  58  Recv 
0000  3A 00 1A 01 00 00 00 00 0B 00 01 A2 F0 9E 0F 47    :..............G
0010  61 6D 65 2E 65 78 65 20 30 38 2F 31 37 2F 30 35    ame.exe 08/17/05
0020  20 30 31 3A 31 32 3A 33 37 20 32 31 32 39 39 32    01:12:37 212992
0030  30 00 20 6B 43 03 0B 00 00 00                      0. kC.....

'0x0C removed

10  192.168.1.105:2514  63.240.202.139:6112  118  Send 
0000  FF 25 08 00 94 D7 38 21 FF 51 6E 00 20 6B 43 03    .%....8!.Qn. kC.
0010  00 0B 00 01 A2 F0 9E 0F 02 00 00 00 00 00 00 00    ................
0020  10 00 00 00 10 00 00 00 0A 00 00 00 B7 C5 7A 00    ..............z.
0030  00 00 00 00 4F 0B D3 19 76 92 8C 36 B1 99 17 AC    ....O...v..6....
0040  17 AC 0E 19 45 13 F0 C9 10 00 00 00 47 61 6D 65    ....E.......Game
0050  2E 65 78 65 20 30 38 2F 31 37 2F 30 35 20 30 31    .exe 08/17/05 01
0060  3A 31 32 3A 33 37 20 32 31 32 39 39 32 30 00 4A    :12:37 2129920.J
0070  61 71 75 69 6F 00                                  aquio.

11  63.240.202.139:6112  192.168.1.105:2514  9  Recv 
0000  FF 51 09 00 03 02 00 00 00                        .Q.......
[/code]

Anyidea what is wrong there?
February 7, 2007, 7:51 PM
BreW
You should have said d2 realm logon. There is an entire different set of packets for that. And no, you can still use BNCSUtil's method of getting a checksum by making a message digest of the three "hash" files. So you don't need BNLS at all. If you're are thinking of 0x09, 0x18, or the 0x1A, that's a different story.
February 7, 2007, 8:47 PM
Myndfyr
[quote author=Jaquio link=topic=16261.msg164226#msg164226 date=1170877871]
Anyidea what is wrong there?
[/quote]
Yes.  Error code 0x203: wrong product.

[code]
10  192.168.1.105:2514  63.240.202.139:6112  118  Send  
0000  FF 25 08 00 94 D7 38 21 FF 51 6E 00 20 6B 43 03    .%....8!.Qn. kC.
0010  00 0B 00 01 A2 F0 9E 0F 02 00 00 00 00 00 00 00    ................
0020  10 00 00 00 10 00 00 00 0A 00 00 00 B7 C5 7A 00    ..............z.
0030  00 00 00 00 4F 0B D3 19 76 92 8C 36 B1 99 17 AC    ....O...v..6....
0040  17 AC 0E 19 45 13 F0 C9 10 00 00 00 47 61 6D 65    ....E.......Game
0050  2E 65 78 65 20 30 38 2F 31 37 2F 30 35 20 30 31    .exe 08/17/05 01
0060  3A 31 32 3A 33 37 20 32 31 32 39 39 32 30 00 4A    :12:37 2129920.J
0070  61 71 75 69 6F 00                                  aquio.
[/code]
Breaking down 0x51 into components:
0x03436b20 - client token.  
0x01000b00 - EXE version.
0x0f9ef0a2 - EXE hash.  
0x00000002 - keys in this packet.  
0x00000000 - using spawn.  

[Key 1]
0x00000010 - key length.  
0x00000010 - key product.  
0x0000000a - key public.  
0x007ac5b7 - unknown (should be 0).  
00 00 00 00 - 4F 0B D3 19 - 76 92 8C 36 - B1 99 17 AC - 17 AC 0E 19 - key hash.  

[Key 2]
0xc9f01345 - key length key 2.  
0x00000010 - key product key 2.
[Omitted] Key public, unknown, key hash (7 DWORDs).

[0x4c-0x6e] EXE information
[0x6f-0x75] CD key owner

Looks like you're missing quite a bit of data.
February 7, 2007, 8:55 PM
Jaquio
What should Key Product and Key public be set as? And where do they come from?
February 7, 2007, 9:14 PM
BreW
....You're using BNCSUtil.dll, right?
Try using kd_quick(). -_-
[code]Public Declare Function kd_quick Lib "bncsutil.dll" _
(ByVal CDKey As String, ByVal ClientToken As Long, _
ByVal ServerToken As Long, PublicValue As Long, Product As Long, _
ByVal HashBuffer As String, ByVal BufferLen As Long) As Long
[/code]
February 7, 2007, 11:17 PM
Myndfyr
[quote author=BreW link=topic=16261.msg164242#msg164242 date=1170890254]
....You're using BNCSUtil.dll, right?
Try using kd_quick(). -_-
[/quote]

I think it's pretty obvious that he's been using BNLS up to this point....

Investigate BNLS_CDKEY and BNLS_CDKEY_EX.
February 7, 2007, 11:18 PM
BreW
I thought he was only using BNLS for the checksum. Bah... Anyways you should use the BNLS 0x01, I forget, but I think it goes like
The 3-byte header
The cookie (any value DWORD)
And the CDKey as an NT string.
February 7, 2007, 11:21 PM
Myndfyr
[quote author=BreW link=topic=16261.msg164245#msg164245 date=1170890518]
I thought he was only using BNLS for the checksum.[/quote]

So you missed his first post?

[quote author=Jaquio link=topic=16261.msg164200#msg164200 date=1170820798]
So could someone tell me that exact packets to send including BNLS packets?
[/quote]
February 7, 2007, 11:41 PM
Jaquio
[quote author=MyndFyre[vL] link=topic=16261.msg164243#msg164243 date=1170890332]
Investigate BNLS_CDKEY and BNLS_CDKEY_EX.
[/quote]

They both return the same thing? The Hashed CDKey data but 0x0C returns the Session key. Which I have no clue what it is used for...

[code]
'Recv'd 0x0C
                .rDWORD
                intI = .rBYTE
                intX = .rBYTE
                .rDWORD

                If intX = 2 Then
                    BD.CDKeySes1 = .rDWORD
                    BD.CDKeyHash1 = .rVOID(36)
                    BD.CDKeySes2 = .rDWORD
                    BD.CDKeyHash2 = .rVOID(36)
                Else
                    BD.CDKeySes1 = .rDWORD
                    BD.CDKeyHash1 = .rVOID(36)
                End If

                .InsertDWORD BD.ClientToken '(DWORD)      Client Token
                .InsertDWORD BD.Version '(DWORD)      EXE Version
                .InsertDWORD BD.Checksum '(DWORD)      EXE Hash
                .InsertDWORD &H2 '(DWORD)      Number of keys in this packet
                .InsertDWORD &H0 '(BOOLEAN)    Using Spawn (32-bit)
               
                'For Each Key:
                .InsertDWORD Len(BD.CDKey1) '(DWORD)      Key Length
                '(DWORD)      CD key's product value
                '(DWORD)      CD key's public value
                '.InsertDWORD &H0 '(DWORD)      Unknown (0)
                .InsertNonNTString BD.CDKeyHash1 '(DWORD[5])  Hashed Key Data
               
                .InsertDWORD Len(BD.CDKey2) '(DWORD)      Key Length
                '.InsertDWORD &H0 '(DWORD)      Unknown (0)
                .InsertNonNTString BD.CDKeyHash2 '(DWORD[5])  Hashed Key Data
               
                .InsertNTString BD.EXEInfo '(STRING)    Exe Information
                .InsertNTString "Jaquio" '(STRING)    CD Key owner name
                .SendBNCSPacket &H51

'Sent 0x0C
            Case &H1A
                If .rDWORD > 0 Then
                    BD.Version = .rDWORD
                    BD.Checksum = .rDWORD
                    BD.EXEInfo = .rNTString
                    .rDWORD 'Cookie
                    .rDWORD 'Verbyte

                    .InsertDWORD BD.ClientToken
                    .InsertBYTE 2
                    .InsertDWORD &H1
                    .InsertDWORD BD.ServerToken
                    .InsertDWORD BD.ServerToken
                    .InsertNTString BD.CDKey1
                    .InsertNTString BD.CDKey2
                    .SendBNLSPacket &HC
                   
                Else
                    Debug.Print GetPacketName(strPID, "BNLS") & " FAILED!"
                    GlobalDisc
                End If
[/code]
February 7, 2007, 11:49 PM
BreW
I'm not sure what the "Session Key" is, but it sounds like a "cookie" in most bnls packets, and in bncs profile requests, it's called a session key too. basically its just no specific value which is echo'd back in the S > C packet.
February 7, 2007, 11:55 PM
Skywing
[quote author=Jaquio link=topic=16261.msg164249#msg164249 date=1170892185]
They both return the same thing? The Hashed CDKey data but 0x0C returns the Session key. Which I have no clue what it is used for...
[/quote]

Did you read the documentation in the BNLS protocol specification (linked previously by MyndFyre) as it pertains to BNLS_CDKEY and BNLS_CDKEY_EX (in particular)?  It makes clear what the usage of that field is.

Virtually all of the questions that have been asked in this thread could have been solved easier (and much faster!) by simply taking five or ten minutes to read the BNLS protocol specification and the BnetDocs documentation relating to Battle.net logon.

Clever readers may note that it would be to their advantage to spend a couple of minutes researching the available documentation instead of wasting a day or more on rehash forum posts of previously covered topics.

In general, you'll get much further much faster in programming (and life) if you do a bit of research on your own before relying on others to give you the information that you believe you need.
February 8, 2007, 1:55 AM
Myndfyr
[quote author=Skywing link=topic=16261.msg164268#msg164268 date=1170899704]
Virtually all of the questions that have been asked in this thread could have been solved easier (and much faster!) by simply taking five or ten minutes to read the BNLS protocol specification and the BnetDocs documentation relating to Battle.net logon.[/quote]

I'm glad you said so Skywing.  I feel like it validated the fact that I posted the URL.
February 8, 2007, 3:11 AM
Jaquio
[quote author=Skywing link=topic=16261.msg164268#msg164268 date=1170899704]
[quote author=Jaquio link=topic=16261.msg164249#msg164249 date=1170892185]
They both return the same thing? The Hashed CDKey data but 0x0C returns the Session key. Which I have no clue what it is used for...
[/quote]

Did you read the documentation in the BNLS protocol specification (linked previously by MyndFyre) as it pertains to BNLS_CDKEY and BNLS_CDKEY_EX (in particular)?  It makes clear what the usage of that field is.
[/quote]

How is that when it says the same shit BNetDocs does? Am I missing something?

[quote author=BNLS Protocol Spec]
BNLS_CDKEY_EX (0x0c)
--------------------

This message will encrypt your CD-key or CD-keys using the given flags.

(DWORD) Cookie. This value has no special meaning to the server and will simply be echoed to the client in the response.
(BYTE) Amount of CD-keys to encrypt. Must be between 1 and 32.
(DWORD) Flags.*
(DWORD or DWORDs) Server session key(s), depending on the flags.
(Optional DWORD or DWORDs) Client session key(s), depending on the flags.
(String or strings) CD-keys. No dashes or spaces. The client can use multiple types of CD-keys in the same packet.

* The flags may be zero, or any bitwise combination of the defined flags.
Currently, the following flags are defined:

#define CDKEY_SAME_SESSION_KEY          (0x01)
#define CDKEY_GIVEN_SESSION_KEY         (0x02)
#define CDKEY_MULTI_SERVER_SESSION_KEYS (0x04)
#define CDKEY_OLD_STYLE_RESPONSES       (0x08)

CDKEY_SAME_SESSION_KEY (0x01):
This flag specifies that all the returned CD-keys will use the same client session key.
When used in combination with CDKEY_GIVEN_SESSION_KEY (0x02), a single client session key is specified immediately after the server session key(s).
When used without CDKEY_GIVEN_SESSION_KEY (0x02), a client session key isn't sent in the request, and the server will create one.
When not used, each CD-key gets its own client session key.
This flag has no effect if the amount of CD-keys to encrypt is 1.

CDKEY_GIVEN_SESSION_KEY (0x02):
This flag specifies that the client session keys to be used are specified in the request.
When used in combination with CDKEY_SAME_SESSION_KEY (0x01), a single client session key is specified immediately after the server session key(s).
When used without CDKEY_SAME_SESSION_KEY (0x01), an array of client session keys (as many as the amount of CD-keys) is specified.
When not used, client session keys aren't included in the request.

CDKEY_MULTI_SERVER_SESSION_KEYS (0x04):
This flag specifies that each CD-key has its own server session key.
When specified, an array of server session keys (as many as the amount of CD-keys) is specified.
When not specified, a single server session key is specified.
This flag has no effect if the amount of CD-keys to encrypt is 1.

CDKEY_OLD_STYLE_RESPONSES (0x08):
Specifies that the response to this packet is a number of BNLS_CDKEY (0x01) responses, instead of a BNLS_CDKEY_EX (0x0c) response.
The responses are guaranteed to be in the order of the CD-keys' appearance in the request.
Note that when this flag is specified, the Cookie cannot be echoed. (It must still be included in the request.)



Note: When using Lord of Destruction, two CD-keys are encrypted, and they must share the same client session key.
There are several ways to do this:
One way is to provide both CD-keys in BNLS_CDKEY_EX (0x0c) using the flag CDKEY_SAME_SESSION_KEY (0x01).
Another way is to use BNLS_CDKEY (0x01) to encrypt the first CD-key, then use BNLS_CDKEY_EX (0x0c) using the flag CDKEY_GIVEN_SESSION_KEY (0x02) to encrypt the second CD-key with the same client session key.



Response:
---------

When the flags don't contain CDKEY_OLD_STYLE_RESPONSES (0x08), the response is a BNLS_CDKEY_EX (0x0c) message:

(DWORD) Cookie. Same as the value sent to the server in the request.
(BYTE) Amount of CD-keys that were requested.
(BYTE) Amount of CD-keys that were successfully encrypted.
(DWORD) Bit mask for the success code of each CD-key. Each bit of the 32 bits in this DWORD is 1 for success or 0 for failure. The least significant bit specifies the success code of the first CD-key provided. Bits that exceed the amount of CD-keys provided are set to 0.

The following fields repeat for each successful CD-key (they do not exist for failed CD-keys):

(DWORD) Client session key.
(9 DWORDs) CD-key data.
[/quote]

Where does it say what it is used for? I have never set Key Public and Key Product before. It has worked fine, but now it don't.

[code]
Connected to bnls.valhallalegends.com:9367
Sent:BNLS_REQUESTVERSIONBYTE(0x10)
Received:BNLS_REQUESTVERSIONBYTE(0x10)
Connected to useast.battle.net:6112
Sent:SID_AUTH_INFO(0x50)
Received:SID_PING(0x25)
Sent:SID_PING(0x25)
Received:SID_AUTH_INFO(0x50)
Sent:BNLS_VERSIONCHECKEX2(0x1A)
Received:BNLS_VERSIONCHECKEX2(0x1A)
Sent:BNLS_CDKEY_EX(0x0C)
Received:BNLS_CDKEY_EX(0x0C)
Sent:SID_AUTH_CHECK(0x51)
Received:SID_AUTH_CHECK(0x51)
CDKey is for wrong product!
GLOBAL DISCONNECT!
[/code]

And..

[code]
Public Function PBNET(strData As String, lngLength As Long)
Dim strPID As Byte, lngPLen As Long, strExtra As String
    With PD
        lngPLen = 0
        .SetData strData
       
        If .rBYTE = &HFF Then
            strPID = .rBYTE 'PacketID
            Debug.Print "Received:" & GetPacketName(strPID, "BNCS") & "(" & Hex(strPID) & ")"
            lngPLen = .rWORD 'Packet Length
           
            If lngLength > lngPLen Or lngPLen > lngLength Then
                If lngLength > lngPLen Then
                    strExtra = Right(strData, (lngLength - lngPLen))
                Else
                    strExtra = Right(strData, (lngPLen - lngLength))
                End If
            End If
        End If
       
        Select Case strPID
            Case &H25
                .InsertDWORD .rDWORD
                .SendBNCSPacket &H25
               
            Case &H50
                If .rDWORD = 0 Then BD.UseNLS = False Else BD.UseNLS = True 'Logon Type
                BD.ServerToken = .rDWORD 'ServerToken
                BD.UDPValue = .rDWORD 'UDPValue
                BD.MPQFT = .rFILETIME(True)  'MPQ Filetime
                BD.MPQName = .rNTString 'MPQ Filename
                BD.ValueString = .rNTString 'ValueString
               
                .InsertDWORD &H5
                .InsertDWORD &H0
                .InsertDWORD BD.ClientToken
                .InsertNonNTString BD.MPQFT
                .InsertNTString BD.MPQName
                .InsertNTString BD.ValueString
                .SendBNLSPacket &H1A
            Case &H51
                Select Case .rDWORD
                    Case &H0
                        Debug.Print "Success!"
                    Case &H100
                        Debug.Print "Old Game Version!"
                        GlobalDisc
                    Case &H101
                        Debug.Print "Invalid Version!"
                        GlobalDisc
                    Case &H102
                        Debug.Print "Game version must be downgraded!"
                        GlobalDisc
                    Case &H200
                        Debug.Print "Invalid CDKey!"
                        GlobalDisc
                    Case &H201
                        Debug.Print "CDKey is in use by " & .rNTString
                        GlobalDisc
                    Case &H202
                        Debug.Print "CDKey is banned!"
                        GlobalDisc
                    Case &H203
                        Debug.Print "CDKey is for wrong product!"
                        GlobalDisc
                End Select
        End Select
    End With

    If Len(strExtra) >= 1 Then
        PBNET strExtra, Len(strExtra)
    End If
End Function

Public Function PBNLS(strData As String, lngLength As Long)
Dim strPID As Byte, lngPLen As Long, strExtra As String, intI As Integer, intX As Integer, intY As Integer
    With PD
        lngPLen = 0
        .SetData strData

        lngPLen = .rWORD
        strPID = .rBYTE
        Debug.Print "Received:" & GetPacketName(strPID, "BNLS") & "(" & Hex(strPID) & ")"
       
        If lngLength > lngPLen Or lngPLen > lngLength Then
            If lngLength > lngPLen Then
                strExtra = Right(strData, (lngLength - lngPLen))
            Else
                strExtra = Right(strData, (lngPLen - lngLength))
            End If
        End If
       
        Select Case strPID
            Case &HC
                .rDWORD
                intI = .rBYTE
                intX = .rBYTE
                .rDWORD

                If intX = 2 Then
                    BD.CDKeySes1 = .rDWORD
                    BD.CDKeyHash1 = .rVOID(36)
                    BD.CDKeySes2 = .rDWORD
                    BD.CDKeyHash2 = .rVOID(36)
                Else
                    BD.CDKeySes1 = .rDWORD
                    BD.CDKeyHash1 = .rVOID(36)
                End If
               
                .InsertDWORD BD.ClientToken '(DWORD)      Client Token
                .InsertDWORD BD.Version '(DWORD)      EXE Version
                .InsertDWORD BD.Checksum '(DWORD)      EXE Hash
                .InsertDWORD &H2 '(DWORD)      Number of keys in this packet
                .InsertDWORD &H0 '(BOOLEAN)    Using Spawn (32-bit)
               
                'For Each Key:
                .InsertDWORD Len(BD.CDKey1) '(DWORD)      Key Length
                '.InsertDWORD &H10 '(DWORD)      CD key's product value
                '.InsertDWORD &HA '(DWORD)      CD key's public value
                '.InsertDWORD &H0 '(DWORD)      Unknown (0)
                .InsertNonNTString BD.CDKeyHash1 '(DWORD[5])   Hashed Key Data
               
                .InsertDWORD Len(BD.CDKey2) '(DWORD)      Key Length
                '.InsertDWORD &H11 '(DWORD)      CD key's product value
                '.InsertDWORD &HA '(DWORD)      CD key's public value
                '.InsertDWORD &H0 '(DWORD)      Unknown (0)
                .InsertNonNTString BD.CDKeyHash2 '(DWORD[5])   Hashed Key Data
               
                .InsertNTString BD.EXEInfo '(STRING)     Exe Information
                .InsertNTString "Jaquio" '(STRING)     CD Key owner name
                .SendBNCSPacket &H51
            Case &H10
                If .rDWORD > 0 Then
                    BD.VersionByte = .rDWORD
                    frmMain.sckBNET.Connect BD.BNETServ, 6112
                Else
                    Debug.Print GetPacketName(strPID, "BNLS") & " FAILED!"
                    GlobalDisc
                End If
            Case &H1A
                If .rDWORD > 0 Then
                    BD.Version = .rDWORD
                    BD.Checksum = .rDWORD
                    BD.EXEInfo = .rNTString
                    .rDWORD 'Cookie
                    .rDWORD 'Verbyte

                    .InsertDWORD BD.ClientToken
                    .InsertBYTE 2
                    .InsertDWORD &H0
                    .InsertDWORD BD.ServerToken
                    '.InsertDWORD BD.ServerToken
                    .InsertNTString BD.CDKey1
                    .InsertNTString BD.CDKey2
                    .SendBNLSPacket &HC
                   
                Else
                    Debug.Print GetPacketName(strPID, "BNLS") & " FAILED!"
                    GlobalDisc
                End If
        End Select
    End With
   
    If Len(strExtra) >= 1 Then
        PBNLS strExtra, Len(strExtra)
    End If
End Function
[/code]

Could someone help me? So I could know what not to do next time. For one I know you will all say, "Don't use Visual Basic" but you know what? I happen to like it... I know C/C++ but just not enough which is why I am LEARNING. Anyways... Could someone help me get to the problem here? I am sorry I am not as smart of as everyone else... But atleast I am TRYING to learn stuff here...
February 8, 2007, 3:51 AM
Myndfyr
[quote author=Jaquio link=topic=16261.msg164284#msg164284 date=1170906663]
Could someone help me? So I could know what not to do next time. For one I know you will all say, "Don't use Visual Basic" but you know what? I happen to like it... I know C/C++ but just not enough which is why I am LEARNING. Anyways... Could someone help me get to the problem here? I am sorry I am not as smart of as everyone else... But atleast I am TRYING to learn stuff here...
[/quote]
It certainly does not look like you're "TRYING" to learn stuff here.

[quote author=Jaquio link=topic=16261.msg164284#msg164284 date=1170906663]
[quote author=Skywing link=topic=16261.msg164268#msg164268 date=1170899704]
[quote author=Jaquio link=topic=16261.msg164249#msg164249 date=1170892185]
They both return the same thing? The Hashed CDKey data but 0x0C returns the Session key. Which I have no clue what it is used for...
[/quote]

Did you read the documentation in the BNLS protocol specification (linked previously by MyndFyre) as it pertains to BNLS_CDKEY and BNLS_CDKEY_EX (in particular)?  It makes clear what the usage of that field is.
[/quote]

How is that when it says the same shit BNetDocs does? Am I missing something?
[/quote]
Have you read what BnetDocs says the session keys are?  There are two of them - the client and server tokens:

Client token: "A 32-bit value, decided by the client, which is included in the input hash functions to improve their security.  Many developers use the GetTickCount API to retrieve a suitable value for this field."
Server token: "A 32-bit value, decided by the server, which is included in the input hash functions to improve their security."

If you look at 0x51 C->S, you'll see that for each key, there are 9 DWORD values.  Curiously, the BNLS_CDKEY_EX packet indicates that there are 9 DWORD values provided, labeled "CD key data".  I just wonder....

The BNLS connection sequence is well-documented in the BNLS protocol specification.  To again let you know where this is, it's http://www.valhallalegends.com/yoni/BNLSProtocolSpec.txt.
February 8, 2007, 4:38 AM
Jaquio
Okay... I think I get it now. Are the 9 dwords sent back still in the same order for 0x51, or what is the order of the 9Dwords? It is not in the bnls proto spec.. I looked..
February 9, 2007, 1:38 AM
UserLoser
[quote author=Jaquio link=topic=16261.msg164349#msg164349 date=1170985116]
Okay... I think I get it now. Are the 9 dwords sent back still in the same order for 0x51, or what is the order of the 9Dwords? It is not in the bnls proto spec.. I looked..
[/quote]

Yes..they're sent back in the correct order
February 9, 2007, 1:51 AM

Search