C/C++ [Résolu] serialisation identificationmessage

Inscrit
1 Mars 2014
Messages
120
Reactions
0
#1
Bonjour tout le monde :)

Aillant repris mon projet de bot d2, je suis en train d'essayer de me connecter au jeu. Je bloque néanmoins sur le paquet identificationmessage. J'ai bien compris que je devais renvoyer mon login et mon mdp crypté en RSA. Pour ça dans le hcm je reçois une clef et un salt. Dans un premier temps je crois que je dois décrypter la clef du hcm avec la clef contenu en binaire dans les sources (dites moi si je fais fausse route) puis crypter avec cette nouvelle clef mes identifiant.

Ce que je ne comprend pas c est à quoi sert le salt ? Quand s'en servir ?
Dans les sources de d. j'ai regardé du côté de AuthentificationManager mais je suis un peu perdu.... je pensais aussi utiliser la classe DofusRSA de munrek pour le RSA mais j'ai un peu de mal à voir comment m'en servir.

Bref voilà mes questions. Merci pour vos futures réponses :D
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#2
Re: serialisation identificationmessage

Bonsoir,

Le salt est une chaîne de texte aléatoire qui n'a pas vraiment d'utilité dans l'algorithme RSA en lui même.
Au moment de l'ajout des données avant l'encryptage on écrit en bytes le salt, la aesKey (la clé IV permettant le décryptage du ticket au niveau du 42), puis le username length, le username et enfin le password.

Code:
var baIn:ByteArray = new ByteArray();
         _loc6_;
         baIn.writeUTFBytes(this._salt);
         _loc7_;
         baIn.writeBytes(this._AESKey);
         _loc6_;
         if(certificate)
         {
            baIn.writeUnsignedInt(certificate.id);
            _loc6_;
            baIn.writeUTFBytes(certificate.hash);
            _loc6_;
         }
         baIn.writeByte(login.length);
         _loc7_;
         baIn.writeUTFBytes(login);
         _loc6_;
         baIn.writeUTFBytes(pwd);
Fonction entière: (le code n'est pas très clair, la déobfuscation n'est pas top)

Code:
private function cipherRsa(param1:String, param2:String, param3:TrustCertificate) : Vector.<int>
      {
         var _loc6_:* = false;
         var _loc7_:* = true;
         !_loc7_;
         var baOut:ByteArray = null;
         _loc7_;
         var debugOutput:ByteArray = null;
         _loc6_;
         _loc6_;
         var n:int = 0;
         _loc6_;
         var login:String = param1;
         _loc7_;
         var pwd:String = param2;
         _loc7_;
         var certificate:TrustCertificate = param3;
         _loc7_;
         _loc6_;
         var baIn:ByteArray = new ByteArray();
         _loc6_;
         baIn.writeUTFBytes(this._salt);
         _loc7_;
         baIn.writeBytes(this._AESKey);
         _loc6_;
         if(certificate)
         {
            baIn.writeUnsignedInt(certificate.id);
            _loc6_;
            baIn.writeUTFBytes(certificate.hash);
            _loc6_;
         }
         baIn.writeByte(login.length);
         _loc7_;
         baIn.writeUTFBytes(login);
         _loc6_;
         baIn.writeUTFBytes(pwd);
         _loc6_;
         try
         {
            !_loc7_;
            if((File.applicationDirectory.resolvePath("debug-login.txt")) || (File.applicationDirectory.resolvePath("debuglogin.txt")))
            {
               _log.debug("login with certificate");
               _loc7_;
               debugOutput = new ByteArray();
               _loc7_;
               _loc7_;
               _loc7_;
               baIn.position = 0;
               _loc7_;
               _loc6_;
               debugOutput.position = 0;
               _loc6_;
               debugOutput = RSA.publicEncrypt((new PUBLIC_KEY_V2() as ByteArray).readUTFBytes((new PUBLIC_KEY_V2() as ByteArray).length),baIn);
               _loc6_;
               _loc6_;
               _loc6_;
               !_loc7_;
               _log.debug("Login info (RSA Encrypted, " + debugOutput.length + " bytes) : " + Base64.encodeByteArray(debugOutput));
               _loc6_;
            }
         }
         catch(e:Error)
         {
            if(_loc7_)
            {
               if(_loc6_)
               {
               }
               _log.error("Erreur lors du log des informations de login ");
            }
         }
         baOut = RSA.publicEncrypt(this._publicKey,baIn);
         _loc7_;
         _loc6_;
         var ret:Vector.<int> = new Vector.<int>();
         _loc7_;
         _loc6_;
         baOut.position = 0;
         !_loc6_;
         !_loc6_;
         _loc7_;
         _loc6_;
         var i:int = 0;
         _loc7_;
         _loc6_;
         while(true)
         {
            _loc7_;
            if(baOut.bytesAvailable == 0)
            {
               break;
            }
            _loc6_;
            n = baOut.readByte();
            _loc7_;
            ret[i] = n;
            _loc7_;
            !_loc6_;
            _loc6_;
            !_loc6_;
            i++;
            _loc7_;
         }
         _loc6_;
         return ret;
      }

