Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: PaiD on February 16, 2004, 12:29 AM

Title: [VB] 0x31 Problem
Post by: PaiD on February 16, 2004, 12:29 AM
I just cant get this right. I am using bnetauth.dll


Public Declare Function X Lib "bnetauth.dll" (ByVal outbuf As String, ByVal Password As String) As Long



Public Function SendChangePassword(OldPass As String, NewPass As String)
Dim AccountHash As String
Dim AccountHash2 As String
Dim ClientKey As Long
ClientKey = GetTickCount()
   AccountHash = String(5 * 4, vbNullChar)
   AccountHash2 = String(5 * 4, vbNullChar)
   X AccountHash, LCase(NewPass)
   X AccountHash2, LCase(OldPass)
   X AccountHash2, Pbuffer.MKL(ClientKey) & Pbuffer.MKL(Servers) & AccountHash2
       With Pbuffer
           .InsertDWORD ClientKey
           .InsertDWORD Servers
           .InsertNonNTString AccountHash2
           .InsertNonNTString AccountHash
           .InsertNTString Bot.Username
           .sendPacket &H31
       End With
       AddC vbGreen, "Sent 0x31. I hope no ipbans."
End Function


I dont get ipbanned, but it always fails.
Title: Re:[VB] 0x31 Problem
Post by: Eric on February 16, 2004, 01:59 PM
Quote
0x31

Direction: Client -> Server (Sent)

(DWORD)        Client Token
(DWORD)        Server Token
(DWORD[5])    Old password hash
(DWORD[5])    New password hash
(STRING)         Account name

Changes Battle.net account password. This packet must be sent before entering chat.

Passwords should be converted to lower case before hashing.
Title: Re:[VB] 0x31 Problem
Post by: PaiD on February 16, 2004, 02:55 PM
Userloser: It was first.


Public Function SendChangePassword(OldPass As String, NewPass As String)
Dim AccountHash As String
Dim AccountHash2 As String
Dim ClientKey As Long
ClientKey = GetTickCount()
   AccountHash = String(5 * 4, vbNullChar)
   AccountHash2 = String(5 * 4, vbNullChar)
   X AccountHash, LCase(OldPass)
   X AccountHash2, LCase(NewPass)
       With Pbuffer
           .InsertDWORD ClientKey
           .InsertDWORD Servers
           .InsertNonNTString AccountHash
           .InsertNonNTString AccountHash2
           .InsertNTString Bot.Username
           .sendPacket &H31
       End With
       AddC vbGreen, "Sent 0x31. I hope no ipbans."
End Function

Ok I sent it the way bnetdocs says( I think). But it is still failing. Do I double hash the passwords?
Title: Re:[VB] 0x31 Problem
Post by: Eric on February 16, 2004, 05:07 PM
You're not sending any information for the server token?
Title: Re:[VB] 0x31 Problem
Post by: UserLoser. on February 16, 2004, 05:17 PM
Quote from: MoNeY on February 16, 2004, 02:55 PM
Userloser: It was first.


Public Function SendChangePassword(OldPass As String, NewPass As String)
Dim AccountHash As String
Dim AccountHash2 As String
Dim ClientKey As Long
ClientKey = GetTickCount()
   AccountHash = String(5 * 4, vbNullChar)
   AccountHash2 = String(5 * 4, vbNullChar)
   X AccountHash, LCase(OldPass)
   X AccountHash2, LCase(NewPass)
       With Pbuffer
           .InsertDWORD ClientKey
           .InsertDWORD Servers
           .InsertNonNTString AccountHash
           .InsertNonNTString AccountHash2
           .InsertNTString Bot.Username
           .sendPacket &H31
       End With
       AddC vbGreen, "Sent 0x31. I hope no ipbans."
End Function

Ok I sent it the way bnetdocs says( I think). But it is still failing. Do I double hash the passwords?

New password is hashed once, with out any client/server keys
Old password is hashed twice, with client/server key