VB/VB.Net Connexion!!

Inscrit
19 Février 2011
Messages
12
Reactions
0
#1
Bonjour,
j'ai essayé de me connecter a Dofus avec mon bot mais je n'ai pas arriver,j'ai cherche , et j'ai trouver qu'il y a un changement au niveau du cryptage de mot de passe , et j'ai fais ça :
a l'aide de code de Lakh, Merci a lui :oops:
Code:
Public Class OunasManager
    Public _publicKey As String
    Public _salt As String
    Public ReadOnly Property Salt()
        Get
            Return Me._salt
        End Get
    End Property
    Public Function setSalt(ByVal param1 As String)
        Me._salt = param1
        If (_salt.Length < 32) Then
            Console.WriteLine("Authentification salt size is lower than 32")
            While (Me._salt.Length < 32)
                Me._salt = Me._salt + " "
            End While
        End If
        Return Me
    End Function
    Public Function setPublicKey(ByVal param1 As List(Of Int32)) As String
        Dim loc2 As New List(Of Byte)
        Dim loc3 As Int32 = 0
        While (loc3 < param1.Count)
            loc2.Add(Convert.ToByte(param1(loc3)))
            loc3 = loc3 + 1
        End While
        Dim loc4 = Convert.ToBase64String(loc2.ToArray)
        Me._publicKey = loc4
        Return Me._publicKey
    End Function
    Public ReadOnly Property canAutoConnectWithToken() As Boolean
        Get
            Return Me.nextToken <> Nothing
        End Get
    End Property
    Public Function cipherRsa(ByVal param1 As String) As List(Of Int32)
        Dim loc7 As Int32 = 0
        Dim rsa As RSACryptoServiceProvider = OunasRSA.DecodeX509PublicKey(Convert.FromBase64String(_publicKey))
        If rsa Is Nothing Then Return Nothing
        Dim loc5 As List(Of Int32) = New List(Of Int32)
        Dim loc4 = rsa.Encrypt(Encoding.UTF8.GetBytes(Me._salt + param1), False)
        For Each loc6 In loc4
            loc5.Add(Convert.ToByte(loc6))
        Next
        Return loc5
    End Function
End Class
Code:
 Dim key = .ObjectValue.Key
                        Dim Account As String = .Text
                        Dim Password As String = .MDP.Text
                        Dim CryptedPassword As List(Of Integer)
                        Dim PublicKey As String = ""
                        Dim Salt As String = .ObjectValue.Salt
                        Dim OunasManager As New OunasManager
                        PublicKey = OunasManager.setPublicKey(key)
                        OunasManager.setSalt(Salt)
                        CryptedPassword = OunasManager.cipherRsa(Password)
                     
                        Dim Version As New Types.Version.Version
                        Version.init(2, 5, 3, 0, 0, 0)
                        ' Envoi du packet
                        Dim MessageEnvoi As New IdentificationMessage
                        Dim Param1 As New DofusMessage
                        MessageEnvoi.init(Version, "fr", Account, CryptedPassword, 11, True, True, False)
mais je n'arrive toujours pas a me connecter :(,merci de m'aider
ca arrête a l'envoie de id : 4 après je ne reçois rien
 

Lakh92