Bonne soirée
 
Dernière édition:
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#3
Re: serialisation identificationmessage

Salut !

Merci pour ta réponse alexandre, ça m'a permis de voir plus claire en ce qui concerne le salt.

Maintenant j'aimerai revenir sur un point, les credentials. Si j'ai bien compris voici la procédure :
- je recois dans le hcm une clef au format X509 que j'extrait (dans un vector d'unsigned char)
- grace à la classe DofusRSA de munrek, je transforme cette clef en une clef public pour chiffrer les credentials.
J'appelle donc la méthode DofusPKeyDecrypt en lui passant directement ma clef (extraite du hcm et de taille 305 octets).
Cette méthode est censée me renvoyer une clef public pour chiffrer le salt et les identifiants.

J'ai cependant un souci, à l'appel de cette méthode, la fonction RSA_public_decrypt me retourne -1 et le code d'erreur me signal : "data greater than mod len"
Je ne comprends pas comment régler ce problème :/ .... J'ai néanmoins quelques pistes :
1) J'ai mal écrit ma clef public (contenu dans le code source de D. en dur), voici comment je l'ai mise :
Code:
"-----BEGIN PUBLIC KEY-----\n"
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9XpbSNEUoM6niz3XTESW\n"
"J/I3+h3J+YseUIdEShxyp0nMfX8xUHUktK/QFY+V4Q3fV/pdn1PxOaxKEA8SYGNA\n"
"nc+uIal9ZGHqkbFcNF7CNp0MUFecQi5gGYpg4JPlC0onfmn6R2shSAl7M+UCVgFp\n"
"ICVrtXxocos/jg0OP/2gWFZU8AjKDo4JJP/apvubjUgufCGNXEWynRkOclMBXpAw\n"
"2IBAO6KjRdGBllPmJfYcSQq+G+9tp5nK+dzkLgITSg8JtK2tp5w+fbt5tBlCLcvC\n"
"/7CAp9t3J+ZImOO5kRw+Cn4Jd2RUMcPCd7s1JHqRXfOtuItz7xcOlqHtyLExvotf\n"
"MwIDAQAB\n"
"-----END PUBLIC KEY-----"
Est ce la bonne méthode ?

2) Il faut faire une étape sur la clef du hcm avant de l'envoyer à la méthode DofusPKeyDecrypt, et dans ce cas je dois étudier encore les sources de D2.

