• Welcome to Valhalla Legends Archive.
 

Create Account & Change Password

Started by Pr0pHeT, August 14, 2003, 01:27 AM

Previous topic - Next topic

Pr0pHeT

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.

Camel

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?

CrAz3D

#2
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
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Arta

What happens when you try to create an account?

Camel


CrAz3D

rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

UserLoser

#6
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.

CrAz3D

rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...