Valhalla Legends Forums Archive | Battle.net Bot Development | BNLS - Little trouble connecting..CDKey Problem

AuthorMessageTime
Networks
[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?
June 2, 2004, 10:21 PM
hismajesty
Possibly an invalid cdkey.
June 2, 2004, 10:26 PM
CrAz3D
It'd probably be easier to post the code now, it's most likely gonna be needed.

Idea: try a different server?
June 2, 2004, 10:26 PM
Networks
Does this help?

[code]
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
[/code]

[code]
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
[/code]
June 2, 2004, 10:31 PM
Lobo.id
You might want to post your SID_AUTH_CHECK(0x51) code too.
June 2, 2004, 10:41 PM
Networks
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.
June 2, 2004, 10:47 PM
Twix
this may be a crazy idea but how about u check the key on another bot and see if it works
June 2, 2004, 11:04 PM
LordNevar
[quote author=Networks link=board=17;threadid=7079;start=0#msg63326 date=1086214916]

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?
[/quote]

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.
June 2, 2004, 11:39 PM
Twix
[quote author=hismajesty[yL] link=board=17;threadid=7079;start=0#msg63328 date=1086215165]
Possibly an invalid cdkey.
[/quote]

sorry i dident see that and then i seen that post and taught he dident check it
June 2, 2004, 11:46 PM
Myndfyr
[quote author=Twix link=board=17;threadid=7079;start=0#msg63350 date=1086220003]
[quote author=hismajesty[yL] link=board=17;threadid=7079;start=0#msg63328 date=1086215165]
Possibly an invalid cdkey.
[/quote]

sorry i dident see that and then i seen that post and taught he dident check it
[/quote]

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).
June 3, 2004, 12:04 AM
LordNevar
I would have to agree with Myndfyre.
June 3, 2004, 12:12 AM
Eli_1
[quote author=Myndfyre link=board=17;threadid=7079;start=0#msg63351 date=1086221083]
Also, what is the value of the GTC variable just before you send 0x51? [/quote]

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

[edit] I'm probably wrong. :'(
June 3, 2004, 12:19 AM
Myndfyr
[quote author=Eli_1 link=board=17;threadid=7079;start=0#msg63357 date=1086221940]
[quote author=Myndfyre link=board=17;threadid=7079;start=0#msg63351 date=1086221083]
Also, what is the value of the GTC variable just before you send 0x51? [/quote]

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

No. The client key is part of the hashing part, and when the CD key is encrypted, you need to use the client key.
June 3, 2004, 3:20 AM
BaDDBLooD
Get Token Client?
June 3, 2004, 3:45 AM
Eli_1
Did I have client key confused with client token?
June 3, 2004, 4:15 AM
Networks
I LOVE YOU GUYS BUT I FIXED IT:

[code]
[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 []
[/code]

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
June 3, 2004, 2:55 PM
Myndfyr
Again, why is BNLS getting 0x51? :P
June 3, 2004, 6:31 PM
Networks
oops, fixed it was just addc...
June 3, 2004, 7:21 PM
hismajesty
[quote author=LordNevar link=board=17;threadid=7079;start=0#msg63349 date=1086219591]
[quote author=Networks link=board=17;threadid=7079;start=0#msg63326 date=1086214916]

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?
[/quote]

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.
[/quote]

Not you all, he edited his post after I posted. :)
June 3, 2004, 8:14 PM
Networks
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:

[code]
[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
[/code]

[code]
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.
[/code]


Note: the password, server, username is fine.
June 3, 2004, 8:56 PM
LoRd
War3 doesn't use 0x3A.
June 3, 2004, 9:22 PM
Newby
Packetlog a Warcraft III connection and figure out what packet it uses to login. It's not 0x3A as Lord pointed out. :)
June 3, 2004, 11:02 PM
Myndfyr
[quote author=Newby link=board=17;threadid=7079;start=15#msg63500 date=1086303737]
Packetlog a Warcraft III connection and figure out what packet it uses to login. It's not 0x3A as Lord pointed out. :)
[/quote]

Why bother? The BNLS protocol spec clearly identifies it as 0x53 and 0x54. It's not a secret. ;-)
June 3, 2004, 11:31 PM

Search