Pour mieux comprendre, voici la classe de munrek :
DofusRSA.h
Code:
/*
Copyright (C) <2013>  <Munrek>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef RSA_H_
#define RSA_H_

#include "openssl/bio.h"
#include "openssl/ssl.h"
#include "openssl/err.h"
#include "openssl/rsa.h"
#include "openssl/pem.h"
#include <boost/array.hpp>

#include <fstream>
#include <iostream>
#include <sstream>

#include "base64.h"

using namespace std;

typedef unsigned char byte;

class DofusRSA {
public:
	DofusRSA();
	std::vector<byte> DofusPKeyDecrypt(std::vector<byte> signature);
	std::vector<byte> LoginPKeyEncrypt(std::vector<byte> credentials);
	void setLoginPublicKey(std::vector<byte> lPKey);
private:
	std::string DofusPublicKey;
	std::string LoginPublicKey;
	byte *LoginPublicKeyByte;
	byte *DofusPublicKeyByte;
};

#endif
DofusRSA.cpp
Code:
/*
Copyright (C) <2013>  <Munrek>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "DofusRSA.h"

DofusRSA::DofusRSA() {
	SSL_load_error_strings();
	ERR_load_BIO_strings();
	OpenSSL_add_all_algorithms();

	stringstream SDofusPublicKey;
	SDofusPublicKey << "-----BEGIN PUBLIC KEY-----\n"
			"MIIBUzANBgkqhkiG9w0BAQEFAAOCAUAAMIIBOwKCATIAqpzRrvO3We7EMi9cWYqdfb3rbdinTay+\n"
			"hxQ6t3dOiJLY4NITxyeIuy97yZYOojOlXS2SuJ4cCHjCeLCQO1FwOz+nynQWcBWecz2QdbHD2Kz7\n"
	        "mNLd2qtZyEDO76rd7LaDOxRvgs9DsH9sfnCuKLKbd725xTLc7wRfJzOH9v9rTTYVXssXe7JUpTx8\n"
	        "nV8yKnTiq3WpzBeZT4C3ZCR18GBBCh3NmSTbze9i2KipgZnOwBvhskVlweuqZ1KNIKsQgipBFuyw\n"
	        "w68RGNYaAKofMVVio4amrGpCT5MM852jpHsgJJfOUHu6md1CnvdwDPbo/PKQUI0RLb0ezE5gsPma\n"
	        "s39QBw+DiaibUkk1aCkBxTOFqpIbjfLM2/4qA6GPcWUJxP3vmGoeCTMBLNEiPfLqVm86QzUCAwEA\n"
	        "AQ==\n"
	        "-----END PUBLIC KEY-----";
	DofusPublicKey = SDofusPublicKey.str();
}

std::vector<byte> DofusRSA::DofusPKeyDecrypt(std::vector<byte> signature) {
    char * DPKey =(char *) malloc(DofusPublicKey.size());
	strcpy(DPKey, DofusPublicKey.c_str());

	BIO *bp_dofus = BIO_new_mem_buf(DPKey, DofusPublicKey.size());
	RSA *my_rsa = PEM_read_bio_RSA_PUBKEY(bp_dofus, NULL, NULL, NULL);

	byte *inputSignature, *outputSignature;
	inputSignature = (byte*) malloc(5000);
	outputSignature = (byte*) malloc(5000);
	inputSignature = reinterpret_cast<byte*> (&signature[0]);

	int buflen = RSA_public_decrypt(signature.size(), inputSignature, outputSignature, my_rsa, RSA_PKCS1_PADDING);

	std::vector<byte> outputSignatureVector(outputSignature, outputSignature+buflen);
	return outputSignatureVector;
}

std::vector<byte> DofusRSA::LoginPKeyEncrypt(std::vector<byte> credentials) {
    char * LoginPublicKeyByte = (char *) malloc(LoginPublicKey.size());
	strcpy(LoginPublicKeyByte, LoginPublicKey.c_str());

	BIO *bp_login = BIO_new_mem_buf(LoginPublicKeyByte, -1);
	RSA *my_second_rsa = PEM_read_bio_RSA_PUBKEY(bp_login, NULL, NULL, NULL);

	byte *pinputCredentials, *poutputCredentials;
	pinputCredentials = (byte*) malloc(5000);
	poutputCredentials = (byte*) malloc(5000);
	pinputCredentials = reinterpret_cast<byte*> (&credentials[0]);

	int buflen = RSA_public_encrypt(credentials.size(), pinputCredentials, poutputCredentials, my_second_rsa, RSA_PKCS1_PADDING);

	std::vector<byte> outputCredentialsVector(poutputCredentials, poutputCredentials+buflen);
	return outputCredentialsVector;
}

void DofusRSA::setLoginPublicKey(std::vector<byte> lPKey) {
	const std::string lPKeyStr(lPKey.begin(), lPKey.end());
	std::string lPKeyStrEnc = base64_encode(reinterpret_cast<const unsigned char*>(lPKeyStr.c_str()), lPKeyStr.length());

	stringstream lPKeyStrEncFor;
	for(int i=0; i!= lPKeyStrEnc.length(); i++){

		lPKeyStrEncFor << lPKeyStrEnc[i];
			if((i+1)%76==0){
				if(i!=0) lPKeyStrEncFor << "\n";
			}
	}

	stringstream SlPKeyStrEnc;
	SlPKeyStrEnc << "-----BEGIN PUBLIC KEY-----" << "\n" << lPKeyStrEncFor.str() << "\n" << "-----END PUBLIC KEY-----";

	LoginPublicKey = SlPKeyStrEnc.str();
}
base64.h
Code:
#include <string>

std::string base64_encode(unsigned char const* , unsigned int len);
std::string base64_decode(std::string const& s);
base64.cpp
Code:
/*
base64.cpp and base64.h

Copyright (C) 2004-2008 René Nyffenegger

This source code is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this source code must not be misrepresented; you must not
claim that you wrote the original source code. If you use this source code
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original source code.

3. This notice may not be removed or altered from any source distribution.

René Nyffenegger [email protected]

*/

#include "base64.h"
#include <iostream>

static const std::string base64_chars =
             "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
             "abcdefghijklmnopqrstuvwxyz"
             "0123456789+/";


