• Welcome to Valhalla Legends Archive.
 

0x31 Change Password Help

Started by Feanor, October 14, 2003, 01:22 AM

Previous topic - Next topic

Feanor

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!

Arta

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.

Dark-Feanor

Why are you posting under my handle?
- Feanor[xL]
clan exile
Firebot
iago: "caps lock is like cruise control for cool"

UserLoser

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.

hismajesty

#4
It is eRRoR notice the post is similar? Just an extra reason why he sucks.  :-\

Feanor

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?

iago

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.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Lenny

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)
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.

UserLoser

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