Membre Actif
Inscrit
24 Decembre 2009
Messages
118
Reactions
0
#2
Vérifie si la socket est toujours connectée après l'envoi de ton IdentificationMessage, et dis-nous si elle l'est :)
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#3
Oui il reste Connecté ;)
Code:
recu : id = 1, taille = 8
recu : id = 3, taille = 330
envoie : id = 4, taille = 289
Après ça rien :(
 

Lakh92

Membre Actif
Inscrit
24 Decembre 2009
Messages
118
Reactions
0
#4
Si tu es encore connecté et que le serveur ne t'envoie rien c'est qu'il est surchargé ! Je crois qu'il n'y a pas d'autres solutions...
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#5
ah!! , j'ai cru que j'envoie des trucks incorrectes , car il y'a une différence entre l'envoie de Dofus et le bot :s
Bote :
Code:
../..........fr..XXXXXX........p<.|...t.....m.I'..$n%.'F~...x..t~vc...L.....O.......m7.xM.?.O.....&a\....s.....3....~.....q.=.Sq.&......j.P.g......{..r.C.9."~|.2\..%...jv..ih.Z.........a]=..T+.....W~3.u........>...%.I^..%+.v.vG9.j..c.3".B..F.f<c<.vo.......+.a......V...+sV..1|.......
Dofus :
Code:
..............fr..XXXXXX..$+....S..OM.........u..%......dAytS.......T..&bX.V.&...#B?...w..wbII....p...;.~........>.G.....wk%.jl...s....DA..[:f.......pN..;7..VA~....n.ECZ..-..J)A./...v.qT.ez05&....k...lf..".[H..2...k.... .J.i...:-........Dv.R......^...C._...`iN......Ocv.g/.!.n..>.$F..
 
A

Anonymous

Invité
#6
Code:
Dim Version As New Types.Version.Version
Version.init(2, 5, 3, 0, 0, 0)
Je pense que tu devrais rajouter "_" après la variable "Version", car il pourrais confondre la variable et la class.
Ensuite

Code:
MessageEnvoi.init(Version, "fr", Account, CryptedPassword, 11, True, True, False)
Et là, c'est pas plutôt "0" à la place de "11" ?
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#7
je ne sais pas j'ai fais le '11' pour rejoindre brumaire^^',j'ai changer comme tu as dis mais toujours même problème ,
 
A

Anonymous

Invité
#8
Non la selection du server c'est la case 30.
Look les source du 30 ta ton id server a envoye.

Ensuite regarde la case 220 tu dois envoyer la mapid.

Pour ta case 3 normalement tout est bon si tu as applique ce que t'a indiqué Jilakin.
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#9
ok merci^^(je sai bien sa c'est pas mon premier bot :oops:),de plus mon bot est complet me faut que la connexion :D,car j'ai arrêter un peu de temps et a mon retour j'ai trouver qu'il que changement :mrgreen: ,
 
A

Anonymous

Invité
#10
Tu t'es co sur dofus sans ton bot ?
Tu veras plus que des changements !
 
A

Anonymous

Invité
#11
C'est sûr que des changements y'en eu pas mal, on pourrais même dire que tout à changer tellement y'a de choses nouvelles.
Sur ce joyeuses fêtes !
 
A

Anonymous

Invité
#13
Ou bloques-tu ? Je t'ai donné la démarche à suivre, si tu as réussi la case 3 le reste c'est du gâteau.
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#14
tu as vu mon premier poste??
je me suis bloquer au case 3 , j'envoie le 4 après je ne reçois rien .
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#16
Salut merci ToOnS mais je n'ai pas encore arrivé :(
voila :
RSA :
Code:
Public Class OunasRSA
    Private Const Key As String =
        "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHRiGIhIJrNdUJkKGtWC" +
        "sSqIza+2gPsjGXhSoDTOcokq59Et8d8SzgF68RvAZXezPO8tnUhlyvaDem4QSFLV" +
        "PVAmSRcp47HW4lpp11WHBlDsEEXQTBkM8nDyqSgn8dMANvButRDt/44OKslrfqmV" +
        "7ANmZggZ2wXN0T6XWt3FVC66X8+E7rUMUOREQYCDq3zrX4dNYy3y21lyJZeXTkSd" +
        "AmijqIHrrwLPTA/wpWLCEaIJ9OAWjds8L6TqONXvnf3qOtI/QsrWv24lRjtmRSeR" +
        "eKFIPrk8QQbcd2h4VUi06fJZ2ydCx0pOwU33izN42pmZoCrgdCwghFm1i2feQa0M" +
        "vQIDAQAB"

    Private Shared Function CompareByteArrays(ByVal a As Byte(), ByVal b As Byte()) As Boolean
        If a.Length <> b.Length Then
            Return False
        End If
        Dim i As Integer = 0
        For Each c As Byte In a
            If c <> b(i) Then
                Return False
            End If
            i += 1
        Next
        Return True
    End Function

    Private Shared Function DecodeX509PublicKey(ByVal x509Key As Byte()) As RSACryptoServiceProvider

        Dim seqID As Byte() = {&H30, &HD, &H6, &H9, &H2A, &H86, _
         &H48, &H86, &HF7, &HD, &H1, &H1, _
         &H1, &H5, &H0}
        Dim seq As Byte()

        Dim mem As New MemoryStream(x509Key)
        Dim binr As New BinaryReader(mem)

        Dim bt As Byte
        Dim twobytes As UShort

        Try

            twobytes = binr.ReadUInt16()
            If twobytes = &H8130 Then
                binr.ReadByte()
            ElseIf twobytes = &H8230 Then
                binr.ReadInt16()
            Else
                Return Nothing
            End If

            seq = binr.ReadBytes(15)
            If Not CompareByteArrays(seq, seqID) Then
                Return Nothing
            End If

            twobytes = binr.ReadUInt16()
            If twobytes = &H8103 Then
                binr.ReadByte()
            ElseIf twobytes = &H8203 Then
                binr.ReadInt16()
            Else
                Return Nothing
            End If

            bt = binr.ReadByte()
            If bt <> &H0 Then
                Return Nothing
            End If

            twobytes = binr.ReadUInt16()
            If twobytes = &H8130 Then
                binr.ReadByte()
            ElseIf twobytes = &H8230 Then
                binr.ReadInt16()
            Else
                Return Nothing
            End If

            twobytes = binr.ReadUInt16()
            Dim lowbyte As Byte
            Dim highbyte As Byte = &H0

            If twobytes = &H8102 Then
                lowbyte = binr.ReadByte()
            ElseIf twobytes = &H8202 Then
                highbyte = binr.ReadByte()
                lowbyte = binr.ReadByte()
            Else
                Return Nothing
            End If

            Dim modint As Byte() = {lowbyte, highbyte, &H0, &H0}
            Dim modsize As Integer = BitConverter.ToInt32(modint, 0)

            Dim firstbyte As Byte = binr.ReadByte()
            binr.BaseStream.Seek(-1, SeekOrigin.Current)

            If firstbyte = &H0 Then
                binr.ReadByte()
                modsize -= 1
            End If

            Dim modulus As Byte() = binr.ReadBytes(modsize)

            If binr.ReadByte() <> &H2 Then
                Return Nothing
            End If
            Dim expbytes As Integer = CInt(binr.ReadByte())
            Dim exponent As Byte() = binr.ReadBytes(expbytes)

            Dim RSA As New RSACryptoServiceProvider()

            Dim RSAKeyInfo As New RSAParameters() With {
             .Modulus = modulus,
             .Exponent = exponent
            }

            RSA.ImportParameters(RSAKeyInfo)

            Return RSA

        Catch e As Exception

            Return Nothing

        Finally

            binr.Close()

        End Try

    End Function

    Public Shared Function Encrypt(ByVal PublicKey As String, ByVal text As String) As List(Of Integer)

        Dim rsa As RSACryptoServiceProvider = DecodeX509PublicKey(Convert.FromBase64String(PublicKey))
        If rsa Is Nothing Then Return Nothing

        Dim loc4 = rsa.Encrypt(Encoding.UTF8.GetBytes(text), False)
        Dim loc5 As New List(Of Integer)

        For Each b In loc4
            loc5.Add(b)
        Next

        Return loc5
    End Function
End Class
Case 3
Code:
   Case 3
                        .Label_Statut.Text = "Connecté"
                        .WriteLog("[" & TimeOfDay & "]" & " ###" & " " & "La connexion a été ouverte.", Color.Green)
                        .ObjectValue = New HelloConnectMessage
                        .ObjectValue.Unpack(PacketData)
                      
                        Dim Certificate As New TrustCertificate
                        Dim M_Certificate As New List(Of TrustCertificate)
                        Dim key = .ObjectValue.Key
                        Dim Account As String = .Text
                        Dim Password As String = .MDP.Text
                        Dim CryptedPassword As List(Of Integer)
                        Dim PublicKey As String = ""
                        Dim PublicKeyTemp As New List(Of Byte)
                        Dim Salt As String = .ObjectValue.Salt
                        For Each u In key
                            PublicKeyTemp.Add(u)
                        Next
                        PublicKey = Convert.ToBase64String(PublicKeyTemp.ToArray())
                        If Salt.Length < 32 Then
                            While Salt.Length < 32
                                Salt &= " "
                            End While
                        End If
                        Dim OunasManager As New OunasManager
                        CryptedPassword = OunasRSA.Encrypt(PublicKey, Salt & Password)
                        Dim Version_ As New Types.Version.Version
                        Version_.init(2, 5, 3, 0, 0, 0)
              
                        Dim MessageEnvoi As New IdentificationMessage
                        Dim Param1 As New DofusMessage
                        MessageEnvoi.init(Version_, "fr", Account, CryptedPassword, 0, True, True, False)
                        MessageEnvoi.Pack(Param1, .Socket)
j'envoi le 4 après je ne reçois rien
 
A

Anonymous

Invité
#17
MessageEnvoi.init(Version_, "fr", Account, CryptedPassword, 0, True, False, False)
Apres c'est ton cryptage je t'ai envoyé un mp.
 
Inscrit
19 Février 2011
Messages
12
Reactions
0
#18
j'ai tout fais mais ca marche pas :(
Code:
envoie : id = 4, taille = 285
0x00131F8302050300000000000266720008736164692D646F7701000840E8CA71B3CCDA08233120BED271C917520B209D760888EB5D76E804DE4AD9CF2C493625F011CEAA1E8DB5957215C15DDFC98B1CEC73995422BDB2BCE87EF8D0566FF737677B5CCAEC172AEFF609F82ED1DE89C91EB8830761CDBC962EF9280B276F355167CD8D994A391532CC4CC01323D075FD906E6721F54B959B5C54C822655DDF35003FCB8CB26B5F63897328A7481CE702637E4E2BCD096D8587307C8F466A6DEB84ADEF56317CA804506EB920EA0CE3E674DD175EE165E229079DCA1FD60C58916388461BE82FD8289C63172FAC1A8374D929F15BB0B0509B5CB51B9282199C2ECE6D2EA181F75ABFBA9461512AE6104E7EB1C50B9D5825C00909270000
 
Haut Bas