static inline bool is_base64(unsigned char c) {
  return (isalnum(c) || (c == '+') || (c == '/'));
}

std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
  std::string ret;
  int i = 0;
  int j = 0;
  unsigned char char_array_3[3];
  unsigned char char_array_4[4];

  while (in_len--) {
    char_array_3[i++] = *(bytes_to_encode++);
    if (i == 3) {
      char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
      char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
      char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
      char_array_4[3] = char_array_3[2] & 0x3f;

      for(i = 0; (i <4) ; i++)
        ret += base64_chars[char_array_4[i]];
      i = 0;
    }
  }

  if (i)
  {
    for(j = i; j < 3; j++)
      char_array_3[j] = '\0';

    char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
    char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
    char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
    char_array_4[3] = char_array_3[2] & 0x3f;

    for (j = 0; (j < i + 1); j++)
      ret += base64_chars[char_array_4[j]];

    while((i++ < 3))
      ret += '=';

  }

  return ret;

}

std::string base64_decode(std::string const& encoded_string) {
  int in_len = encoded_string.size();
  int i = 0;
  int j = 0;
  int in_ = 0;
  unsigned char char_array_4[4], char_array_3[3];
  std::string ret;

  while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) {
    char_array_4[i++] = encoded_string[in_]; in_++;
    if (i ==4) {
      for (i = 0; i <4; i++)
        char_array_4[i] = base64_chars.find(char_array_4[i]);

      char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
      char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
      char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];

      for (i = 0; (i < 3); i++)
        ret += char_array_3[i];
      i = 0;
    }
  }

  if (i) {
    for (j = i; j <4; j++)
      char_array_4[j] = 0;

    for (j = 0; j <4; j++)
      char_array_4[j] = base64_chars.find(char_array_4[j]);

    char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
    char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
    char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];

    for (j = 0; (j < i - 1); j++) ret += char_array_3[j];
  }

  return ret;
}
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#4
Re: serialisation identificationmessage

Bonjour DeepSiderZ,

Je regarderai plus en details le code de Munrek ce soir mais ce que je peux te dire c'est que la clé publique contenue dans le Client dofus doit être utilisé sans les balises. ( -----BEGIN PUBLIC KEY----- | -----END PUBLIC KEY----- )
 
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#5
Re: serialisation identificationmessage

Ah bon ? Le code de munrek avait initialement une clef et avait ces deux balises. Je vais quand même essayer sans

Merci de ta réponse et j'attends ton retour sur le code de munrek :)

EDIT:
j'ai réussis à faire marche l'algorithme de munrek, je m'étais trompe de clef. Il faut utiliser (jje pense) le fichier 381.bin (AuthentificationManager__verifyKey)

Par contre la clef que j'obtiens fait 294 octets. Ça vous semble corect ?
 
Inscrit
15 Mai 2015
Messages
41
Reactions
0
#6
Re: serialisation identificationmessage

De mon côté(mon code fonctionne) la clé située dans les fichiers binaires fait 305 octets et celle obtenue en fait 304.
 
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#7
Re: serialisation identificationmessage

Tu utilise la classe de munrek ? Tu utilise la clef du fichier 381.bin ? Tu ne fais qu'injecter dans DofusPKeyDecrypt la clef obtenue dans le HelloConnectMessage ?

PS: Si tu code un bot D2 en C++ et que tu veux qu'on s'entraide un peu dis le moi par mp ;)
 
Inscrit
15 Mai 2015
Messages
41
Reactions
0
#8
Re: serialisation identificationmessage

J'utilise cette clé(je ne sais plus quel fichier cela représente dans le dofusInvoker) :
MIIBUzANBgkqhkiG9w0BAQEFAAOCAUAAMIIBOwKCATIAgucoka9J2PXcNdjcu6CuDmgteIMB+rih2UZJIuSoNT/0J/lEKL/W4UYbDA4U/6TDS0dkMhOpDsSCIDpO1gPG6+6JfhADRfIJItyHZflyXNUjWOBG4zuxc/L6wldgX24jKo+iCvlDTNUedE553lrfSU23Hwwzt3+doEfgkgAf0l4ZBez5Z/ldp9it2NH6/2/7spHm0Hsvt/YPrJ+EK8ly5fdLk9cvB4QIQel9SQ3JE8UQrxOAx2wrivc6P0gXp5Q6bHQoad1aUp81Ox77l5e8KBJXHzYhdeXaM91wnHTZNhuWmFS3snUHRCBpjDBCkZZ+CxPnKMtm2qJIi57RslALQVTykEZoAETKWpLBlSm92X/eXY2DdGf+a7vju9EigYbX0aXxQy2Ln2ZBWmUJyZE8B58CAwEAAQ==

