Well I can't get this piece of shit to work, so I am asking for some help with getting Create Account and Change Password features to work on a binary bot.
What language are you working in?
What have you done so far?
Are you able to log in without creating an account?
Do you understand what goes on in hashing the password to log in?
Do you understand how hashing the password to log in is different from hashing the password to create an account/change an account's password?
VB 6 code for BNET. You need to have the bnetauth.dll with the main bot EXE.
This goes under parse:
Case &H3D
Select Case Asc(Mid(Data, 5, 1))
Case &H0
AddChat vbGreen, "Account created!"
form1.sckBnet.Close
form1.sckBnet.Connect varServer, 6112
Case &H1
AddChat vbRed, "Account create failed: name too short!"
form1.sckBnet.Close
Case &H2
AddChat vbRed, "Account create failed: invalid characters!"
form1.sckBnet.Close
Case &H3
AddChat vbRed, "Account create failed: bad words, you bad boy!"
form1.sckBnet.Close
Case &H4
AddChat vbRed, "Account create failed: account exists!"
form1.sckBnet.Close
Case Else
AddChat vbRed, "Account create failed: failed!"
form1.sckBnet.Close
End Select
This is it's own sub:
Public Sub SendCreateAccount(username As String, Password As String)
Dim pbuffer As New PacketBuffer
Dim Result As Boolean
Dim AccountHash As String
Password = LCase(Password)
AccountHash = String(5 * 4, vbNullChar)
Result = x(AccountHash, Password)
If Result = True Then
pbuffer.InsertNonNTString AccountHash
pbuffer.InsertNTString username
pbuffer.sendPacket &H3D
Else
AddChat vbBlue, "Account create failed: result = false!"
form1.sckBnet.Close
End If
End Sub
This is logon success/failed message:
If Mid(Data, 5, 1) = Chr(1) Then
AddChat vbWhite, "[" & Time & "] ", vbGreen, " ---- Logon Was Successfull"
pbuffer.InsertNTString varUser
pbuffer.InsertBYTE 0
pbuffer.sendPacket &HA
pbuffer.InsertNonNTString varProduct
pbuffer.sendPacket &HB
pbuffer.InsertDWORD 2
pbuffer.InsertNTString varhome
pbuffer.sendPacket &HC
Else
AddChat vbWhite, "[" & Time & "] ", vbRed, " ---- Logon Failed"
SendCreateAccount varUser, varPass
form1.sckBnet.Close
End If
This goes in a module or where ever:
Public Declare Function x Lib "bnetauth.dll" Alias "X" (ByVal outbuf As String, ByVal Password As String) As Long
What happens when you try to create an account?
CrAz3D, please indent your code.
K.
Arta, what do you mean?
I believe he means what happens when you send that. (0x3d)
Also, if your account was created successfully, then there's no reason to reconnect to Battle.net, just send your login packet (whichever you use 0x29 or 0x3a) right after your account was created.
Ok, thnx UserLoser