Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Antarctica on August 19, 2006, 12:44 PM

Title: When and how to send 0x31 (VB)?
Post by: Antarctica on August 19, 2006, 12:44 PM
Ok here's my sub for 0x31: (im sending it right after i get a success login and before 0x0A)



Public Sub Send0x31()

    Dim OldPass As String
    Dim NewPass As String
    Dim lngToken As Long
   
    OldPass = LCase(Declarations.Password)
    NewPass = LCase(Declarations.ChangePassTo)
   
    lngToken = GetTickCount()

    With PBuffer
       
        .InsertDWORD lngToken
        .InsertDWORD Declarations.lngSrvToken
        .InsertNonNTString BNCSutil.doubleHashPassword(OldPass, lngToken, Declarations.lngSrvToken)
        .InsertNonNTString BNCSutil.doubleHashPassword(NewPass, lngToken, Declarations.lngSrvToken)
        .InsertNTString Declarations.Username
       
        .SendPacket &H31
       
    End With
   
End Sub



If im not hashing it right or sending it at the wrong time, plz tell me cause im puzzled.
Title: Re: When and how to send 0x31 (VB)?
Post by: l2k-Shadow on August 19, 2006, 02:12 PM
New password should be a single hash not a double.
Title: Re: When and how to send 0x31 (VB)?
Post by: UserLoser on August 19, 2006, 02:17 PM
This should be sent after a successful Cd-Key and version check, but before logging onto Battle.net via SID_LOGONRESPONSE (http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=5) or SID_LOGONRESPONSE2 (http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=367).  Like stated above, make sure you're sending Battle.net a singly hashed password because if you do what you're doing, your password is not hashed correctly and what you think your password is will not be what it actually is meant to be.
Title: Re: When and how to send 0x31 (VB)?
Post by: Antarctica on August 19, 2006, 05:41 PM
ok this is what i now have for the sub, however every time i try to change the password it fails:  i have it made to wehre the bot asks for the new password and sends it to BNET right after i get a version checked passed from S>0x51


Public Sub Send0x31()

    Dim OldPass As String
    Dim NewPass As String
    Dim lngToken As Long
   
    OldPass = LCase(Declarations.Password)
    NewPass = LCase(Declarations.ChangePassTo)
   
    lngToken = GetTickCount()

    With PBuffer
       
        .InsertDWORD lngToken
        .InsertDWORD Declarations.lngSrvToken
        .InsertNonNTString BNCSutil.hashPassword(OldPass)
        .InsertNonNTString BNCSutil.hashPassword(NewPass)
        .InsertNTString Declarations.Username
       
        .SendPacket &H31
       
    End With
   
End Sub


it worked for one account when did double hash but it changed the password to something i don't know lol, so plz help
Title: Re: When and how to send 0x31 (VB)?
Post by: Hero on August 19, 2006, 06:00 PM
You double hash the old password and just single hash the new password.
Title: Re: When and how to send 0x31 (VB)?
Post by: Antarctica on August 19, 2006, 06:17 PM
heres my new sub and STILL unable to change password  :'( :'(


Public Sub Send0x31()

    Dim OldPass As String
    Dim NewPass As String
    Dim lngToken As Long
   
    OldPass = LCase(Declarations.Password)
    NewPass = LCase(Declarations.ChangePassTo)
   
    lngToken = GetTickCount()

    With PBuffer
       
        .InsertDWORD lngToken
        .InsertDWORD Declarations.lngSrvToken
        .InsertNonNTString BNCSutil.doubleHashPassword(BNCSutil.hashPassword(OldPass), lngToken, Declarations.lngSrvToken)
        .InsertNonNTString BNCSutil.hashPassword(NewPass)
        .InsertNTString Declarations.Username
       
        .SendPacket &H31
       
    End With
   
End Sub
Title: Re: When and how to send 0x31 (VB)?
Post by: Hero on August 19, 2006, 06:20 PM
Oh sorry, I guess I worded that wrong, do this:


        .InsertNonNTString BNCSutil.doubleHashPassword(OldPass, lngToken, Declarations.lngSrvToken)
        .InsertNonNTString BNCSutil.hashPassword(NewPass)
Title: Re: When and how to send 0x31 (VB)?
Post by: Antarctica on August 19, 2006, 06:22 PM
heh hero, i lkie ur sig thnigie.  wehn i raed i fnid taht to be true.
Title: Re: When and how to send 0x31 (VB)?
Post by: Hero on August 19, 2006, 08:06 PM
Thanks, so I take it that worked?
Title: Re: When and how to send 0x31 (VB)?
Post by: Antarctica on August 19, 2006, 11:45 PM
Yup, works fine now!   ;D