J'utilise CryptoPP pour gérer le RSA, j'ai donc codé ma fonction. Il y a quelques exemples assez bien expliqués sur le wiki de la lib pour t'apprendre à t'en servir. Ne sachant plus à quoi ressemble la fonction DofusPKeyDecrypt je ne peux pas trop te dire mais je fais exactement ce que tu as dit plus haut.
 
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#9
Re: serialisation identificationmessage

Je reviens vers vous car j'ai bien avancé sur la sérialisation du paquet 4. Je pense être pas mal et je fais mes premiers tests d'envoi au serveur de D.
Je rencontre tout de même un problème que j'ai du mal à comprendre, le serveur ne me répond rien après l'envoi du paquet 4. Même pas un paquet IdentificationFailedMessage ou je ne sais quoi.

Avez vous des idées pour expliquer ça ? Je suis conscient que ça vient de mon paquet qui doit être erroné donc si vous voulez plus de précisions sur la facon dont je le forme, dites le moi :)

Merci !
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#10
Re: serialisation identificationmessage

Cela vient du serialize, si le serveur ne répond pas c'est qu'il y a eu une erreur dans la lecture du paquet.
Même si les informations que tu envois sont fausses, il doit te répondre.
 
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#11
Re: serialisation identificationmessage

Mais faut que la structure du paquet soit completement bonne pour que le serveur reponde. Ou que seulement le header soit correct ?

D'ailleurs est ce que la taille du paquet 4 serialisé est fixe ? Le mien fait 285 octets contre 281 ppur celui que j'ai sniffé ? Si quelqu'un sait je suis preneur :)
Merci !
 

BlueDream

Administrateur
Membre du personnel
Inscrit
8 Decembre 2012
Messages
2 010
Reactions
149
#12
Re: serialisation identificationmessage

Non la taille n'est pas fixe, il faut que toute la structure du paquet soit bonne.
 
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#13
Re: serialisation identificationmessage

OK merci :)

J'ai quelque piste sur mon bug mais j'aimerai vous faire valider au moins la structure du paquet que je serialise. Voilà ce que je fais :
writeByte du résultat de ces 3 BooleanByteWrapper :
BooleanByteWrapper(autoconnect) // autoconnect = false
BooleanByteWrapper(useCertificate) // useCertificate = false 
BooleanByteWrapper(useLoginToken ) // useLoginToken = false

Serialisation de la classe Version
writeByte(major)
writeByte(minor)
writeByte(release)
writeInt(revision)
writeByte(patch)
writeByte(buildType)

Serialisation de la classe VersionExtended
writeByte(install)
writeByte(technology)

writeUTF(lang)
writeVarInt(credentials.size ())

Serialisation des credentials
writeUTFBytes(salt)
writeByte(username.size ())
writeUTFBytes(username)
writeUTFBytes(password)

writeShort(serverId)

Voilà :) est ce que ça vous semble bon ?
Merci !
 

Sorrow

Membre Actif
Inscrit
5 Mai 2012
Messages
376
Reactions
26
#14
Re: serialisation identificationmessage

Deux remarques

- Tu gère pas sessionOptionalSalt et failedAttempts a la fin de IdentificationMessage.
- Le credential est écrit octets par octets après avoir écrit sa taille avec VarInt, car celui-ci est chiffré pour pas que les identifiants soit au claire.
 
Inscrit
1 Mars 2014
Messages
120
Reactions
0
#15
Re: serialisation identificationmessage

Ouaip et Ouaip, en fait j'écris bien le sessionOptionalSalt et le failedAttempts mais je ne l'ai pas noté ici car, après lecture des sources et sniffage d'un paquet, j'ai cru comprendre que c'était pas utilisé. Donc je les écrit bien mais ça écrit des 0.
Pour les credentials je fais bien ça aussi et j'ai bien chiffré les données :)

Je viens par contre je voir que dans la sérialisation de la classe Version, release est un writeByte, ce que j'ai bien noté dans ma méthode, alors que dans mon code j'avais mis un writeInt. Donc je relance mon test et je vous tiens au courant !

Merci !

EDIT:
Bon les gars je crois que c'est un succès !!!! Voici le retour de mon bot :) :
Nouveau paquet [10] => Paquet non traité
Nouveau paquet [6314] => Paquet non traité
Nouveau paquet [10] => Paquet non traité
Nouveau paquet [22] => Paquet non traité
Nouveau paquet [6469] => Paquet non traité
Houra !!!! J'en ai la larme à l'oeil :')
 
Haut Bas