VB/VB.Net Mon bot Mitm

Inscrit
17 Avril 2015
Messages
119
Reactions
0
#1
Bonjours, avancent dans mon bot de type MITM, je voudrais donc gérer la connexion.
Lorsque que la personne lance dofus, donc j'injecte la dll, je me connecte, mon bot détecte bien la connexion mais la plus rien, l’écran reste figé sur la connexion .

Code:
Imports System.Net.Sockets
Imports MITMBOT.Client.BazSocket
Imports MITMBOT._Interface.Logger

Namespace Client
    Public Class SockManager
        Public WithEvents LoginSock As New BazSocket.BazSocket
        Public WithEvents GameSock As New BazSocket.BazSocket

        Private MyLog As _Interface.Logger.LogConsole
        Private Main As MainForm

        Sub New(ByVal _MyLog As _Interface.Logger.LogConsole, ByVal _Main As MainForm)
            MyLog = _MyLog
            Main = _Main
        End Sub

        ''############ Serveur ############

        Public Sub InitializeLoginSock()
            LoginSock = New BazSocket.BazSocket(Main)
            LoginSock.Listen("127.0.0.1", 5555)
        End Sub

        Private Sub Client_Accepted(ByVal sender As System.Object, ByVal Request As AcceptRequest) Handles LoginSock.Accepted
            Dim LoginSock As New Login.LoginSock
            Dim AcceptSock As New BazSocket.BazSocket(New Form, Request)
            AcceptSock.AlwaysRaiseClose = True
            AcceptSock.AsyncEvent = True

            Dim NewIP As String = AcceptSock.RemoteEP.Address.ToString
            Dim NewPort As String = AcceptSock.RemoteEP.Port.ToString

            MyLog.WriteLog("Nouveau client sur le socket de connexion : " & NewIP & ":" & NewPort)

            LoginSock.MySock = AcceptSock
            LoginSock.MyLog = MyLog
            LoginSock.Main = Main

            Main.ClientLogin.Add(LoginSock)

            LoginSock.Initialize()
        End Sub

        Private Sub LoginSock_Listen(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginSock.Listening
            MyLog.WriteLog("Jeu en écoute ... (Connexion)")
        End Sub

        Private Sub LoginSock_ListenFailed(ByVal sender As Object, ByVal ex As System.Exception) Handles LoginSock.ListenFailed
            MyLog.WriteError("Impossible d'écouter le jeu (Connexion) !")
        End Sub

        '############### Jeu ###############

        Public Sub InitializeGameSock()
            GameSock = New BazSocket.BazSocket(Main)
            GameSock.Listen("127.0.0.1", 443)
        End Sub

        Private Sub Player_Accepted(ByVal sender As System.Object, ByVal Request As AcceptRequest) Handles GameSock.Accepted
            Dim _FormBot As New FormBot
            Dim AcceptSock As New BazSocket.BazSocket(_FormBot, Request)
            AcceptSock.AlwaysRaiseClose = True
            AcceptSock.AsyncEvent = True

            Dim NewIP As String = AcceptSock.RemoteEP.Address.ToString
            Dim NewPort As String = AcceptSock.RemoteEP.Port.ToString

            MyLog.WriteLog("Nouveau client sur le socket de jeu : " & NewIP & ":" & NewPort)

            Dim GameSock As New Game.GameSock
            GameSock.MySock = AcceptSock
            GameSock.MyLog = New LogBot(_FormBot)
            GameSock.Main = Main
            GameSock.ConsoleLog = MyLog
            GameSock.FormBot = _FormBot

            GameSock.Initialize(Main.GameIp, Main.GamePort)

            Main.ClientGame.Add(GameSock)

            _FormBot.GameSock = GameSock
            _FormBot.MdiParent = Main
            _FormBot.Show()
        End Sub

        Private Sub GameSock_Listen(ByVal sender As Object, ByVal e As System.EventArgs) Handles GameSock.Listening
            MyLog.WriteLog("Jeu en écoute ... (Game)")
        End Sub

        Private Sub GameSock_ListenFailed(ByVal sender As Object, ByVal ex As System.Exception) Handles GameSock.ListenFailed
            MyLog.WriteError("Impossible d'écouter le jeu (Game) !")
        End Sub
    End Class
End Namespace
Je précise que je débute donc je me suis aider de plusieurs chose sur le forum.
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#2
Tu as repris les sources de LeafBot mais à mon avis aucun paquet n'est à jour.

Il faut comprendre ce que tu fais, ce qui n'a pas l'air d'être le cas, à la connexion du client tu dois te connecter au serveur connexion.

Je pense qu'il manque quelques paramètres ici :
Code:
LoginSock.Initialize()
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#3
Oui effectivement, merci pour la réponse. Si je comprend bien Dans LeafBot, il ne s'occupe que du SelectedServerDataMessage, le reste il transfère sans interpréter. Ou je me trompe totalement :(
 
Inscrit
1 Avril 2016
Messages
20
Reactions
0
#4
@asaki oui c'est vrai, LeafBot s'occupe que du paquet 42.
Tu reçois quoi dans MyLog ? Je connais pas BazSocket, mais normalement dès que tu reçois une connexion à ton serveur local 127.0.0.1 tu te connectes au serveur d'authentification D@fus 213.248.126.39 et tu transmets les paquets entre le serveur et le client.
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#5
Oui c'est ce que j'ai compris, dans la console, rien ne s'affiche, je vais regarder pour régler ce problème, mais dans Visual j'ai sa :
envoi : id -> 182 len -> 1
Reception id 1, Lenght -> 8
Reception id 3, Lenght -> 341
Reception id 183, Lenght -> 1
envoi : id -> 4 len -> 279
Reception id 10, Lenght -> 4
envoi : id -> 4 len -> 279
Reception id 6314, Lenght -> 0
Reception id 10, Lenght -> 4
Reception id 22, Lenght -> 61
Reception id 6469, Lenght -> 56

Voila merci encore pour tout.

PS: J'ai ajouter un debug a la console.
 
Dernière édition:
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#6
J'avance dans le bot, je commence a comprendre, je peux uniquement me connecter en sélection des serveurs après j'ai une erreur sur le packet 40 impossible de lire au delà du flux .
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#8
L'erreur impossible de lire au delà du flux apparais a cause de IO ou de packet ? Mais la le packet 40 "ServerSelectionMessage" , nécessite qu'on le traite ou le laisser passer suffit ?

PS :[14:01:48] parsing() ReadByte -> Impossible de lire au-delà de la fin du flux.
 
Inscrit
25 Février 2012
Messages
178
Reactions
3
#9
Tu as update les IOs (Reader/Writer) utilisés dans ton projet ?
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#10
Je commence donc je suis un peux perdu même si je commence a comprendre, pour les ios, je peux m'appuyer sur quoi pour les majs ? merci
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#11
Les sources du jeu voyons ;)

