• Welcome to Valhalla Legends Archive.
 

Create Account

Started by Yegg, November 21, 2004, 07:04 PM

Previous topic - Next topic

Yegg

Ok, im still learning a lot about battle.net packets but after a while of looking at bnetdocs, i learned some new things. I wanted to know if this is the proper code for creating an account.
pbuffer.InsertDWORD 5
pbuffer.InsertNTString varUser
pbuffer.SendPacket &H2A


Of couse varUser being the username. Can ne1 tel me if this is correct?

Update: I tried this code and i got a winsock error. I need to know whats wrong with this code.

Warrior

First of all Which Winsock Error.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Yegg

Well,

Private Sub wsBNET_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
On Error Resume Next
wsBNET.Close
AddChat "Connection Closed!" & vbNewLine, vbRed
End Sub


occurs.

drivehappy

Output the Description variable and tell us what it describes; what you posted tells us nothing.

Eric

#4
The DWORD should actually be a series of 5 DWORD's which contain the values of your single-hashed password.

Yegg

#5
I think i understand wut ur saying, are these the 5 singled hashed passwords that i need?
pbuffer.InsertDWORD lngKey
pbuffer.InsertDWORD lngSeed
pbuffer.InsertDWORD lngValue1
pbuffer.InsertDWORD lngValue2
pbuffer.InsertDWORD lngValue3


Update: Yah! It created the account. My only problem left is that all it does is creates the account and then it doesn't do ne thing else. it wont connect, look at the following code.

  Case &H29
     If Mid(Data, 5, 1) = Chr(1) Then
           
            AddChat "Passed!" & vbNewLine, vbGreen
            Connected = True
pbuffer.InsertNTString varUser
pbuffer.InsertBYTE 0
pbuffer.SendPacket &HA
pbuffer.InsertDWORD 2
pbuffer.InsertNTString VarHome
pbuffer.SendPacket &HC
     Else
            AddChat "Failed!" & vbNewLine, vbRed
                Randomize
                AAA = Int(Rnd * 5000)
                dblSeed = Val("&h" & StrToHex(StrReverse(ServerHash)))
                dblKey = AAA
                lngSeed = CLng(dblSeed)
                lngKey = CLng(dblKey)
                HashPass varpass, Len(varpass), lngKey, lngSeed, lngValue1, lngValue2, lngValue3
                pbuffer.InsertDWORD lngKey
                pbuffer.InsertDWORD lngSeed
                pbuffer.InsertDWORD lngValue1
                pbuffer.InsertDWORD lngValue2
                pbuffer.InsertDWORD lngValue3
                pbuffer.InsertNTString varUser
                pbuffer.SendPacket &H2A
            End If

Now, after SendPacket &H2A do i have to do wsBNET.Connect? Or is there something else i forgot to add? Also, i didn't add a logonrespense to this so that it'd say if it created the account or if it failed.

LivedKrad

Why would adding a logon response tell if creating the account failed? I'd say a logon response would be a response sent after "receiving logon". I believe Battle.net disconnects you after you create an account.

Yegg

#7
Ya, after trying this, i've noticed it does disconnect me, how do i get it to stay online? I try disconnected then connecting but that didn't work. So should i just try wsBNET.Connect alone?
Ok, i just tried going wsBNET.Connect after it creates the account. It still isn't connecting.

hismajesty

Change your error code; something like:

AddChat "BNET " & Number & ": " & Description & vbNewLine, vbRed

so we can get a better idea of what the actual error is, aside from just disconnecting.

Yegg

Sorry i didn't update my post again, but my problem now is not having the bot disconnect. It creates the accounts as it should, now, my only problem is logging on with the new account. I get logon failed. But i changed some code around, lemme show you what i did, this way does still create the account.

  Case &H29
     If Mid(Data, 5, 1) = Chr(1) Then
           
            AddChat "Passed!" & vbNewLine, vbGreen
            Connected = True
pbuffer.InsertNTString varUser
pbuffer.InsertBYTE 0
pbuffer.SendPacket &HA
pbuffer.InsertDWORD 2
pbuffer.InsertNTString VarHome
pbuffer.SendPacket &HC
     Else
            AddChat "Failed!" & vbNewLine, vbRed
Randomize
AAA = Int(Rnd * 5000)
dblSeed = Val("&h" & StrToHex(StrReverse(ServerHash)))
dblKey = AAA
lngSeed = CLng(dblSeed)
lngKey = CLng(dblKey)
HashPass varpass, Len(varpass), lngKey, lngSeed, lngValue1, lngValue2, lngValue3
pbuffer.InsertDWORD lngKey
pbuffer.InsertDWORD lngSeed
pbuffer.InsertDWORD lngValue1
pbuffer.InsertDWORD lngValue2
pbuffer.InsertDWORD lngValue3
pbuffer.InsertNTString varUser
pbuffer.SendPacket &H2A

            End If


Now, this code creates the account like it should. My only problem is that when the bot tries to connect through the created account. It says that the password is incorrect.

Eric

#10
You'll need to send SID_LOGONRESPONSE or SID_LOGONRESPONSE2 to login to the account using a double-hashed password instead of a single-hashed one.

Yegg

Will that actually make a difference considering the account still gets created?

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?