Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Pr0pHeT on August 14, 2003, 01:27 AM

Title: Create Account & Change Password
Post by: Pr0pHeT on August 14, 2003, 01:27 AM
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.
Title: Re:Create Account & Change Password
Post by: Camel on August 14, 2003, 01:36 AM
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?
Title: Re:Create Account & Change Password
Post by: CrAz3D on August 14, 2003, 07:15 PM
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
Title: Re:Create Account & Change Password
Post by: Arta on August 15, 2003, 01:53 AM
What happens when you try to create an account?
Title: Re:Create Account & Change Password
Post by: Camel on August 15, 2003, 06:29 PM
CrAz3D, please indent your code.
Title: Re:Create Account & Change Password
Post by: CrAz3D on August 16, 2003, 09:48 AM
K.

Arta, what do you mean?  
Title: Re:Create Account & Change Password
Post by: UserLoser on August 16, 2003, 10:03 AM
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.
Title: Re:Create Account & Change Password
Post by: CrAz3D on August 16, 2003, 12:09 PM
Ok, thnx UserLoser