Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Networks on June 02, 2004, 05:21 PM

Title: BNLS - Little trouble connecting..CDKey Problem
Post by: Networks on June 02, 2004, 05:21 PM
[3:14:17 PM] BNLS: Connecting...
[3:14:18 PM] BNLS: Connected!
[3:14:18 PM] Received 0x0E
[3:14:18 PM] Received 0x0F
[3:14:18 PM] Product: PXES CDKey: *************
[3:14:18 PM] Received 0x10
[3:14:19 PM] BNET: Connected!
[3:14:19 PM] BNLS: Sent 0x50
[3:14:19 PM] Product: PXES CDKey: *************
[3:14:19 PM] Received 0x09
[3:14:20 PM] Received 0x01
[3:14:20 PM] BNLS: Sent 0x51
[3:14:20 PM] 0x51 Packet Received.
[3:14:20 PM] BNET: Invalid CD-key!

NOTE: The key is valid, I connected using it on a hashed connection.

Now what might be the problem before I send you guys any code at all?
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: hismajesty on June 02, 2004, 05:26 PM
Possibly an invalid cdkey.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: CrAz3D on June 02, 2004, 05:26 PM
It'd probably be easier to post the code now, it's most likely gonna be needed.

Idea: try a different server?
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Networks on June 02, 2004, 05:31 PM
Does this help?


   Case &H9
   AddC Form1.RTB1, True, vbGreen, "Received 0x09"
       version = Val("&H" & StrToHex(StrReverse(Mid(data, 8, 4))))
       version = CLng(version)
       CheckSum = Val("&H" & StrToHex(StrReverse(Mid(data, 12, 4))))
       CheckSum = CLng(CheckSum)
       ExeInfo = Mid(data, 16, Len(data) - 16)
         If varProduct = "PX2D" Then
           With pBuffer
               .InsertDWORD &H0
               .InsertBYTE &H2
               .InsertDWORD &H1
               .InsertDWORD Servers
               .InsertNTString (varCDKey)
               .InsertNTString (D2XPKey)
               .SendBNLSPacket &HC
           End With
         Else
           With pBuffer
              .InsertDWORD Servers
              .InsertNTString (varCDKey)
              .SendBNLSPacket &H1
           End With
         End If



Public Sub Send0x51()
AddC Form1.RTB1, True, vbYellow, "BNLS: Sent 0x51"
   With pBuffer
       .InsertDWORD GTC
       .InsertDWORD version
       .InsertDWORD CheckSum
       If varProduct = "PX2D" Then
           .InsertDWORD &H2
       Else
           .InsertDWORD &H1
       End If
       .InsertDWORD &H0
       .InsertNonNTString CdkeyHash
       If varProduct = "PX2D" Then
           .InsertNonNTString Cdkey2Hash
       End If
       .InsertNTString ExeInfo
       .InsertNTString (varUser)
       .SendPacket &H51
   End With
End Sub
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Lobo on June 02, 2004, 05:41 PM
You might want to post your SID_AUTH_CHECK(0x51) code too.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Networks on June 02, 2004, 05:47 PM
I'd like to know what could cause the problem besides the key actually being invalid. Could my product be wrong, BNLS Version Byte, etc.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: DeTaiLs on June 02, 2004, 06:04 PM
this may be a crazy idea but how about u check the key on another bot and see if it works
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: LordNevar on June 02, 2004, 06:39 PM
Quote from: Networks on June 02, 2004, 05:21 PM

NOTE: The key is valid, I connected using it on a hashed connection.

Now what might be the problem before I send you guys any code at all?

You all need to read closely before you tell him to retry his key, he already stated that he did check to make sure it worked.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: DeTaiLs on June 02, 2004, 06:46 PM
Quote from: hismajesty[yL] on June 02, 2004, 05:26 PM
Possibly an invalid cdkey.

sorry i dident see that and then i seen that post and taught he dident check it
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: MyndFyre on June 02, 2004, 07:04 PM
Quote from: Twix on June 02, 2004, 06:46 PM
Quote from: hismajesty[yL] on June 02, 2004, 05:26 PM
Possibly an invalid cdkey.

sorry i dident see that and then i seen that post and taught he dident check it

i dident tink to reed teh post.

First of all, why does your Send0x51 function add to the display, "BNLS -- 0x51 Sent"?  You're sending it to Bnet, right?

Also, what is the value of the GTC variable just before you send 0x51?  It seems like it should be the Client Session Key provided by BNLS_CDKEY or BNLS_CDKEYEX, and why you would name it GTC is beyond me, unless you're either copying code or just have bizarre naming conventions.

The Client Session Key is provided as the second DWORD of BNLS_CDKEY (0x01) or as the first DWORD of repeating data for each key in BNLS_CDKEYEX (0x0c) (note that there is non-repeating data, a DWORD, a BYTE, a BYTE, and a DWORD before the repeating data begins).
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: LordNevar on June 02, 2004, 07:12 PM
I would have to agree with Myndfyre.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Eli_1 on June 02, 2004, 07:19 PM
Quote from: Myndfyre on June 02, 2004, 07:04 PM
Also, what is the value of the GTC variable just before you send 0x51?  

Maybe the value returned by GetTickCount(). Can't the client key's value be whatever you want it to?

