Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Feanor on October 14, 2003, 01:22 AM

Title: 0x31 Change Password Help
Post by: Feanor on October 14, 2003, 01:22 AM
Hello. I could use some help with the 0x31 [change password] packet. I am coding in VB6 and using BnetAuth.dll.

This is what I have so far:


Public Sub SendChangePassword()
Dim Result As Boolean
Dim AccountHash As String
Dim Result2 As Boolean
Dim ClientKEY As Long
Dim AccountHash2 As String

   AccountHash = String(5 * 4, vbNullChar)
   Result = X(AccountHash, varPassword)
   ClientKEY = GetTickCount()
   AccountHash2 = String(5 * 4, vbNullChar)
   Result2 = X(AccountHash2, varNewPass)
   Result2 = X(AccountHash2, X2(ClientKEY) & X2(ServerKey) & 'X2 = Argument Not optionalAccountHash2)
   AccountHash2 = X(ClientKEY) & X2(ServerKey) & AccountHash2 'X2 = Argument Not optional
   
   If Result = True And Result2 = True Then
       InsertDWORD ClientKEY
       InsertDWORD ServerKey
       InsertNonNTString AccountHash2
       InsertNonNTString AccountHash
       InsertNTString varAccount
       SendPacket &H31
   Else
       AddChat frmMain.rtbChat, vbRed, "Password change failed, Could not hash!!!"
       frmMain.Winsock.Close
   End If
End Sub


However, something along the marked lines doesn't work with BnetAuth.dll. Does anyone know how to correct this problem?
Any help is greatly appriciated!
Title: Re:0x31 Change Password Help
Post by: Arta on October 14, 2003, 06:56 AM
Looks like this line is wrong:


Result2 = X(AccountHash2, X2(ClientKEY) & X2(ServerKey) & 'X2 = Argument Not optionalAccountHash2)


I don't know VB but i'd suggest:


Result2 = X(AccountHash2, X2(ClientKEY) & X2(ServerKey))


That last '&' before the comment looks wrong to me.
Title: Re:0x31 Change Password Help
Post by: Dark-Feanor on October 14, 2003, 01:21 PM
Why are you posting under my handle?
Title: Re:0x31 Change Password Help
Post by: UserLoser on October 14, 2003, 05:54 PM
Quote from: DaRk-FeAnOr on October 14, 2003, 01:21 PM
Why are you posting under my handle?


Haha, a wannabe Feanor.  All the fake UserLoser's are gone now that i have UserLoser on both East, and West, along with Europe/Asia.  With the only exception of UserLoser@Lordaeron.
Title: Re:0x31 Change Password Help
Post by: hismajesty on October 14, 2003, 06:54 PM
It is eRRoR notice the post is similar? Just an extra reason why he sucks.  :-\
Title: Re:0x31 Change Password Help
Post by: Feanor on October 14, 2003, 07:13 PM
I still can't get this to work. How do I get the ServerKey and what is it?
Does anyone send 0x31 on their bot and know how to do this?
Title: Re:0x31 Change Password Help
Post by: iago on October 14, 2003, 07:31 PM
Quote from: Feanor on October 14, 2003, 07:13 PM
I still can't get this to work. How do I get the ServerKey and what is it?
Does anyone send 0x31 on their bot and know how to do this?

The server sends you the serverkey in either 0x50 or 0x51, I forget which exactly.
Title: Re:0x31 Change Password Help
Post by: Lenny on October 15, 2003, 03:38 PM
Quote from: DaRk-FeAnOr on October 14, 2003, 01:21 PM
Why are you posting under my handle?

It's not as if you created the actual original name Feanor. (Silmarillion)
Title: Re:0x31 Change Password Help
Post by: UserLoser on October 15, 2003, 03:43 PM
Quote from: iago on October 14, 2003, 07:31 PM
The server sends you the serverkey in either 0x50 or 0x51, I forget which exactly.

0x50