Il faut apprendre à chercher dans le DofusInvoker.

Code:
package com.ankamagames.jerakine.network
{
  import flash.utils.ByteArray;
  import com.ankamagames.jerakine.network.utils.types.Int64;
  import flash.utils.IDataInput;
  import com.ankamagames.jerakine.network.utils.types.UInt64;
  import flash.utils.IDataOutput;
  
  public class CustomDataWrapper extends Object implements ICustomDataInput, ICustomDataOutput
  {
  
  private static const INT_SIZE:int = 32;
  
  private static const SHORT_SIZE:int = 16;
  
  private static const SHORT_MIN_VALUE:int = -32768;
  
  private static const SHORT_MAX_VALUE:int = 32767;
  
  private static const UNSIGNED_SHORT_MAX_VALUE:int = 65536;
  
  private static const CHUNCK_BIT_SIZE:int = 7;
  
  private static const MAX_ENCODING_LENGTH:int = Math.ceil(INT_SIZE / CHUNCK_BIT_SIZE);
  
  private static const MASK_10000000:int = 128;
  
  private static const MASK_01111111:int = 127;
  
  private var _data;
  
  public function CustomDataWrapper(param1:*)
  {
  super();
  this._data = param1;
  }
  
  public function set position(param1:uint) : void
  {
  this._data.position = param1;
  }
  
  public function get position() : uint
  {
  return this._data.position;
  }
  
  public function readVarInt() : int
  {
  var _loc4_:* = 0;
  var _loc1_:* = 0;
  var _loc2_:* = 0;
  var _loc3_:* = false;
  while(_loc2_ < INT_SIZE)
  {
  _loc4_ = this._data.readByte();
  _loc3_ = (_loc4_ & MASK_10000000) == MASK_10000000;
  if(_loc2_ > 0)
  {
  _loc1_ = _loc1_ + ((_loc4_ & MASK_01111111) << _loc2_);
  }
  else
  {
  _loc1_ = _loc1_ + (_loc4_ & MASK_01111111);
  }
  _loc2_ = _loc2_ + CHUNCK_BIT_SIZE;
  if(!_loc3_)
  {
  return _loc1_;
  }
  }
  throw new Error("Too much data");
  }
  
  public function readVarUhInt() : uint
  {
  return this.readVarInt();
  }
  
  public function readVarShort() : int
  {
  var _loc4_:* = 0;
  var _loc1_:* = 0;
  var _loc2_:* = 0;
  var _loc3_:* = false;
  while(_loc2_ < SHORT_SIZE)
  {
  _loc4_ = this._data.readByte();
  _loc3_ = (_loc4_ & MASK_10000000) == MASK_10000000;
  if(_loc2_ > 0)
  {
  _loc1_ = _loc1_ + ((_loc4_ & MASK_01111111) << _loc2_);
  }
  else
  {
  _loc1_ = _loc1_ + (_loc4_ & MASK_01111111);
  }
  _loc2_ = _loc2_ + CHUNCK_BIT_SIZE;
  if(!_loc3_)
  {
  if(_loc1_ > SHORT_MAX_VALUE)
  {
  _loc1_ = _loc1_ - UNSIGNED_SHORT_MAX_VALUE;
  }
  return _loc1_;
  }
  }
  throw new Error("Too much data");
  }
  
  public function readVarUhShort() : uint
  {
  return this.readVarShort();
  }
  
  public function readVarLong() : Number
  {
  return this.readInt64(this._data).toNumber();
  }
  
  public function readVarUhLong() : Number
  {
  return this.readUInt64(this._data).toNumber();
  }
  
  public function readBytes(param1:ByteArray, param2:uint = 0, param3:uint = 0) : void
  {
  this._data.readBytes(param1,param2,param3);
  }
  
  public function readBoolean() : Boolean
  {
  return this._data.readBoolean();
  }
  
  public function readByte() : int
  {
  return this._data.readByte();
  }
  
  public function readUnsignedByte() : uint
  {
  return this._data.readUnsignedByte();
  }
  
  public function readShort() : int
  {
  return this._data.readShort();
  }
  
  public function readUnsignedShort() : uint
  {
  return this._data.readUnsignedShort();
  }
  
  public function readInt() : int
  {
  return this._data.readInt();
  }
  
  public function readUnsignedInt() : uint
  {
  return this._data.readUnsignedInt();
  }
  
  public function readFloat() : Number
  {
  return this._data.readFloat();
  }
  
  public function readDouble() : Number
  {
  return this._data.readDouble();
  }
  
  public function readMultiByte(param1:uint, param2:String) : String
  {
  return this._data.readMultiByte(param1,param2);
  }
  
  public function readUTF() : String
  {
  return this._data.readUTF();
  }
  
  public function readUTFBytes(param1:uint) : String
  {
  return this._data.readUTFBytes(param1);
  }
  
  public function get bytesAvailable() : uint
  {
  return this._data.bytesAvailable;
  }
  
  public function readObject() : *
  {
  return this._data.readObject();
  }
  
  public function get objectEncoding() : uint
  {
  return this._data.objectEncoding;
  }
  
  public function set objectEncoding(param1:uint) : void
  {
  this._data.objectEncoding = param1;
  }
  
  public function get endian() : String
  {
  return this._data.endian;
  }
  
  public function set endian(param1:String) : void
  {
  this._data.endian = param1;
  }
  
  public function writeVarInt(param1:int) : void
  {
  var _loc5_:* = 0;
  var _loc2_:ByteArray = new ByteArray();
  if(param1 >= 0 && param1 <= MASK_01111111)
  {
  _loc2_.writeByte(param1);
  this._data.writeBytes(_loc2_);
  return;
  }
  var _loc3_:int = param1;
  var _loc4_:ByteArray = new ByteArray();
  while(_loc3_ != 0)
  {
  _loc4_.writeByte(_loc3_ & MASK_01111111);
  _loc4_.position = _loc4_.length - 1;
  _loc5_ = _loc4_.readByte();
  _loc3_ = _loc3_ >>> CHUNCK_BIT_SIZE;
  if(_loc3_ > 0)
  {
  _loc5_ = _loc5_ | MASK_10000000;
  }
  _loc2_.writeByte(_loc5_);
  }
  this._data.writeBytes(_loc2_);
  }
  
  public function writeVarShort(param1:int) : void
  {
  var _loc5_:* = 0;
  if(param1 > SHORT_MAX_VALUE || param1 < SHORT_MIN_VALUE)
  {
  throw new Error("Forbidden value");
  }
  var _loc2_:ByteArray = new ByteArray();
  if(param1 >= 0 && param1 <= MASK_01111111)
  {
  _loc2_.writeByte(param1);
  this._data.writeBytes(_loc2_);
  return;
  }
  var _loc3_:* = param1 & 65535;
  var _loc4_:ByteArray = new ByteArray();
  while(_loc3_ != 0)
  {
  _loc4_.writeByte(_loc3_ & MASK_01111111);
  _loc4_.position = _loc4_.length - 1;
  _loc5_ = _loc4_.readByte();
  _loc3_ = _loc3_ >>> CHUNCK_BIT_SIZE;
  if(_loc3_ > 0)
  {
  _loc5_ = _loc5_ | MASK_10000000;
  }
  _loc2_.writeByte(_loc5_);
  }
  this._data.writeBytes(_loc2_);
  }
  
  public function writeVarLong(param1:Number) : void
  {
  var _loc3_:uint = 0;
  var _loc2_:Int64 = Int64.fromNumber(param1);
  if(_loc2_.high == 0)
  {
  this.writeint32(this._data,_loc2_.low);
  }
  else
  {
  _loc3_ = 0;
  while(_loc3_ < 4)
  {
  this._data.writeByte(_loc2_.low & 127 | 128);
  _loc2_.low = _loc2_.low >>> 7;
  _loc3_++;
  }
  if((_loc2_.high & 268435455 << 3) == 0)
  {
  this._data.writeByte(_loc2_.high << 4 | _loc2_.low);
  }
  else
  {
  this._data.writeByte((_loc2_.high << 4 | _loc2_.low) & 127 | 128);
  this.writeint32(this._data,_loc2_.high >>> 3);
  }
  }
  }
  
  public function writeBytes(param1:ByteArray, param2:uint = 0, param3:uint = 0) : void
  {
  this._data.writeBytes(param1,param2,param3);
  }
  
  public function writeBoolean(param1:Boolean) : void
  {
  this._data.writeBoolean(param1);
  }
  
  public function writeByte(param1:int) : void
  {
  this._data.writeByte(param1);
  }
  
  public function writeShort(param1:int) : void
  {
  this._data.writeShort(param1);
  }
  
  public function writeInt(param1:int) : void
  {
  this._data.writeInt(param1);
  }
  
  public function writeUnsignedInt(param1:uint) : void
  {
  this._data.writeUnsignedInt(param1);
  }
  
  public function writeFloat(param1:Number) : void
  {
  this._data.writeFloat(param1);
  }
  
  public function writeDouble(param1:Number) : void
  {
  this._data.writeDouble(param1);
  }
  
  public function writeMultiByte(param1:String, param2:String) : void
  {
  this._data.writeMultiByte(param1,param2);
  }
  
  public function writeUTF(param1:String) : void
  {
  this._data.writeUTF(param1);
  }
  
  public function writeUTFBytes(param1:String) : void
  {
  this._data.writeUTFBytes(param1);
  }
  
  public function writeObject(param1:*) : void
  {
  this._data.writeObject(param1);
  }
  
  private function readInt64(param1:IDataInput) : Int64
  {
  var _loc3_:uint = 0;
  var _loc2_:Int64 = new Int64();
  var _loc4_:uint = 0;
  while(true)
  {
  _loc3_ = param1.readUnsignedByte();
  if(_loc4_ == 28)
  {
  break;
  }
  if(_loc3_ >= 128)
  {
  _loc2_.low = _loc2_.low | (_loc3_ & 127) << _loc4_;
  _loc4_ = _loc4_ + 7;
  continue;
  }
  _loc2_.low = _loc2_.low | _loc3_ << _loc4_;
  return _loc2_;
  }
  if(_loc3_ >= 128)
  {
  _loc3_ = _loc3_ & 127;
  _loc2_.low = _loc2_.low | _loc3_ << _loc4_;
  _loc2_.high = _loc3_ >>> 4;
  _loc4_ = 3;
  while(true)
  {
  _loc3_ = param1.readUnsignedByte();
  if(_loc4_ < 32)
  {
  if(_loc3_ >= 128)
  {
  _loc2_.high = _loc2_.high | (_loc3_ & 127) << _loc4_;
  }
  else
  {
  break;
  }
  }
  _loc4_ = _loc4_ + 7;
  }
  _loc2_.high = _loc2_.high | _loc3_ << _loc4_;
  return _loc2_;
  }
  _loc2_.low = _loc2_.low | _loc3_ << _loc4_;
  _loc2_.high = _loc3_ >>> 4;
  return _loc2_;
  }
  
  private function readUInt64(param1:IDataInput) : UInt64
  {
  var _loc3_:uint = 0;
  var _loc2_:UInt64 = new UInt64();
  var _loc4_:uint = 0;
  while(true)
  {
  _loc3_ = param1.readUnsignedByte();
  if(_loc4_ == 28)
  {
  break;
  }
  if(_loc3_ >= 128)
  {
  _loc2_.low = _loc2_.low | (_loc3_ & 127) << _loc4_;
  _loc4_ = _loc4_ + 7;
  continue;
  }
  _loc2_.low = _loc2_.low | _loc3_ << _loc4_;
  return _loc2_;
  }
  if(_loc3_ >= 128)
  {
  _loc3_ = _loc3_ & 127;
  _loc2_.low = _loc2_.low | _loc3_ << _loc4_;
  _loc2_.high = _loc3_ >>> 4;
  _loc4_ = 3;
  while(true)
  {
  _loc3_ = param1.readUnsignedByte();
  if(_loc4_ < 32)
  {
  if(_loc3_ >= 128)
  {
  _loc2_.high = _loc2_.high | (_loc3_ & 127) << _loc4_;
  }
  else
  {
  break;
  }
  }
  _loc4_ = _loc4_ + 7;
  }
  _loc2_.high = _loc2_.high | _loc3_ << _loc4_;
  return _loc2_;
  }
  _loc2_.low = _loc2_.low | _loc3_ << _loc4_;
  _loc2_.high = _loc3_ >>> 4;
  return _loc2_;
  }
  
  private function writeint32(param1:IDataOutput, param2:uint) : void
  {
  while(param2 >= 128)
  {
  param1.writeByte(param2 & 127 | 128);
  var param2:uint = param2 >>> 7;
  }
  param1.writeByte(param2);
  }
  }
}
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#12
Si j'ai tout bien compris reste plus cas traduire et maj mon io alors ?
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#13
A priori, oui. :teeth:
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#14
Il existe un genre de traducteur as3 ?
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#15
Publique, non. Rien de mieux que de faire les choses soit même pour avoir le meilleur résultat.
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#16
Ok bah alors c'est partie pour codé un traducteur alors :) Merci pour tout. Mais j'ai une dernière question l'erreur impossible de lire au delà du flux comment elle peut arriver alors que le packet 40, n'et pas gérer, LeafBot ne sent occupe pas, c'est pas logique alors ?
 

