Valhalla Legends Forums Archive | Battle.net Bot Development | Password Change

AuthorMessageTime
Ithien
I've been trying to do the Account-Change send, but I can't find out what one part of it is for.

(DWORD) Client Key
How would i retreieve the client key, and what is it?

I know how to do everything else.

[code]Public Sub SendChangePassword()
Dim Result As Boolean
Dim accountHash As String
accountHash = String(5 * 4, vbNullChar)
Result = X(accountHash, varPass)

Dim Result2 As Boolean
Dim accountHash2 As String
accountHash2 = String(5 * 4, vbNullChar)
Result2 = X(accountHash2, setup.vOPass.text)

If Result = True And Result2 = True Then
'pbuffer.InsertDWORD ClientKey
pbuffer.InsertDWORD ServerKey
pbuffer.InsertNonNTString accountHash2
pbuffer.InsertNonNTString accountHash
pbuffer.InsertNTString varUser
pbuffer.sendPacket &H31
Else
AddChat vbRed, " - Password change failed, Could not hash"
form1.BotDisconnect
End If
'(DWORD) Client Key
'(DWORD) Server Key
'(DWORD[5]) Old password hash
'(DWORD[5]) New password hash
'(STRING) Account name
End Sub[/code]
July 9, 2003, 10:25 PM
Camel
[quote author=JoeCool link=board=17;threadid=1848;start=0#msg14357 date=1057792513]
Now, why are you putting a "change password" on your bot.. ? whynot just have a create account if wrong password?..
[/quote]
Create account is for accounts that don't exist. Change password is for accounts that do.

IIRC, client key is the client key used to hash the old password (it's double hashed)
[code]Result2 = X(accountHash2, setup.vOPass.text)
Result2 = X(accountHash2, MKL(ClientKey) & MKL(ServerKey) & accountHash2)
accountHash2 = MKL(ClientKey) & MKL(ServerKey) & accountHash2[/code]
or use X2 from bnetauth.dll; i forget what the format is [probably just result = X2(accounthash2, clientkey,serverkey,setup.vOPass.text) or something simmilar]

[edit] stupid coding error
July 9, 2003, 11:41 PM
Ithien
Do I still put the 2 dwords before the hash, if I do it the way you did?

And do i just declare a empty ClientKey as a long before doing that, or does it need to contain something?

Do i just set the ServerKey as i normally would?
July 9, 2003, 11:56 PM
Camel
[quote author=Ithien link=board=17;threadid=1848;start=0#msg14370 date=1057794992]
Do I still put the 2 dwords before the hash, if I do it the way you did?

And do i just declare a empty ClientKey as a long before doing that, or does it need to contain something?

Do i just set the ServerKey as i normally would?
[/quote]

Yes.
Use GetTickCount.
Yes.
July 10, 2003, 1:13 AM
Ithien
So i set Clientkey as gettickcount() before i hash the passwords?
July 10, 2003, 5:27 PM
Ithien
Public Sub SendChangePassword()
Dim Result As Boolean
Dim accountHash As String
accountHash = String(5 * 4, vbNullChar)
Result = X(accountHash, varPass)
Dim Result2 As Boolean
Dim ClientKEY As Long
ClientKEY = GetTickCount()
Dim accountHash2 As String
accountHash2 = String(5 * 4, vbNullChar)
Result2 = X(accountHash2, setup.vOPass.text)
Result2 = X(accountHash2, MKL(ClientKEY) & MKL(ServerKey) & accountHash2)
accountHash2 = MKL(ClientKEY) & MKL(ServerKey) & accountHash2
If Result = True And Result2 = True Then
pbuffer.InsertDWORD ClientKEY
pbuffer.InsertDWORD ServerKey
pbuffer.InsertNonNTString accountHash2
pbuffer.InsertNonNTString accountHash
pbuffer.InsertNTString varUser
pbuffer.sendPacket &H31
Else
AddChat vbRed, " - Password change failed, Could not hash"
form1.BotDisconnect
End If
'(DWORD) Client Key
'(DWORD) Server Key
'(DWORD[5]) Old password hash
'(DWORD[5]) New password hash
'(STRING) Account name
End Sub

Right after i send that, bnet kills the connection, so I don't know what's wrong with it,
July 10, 2003, 8:32 PM
Ithien
[9:48:32 PM] - Hash information was successfull
[9:48:32 PM] - Icons File: icons.bni
[9:48:32 PM] - Sending cdkey information...
[9:48:32 PM] - Cdkey information was successfull
[9:48:32 PM] - Attempting to change password...
[9:48:33 PM] - Disconnected

Still, right after it's sent, bnet kills the connection.
July 11, 2003, 3:03 AM

Search