[edit] I'm probably wrong.  :'(
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: MyndFyre on June 02, 2004, 10:20 PM
Quote from: Eli_1 on June 02, 2004, 07:19 PM
Quote from: Myndfyre on June 02, 2004, 07:04 PM
Also, what is the value of the GTC variable just before you send 0x51?  

Maybe the value returned by GetTickCount(). Can't the client key's value be whatever you want it to?

No.  The client key is part of the hashing part, and when the CD key is encrypted, you need to use the client key.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: BaDDBLooD on June 02, 2004, 10:45 PM
Get Token Client?
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Eli_1 on June 02, 2004, 11:15 PM
Did I have client key confused with client token?
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Networks on June 03, 2004, 09:55 AM
I LOVE YOU GUYS BUT I FIXED IT:


[7:53:39 AM] BNLS: Connecting...
[7:53:40 AM] BNLS: Connected!
[7:53:40 AM] Received 0x0E
[7:53:40 AM] Received 0x0F
[7:53:40 AM] Product: PXES CDKey: <NO FREE KEY FOR JOO!>
[7:53:40 AM] Received 0x10
[7:53:41 AM] BNET: Connected!
[7:53:41 AM] BNET: Sent 0x50
[7:53:41 AM] Product: PXES CDKey: <NO FREE KEY FOR JOO!>
[7:53:41 AM] Received 0x09
[7:53:41 AM] BNLS: Sending CDKey...
[7:53:41 AM] Received 0x01
[7:53:41 AM] BNLS: Received CDKey Hash:
[7:53:41 AM] BNLS: Sent 0x51
[7:53:42 AM] 0x51 Packet Received.
[7:53:42 AM] BNET: Version and CD-key check passed!
[7:53:42 AM] 0x14 Sent.
[7:53:42 AM] 0x3A Packet Sent.
[7:53:42 AM] 0x0A Packet Sent.
[7:53:42 AM] Logon Passed.
[7:53:42 AM] Received 0x3A
[7:53:42 AM] Received 0x0A
[7:53:42 AM] Logged on as Networks
[7:53:42 AM] Joined Channel: Op []


I am thinking it was because I didn't make Servers as public and it was private in my parseBNLS and ParseBNET Modules.

But as soon as I made it public it worked perfectly =p
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: MyndFyre on June 03, 2004, 01:31 PM
Again, why is BNLS getting 0x51?  :P
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Networks on June 03, 2004, 02:21 PM
oops, fixed it was just addc...
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: hismajesty on June 03, 2004, 03:14 PM
Quote from: LordNevar on June 02, 2004, 06:39 PM
Quote from: Networks on June 02, 2004, 05:21 PM

NOTE: The key is valid, I connected using it on a hashed connection.

Now what might be the problem before I send you guys any code at all?

You all need to read closely before you tell him to retry his key, he already stated that he did check to make sure it worked.

Not you all, he edited his post after I posted. :)
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Networks on June 03, 2004, 03:56 PM
He's right the only one that had the right to ask was the guy who posted 2nd anyhow.

I am getting any error for war3:


[1:52:24 PM] BNLS: Connecting...
[1:52:24 PM] [BNLS] Connected.
[1:52:25 PM] [BNLS] Received 0x0E
[1:52:25 PM] [BNLS] Received 0x0F
[1:52:25 PM] Product set to: 3RAW
[1:52:26 PM] [BNLS] Received 0x10
[1:52:26 PM] [BNET] Connected.
[1:52:26 PM] [BNET] Sent 0x50
[1:52:26 PM] Product set to: 3RAW
[1:52:27 PM] [BNLS] Received 0x09
[1:52:27 PM] BNLS: Sending CDKey...
[1:52:27 PM] [BNLS] Received 0x01
[1:52:27 PM] BNLS: Received CDKey Hash
[1:52:27 PM] [BNET] Sent 0x51
[1:52:28 PM] 0x51 Packet Received.
[1:52:28 PM] BNET: Version and CD-key check passed!
[1:52:28 PM] [BNLS] Received 0x0B
[1:52:29 PM] [BNLS] Received 0x02
[1:52:29 PM] [BNLS] Received 0x0B
[1:52:29 PM] BNET: Logon failed, Incorrect password.
[1:52:29 PM] Received 0x3A
[1:52:30 PM] [BNLS] Received 0x03



With pBuffer
                   If SPass = True Then
                       .InsertDWORD GTC
                       .InsertDWORD Servers
                       .InsertNonNTString Mid(data, 4, Len(data) - 3)
                       .InsertNTString (Config.Username)
                       .SendPacket &H3A
                       SPass = False
                       CB = 0
                   Else
                       .InsertDWORD GTC
                       .InsertNonNTString Mid(data, 4, Len(data) - 3)
                       .InsertNTString Config.Realm
                       .SendPacket &H3E
                       CB = 0
                   End If
               End With

This is where I think error is caused.



Note: the password, server, username is fine.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Eric on June 03, 2004, 04:22 PM
War3 doesn't use 0x3A.
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: Newby on June 03, 2004, 06:02 PM
Packetlog a Warcraft III connection and figure out what packet it uses to login. It's not 0x3A as Lord pointed out. :)
Title: Re:BNLS - Little trouble connecting..CDKey Problem
Post by: MyndFyre on June 03, 2004, 06:31 PM
Quote from: Newby on June 03, 2004, 06:02 PM
Packetlog a Warcraft III connection and figure out what packet it uses to login. It's not 0x3A as Lord pointed out. :)

Why bother?  The BNLS protocol spec clearly identifies it as 0x53 and 0x54.  It's not a secret.  ;-)