Valhalla Legends Forums Archive | Battle.net Bot Development | [VB] 0x31 Problem

AuthorMessageTime
PaiD
I just cant get this right. I am using bnetauth.dll

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

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

I dont get ipbanned, but it always fails.
February 16, 2004, 6:29 AM
LoRd
[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.
[/Quote]
February 16, 2004, 7:59 PM
PaiD
Userloser: It was first.

[code]
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
[/code]
Ok I sent it the way bnetdocs says( I think). But it is still failing. Do I double hash the passwords?
February 16, 2004, 8:55 PM
LoRd
You're not sending any information for the server token?
February 16, 2004, 11:07 PM
UserLoser.
[quote author=MoNeY link=board=17;threadid=5316;start=0#msg44627 date=1076964905]
Userloser: It was first.

[code]
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
[/code]
Ok I sent it the way bnetdocs says( I think). But it is still failing. Do I double hash the passwords?
[/quote]

New password is hashed once, with out any client/server keys
Old password is hashed twice, with client/server key
February 16, 2004, 11:17 PM

Search