ToOnS

Membre Actif
Inscrit
8 Avril 2009
Messages
974
Reactions
0
#17
en fait il les lit TOUS meme si il s'en occupe pas , il est bien obligé pour savoir lequel c'est et du coup savoir si il doit l'utiliser , bon apres il pourrait seulement lire les octets du header pour trouver quel "message" c'est , ca ferait gagner du temps dans le cas ou le "message" est pas géré , il passerait directement au suivant
 
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#18
J'ai donc essayer de maj mes IOS, toujoursla même erreur cela ne viendrais pas de mon parseur ?
Code:
            Catch e As Exception
                If Not e.Message = "Le thread a été abandonné." Then
                    MyLog.WriteError("parsing() " & e.TargetSite.Name & " -> " & e.Message)
                    Console.WriteLine("parsing() " & e.TargetSite.Name & " -> " & e.Message)
Mon parseur
Code:
        Public Sub parsing(ByVal data() As Byte)
            Dim packetid As UShort
            Try
                Dim index As Integer ' pour savoir ou on est
                Dim id_and_length As UShort ' les 2 premiers octets (16 bits)
                Dim packet_id As UShort ' les 14 premiers bits des 16
                Dim packet_length_of As Byte ' les 2 derniers bits des 16
                Dim packet_length As Integer ' la longueur du packet
                Dim Packet_Start As Integer
                Dim Packet_End As Integer

                If Waiting > 1 Then ' le buffer etait trop petit ?
                    Dim data_temps(data.Length + Data_Out.Length - 1) As Byte ' on créé un tableau de byte temporaire
                    Array.Copy(Data_Out, 0, data_temps, 0, Data_Out.Length) ' on met le debut du paquet trop long dans le tableau temporaire
                    Array.Copy(data, 0, data_temps, Data_Out.Length, data.Length) ' on met la reception a la suite
                    data = data_temps ' on met le tableau temporaire dans le tableau de travail
                End If

                Do Until index = data.Length ' on traite jusque la fin
                    Packet_Start = index
                    id_and_length = data(index) * 256 + data(index + 1) ' les 2 premiers octets
                    packet_length_of = id_and_length And 3 ' on veut les 2 derniers bits donc on masque (and) avec 11 en binaire (3 en decimal)
                    packet_id = id_and_length >> 2 ' on veut les 14 premiers bits donc on decale les 16 bits de 2 bits vers la droite
                    index += 2 + packet_length_of  ' on avance des 2 octets de id_and_length + du nombre d'octets de la taille de taille

                    Select Case packet_length_of ' on lit le bon nombre d'octet pour connaitre la taille des données
                        Case 0
                            packet_length = 0
                        Case 1
                            packet_length = data(index - 1)
                        Case 2
                            packet_length = 256 * data(index - 2) + data(index - 1)
                        Case 3
                            packet_length = 65536 * data(index - 3) + 256 * data(index - 2) + data(index - 1)
                    End Select

                    If index + packet_length > data.Length Then ' buffer trop petit ?
                        Waiting = packet_length + index - Packet_Start ' alors on le signale
                        ReDim Data_Out(data.Length - Packet_Start - 1) ' on redimensionne le tableau de debut du paquet trop long
                        Array.Copy(data, Packet_Start, Data_Out, 0, data.Length - Packet_Start) ' on copie le debut du paquet trop long
                        Exit Sub ' on sort
                    End If

                    Dim debug As String = "recu : id = " & packet_id & ", taille = " & packet_length & vbCrLf ' on ecrit l'ID et la taille
                    packetid = packet_id
                    Dim packet(0) As Byte ' on prepare le paquet
                    If packet_length > 0 Then ' si sa taille est plus grande que 0 on redimensionne
                        ReDim packet(packet_length - 1)
                        Array.Copy(data, index, packet, 0, packet_length) ' et on copie les donnée
                    End If
                    Dim j As Integer = 1
                    For i = 0 To packet_length - 1 ' on fait defiler tout les octets recus
                        debug &= packet(i).ToString("X2") ' on ecrit l'octet proprement pour de bon ce coup ci
                        j += 1
                        If j = 16 Then
                            debug &= vbCrLf
                            j = 1
                        End If
                    Next ' au suivant

                    If Not packet_id = 42 Then
                        MyLog.WriteLog("Reception id " & packet_id & ", Lenght -> " & packet_length)
                        MySock.Send(data)
                    Else
                        Dim _SSD As New Network.Connection.Server.Select.SelectedServerDataMessage
                        _SSD.deserialize(New DofusReader(New System.IO.MemoryStream(packet)))

                        Main.GameIp = _SSD.address
                        Main.GamePort = _SSD.port

                        Dim SSD As New Network.Connection.Server.Select.SelectedServerDataMessage
                        SSD.init(_SSD.serverId, "127.0.0.1", 443, _SSD.canCreateNewCharacter, _SSD.ticket) ' ces qui qui ecoute le porte 443
                        SSD.pack(MySock)

                        ServerSock.Close()
                        MySock.Close()
                    End If



                    index += packet_length ' on met l'index a jour
                    Packet_End = index
                    If Packet_End = data.Length Then ' si ca tombe pile poil alors le buffer etait assez grand
                        Waiting = 0 ' on reset
                        ReDim Data_Out(0) ' on reset
                    End If
                Loop

            Catch e As Exception
                If Not e.Message = "Le thread a été abandonné." Then
                    MyLog.WriteError("parsing() " & e.TargetSite.Name & " -> " & e.Message)
                    Console.WriteLine("parsing() " & e.TargetSite.Name & " -> " & e.Message)
                End If
            End Try
        End Sub
 

ToOnS

Membre Actif
Inscrit
8 Avril 2009
Messages
974
Reactions
0
#19
ce parser est parfait , celui qui a fait ca est un geni , ca vient du tout 1er MITM et il marche toujours , retire le "try" et
Code:
            Catch e As Exception
                If Not e.Message = "Le thread a été abandonné." Then
                    MyLog.WriteError("parsing() " & e.TargetSite.Name & " -> " & e.Message)
                    Console.WriteLine("parsing() " & e.TargetSite.Name & " -> " & e.Message)
                End If
            End Try
ca sera plus simple pour trouver ou ca delire et surtout ca bloquera pas dans ce parser de geni meme si la il a ete un peu magouillé
 
Dernière édition:
Inscrit
17 Avril 2015
Messages
119
Reactions
0
#20
j'ai un autre souci, mon bot lors de la connexion affiche la sélection des serveurs, jusque là ok mais quand je Click sur le serveur j'ai envoie id 40 et plus rien.
 
Haut Bas