Mes valeurs ressemblent a ca:
Cliquez pour révéler
Cliquez pour masquer
[{'version': {'type': 'Version', 'value': Major: 2, Minor: 57, Code: 10, Build: 15, buildType: 0}}, {'lang': 'fr'}, {'credentials': {'type': 'Vector.<int>', 'value': [112, 46, 249, 170, 122, 141, 160, 135, 86, 194, 163, 203, 184, 36, 149, 164, 232, 127, 47, 91, 85, 103, 239, 85, 225, 240, 124, 186, 52, 226, 24, 94, 243, 214, 170, 8, 113, 196, 137, 236, 151, 63, 225, 112, 164, 152, 223, 76, 110, 49, 81, 238, 184, 113, 252, 111, 57, 6, 93, 225, 90, 168, 36, 140, 83, 243, 247, 80, 192, 222, 198, 188, 230, 220, 116, 65, 103, 47, 125, 146, 143, 198, 219, 194, 129, 112, 73, 153, 237, 136, 184, 22, 134, 85, 201, 236, 234, 229, 194, 207, 105, 175, 199, 237, 251, 74, 184, 20, 99, 213, 41, 231, 158, 52, 48, 219, 223, 234, 205, 196, 97, 182, 214, 165, 122, 230, 73, 196, 14, 100, 192, 204, 90, 249, 76, 147, 221, 122, 104, 66, 29, 218, 52, 114, 153, 129, 121, 202, 57, 151, 75, 199, 43, 247, 204, 122, 30, 83, 209, 94, 146, 35, 188, 100, 57, 26, 218, 146, 218, 48, 244, 126, 151, 107, 59, 244, 208, 49, 134, 16, 77, 210, 18, 204, 204, 234, 130, 121, 63, 185, 181, 158, 46, 248, 26, 96, 70, 144, 95, 95, 198, 164, 99, 166, 172, 76, 247, 50, 100, 85, 94, 118, 37, 205, 84, 92, 177, 45, 120, 236, 139, 31, 177, 143, 12, 171, 95, 82, 191, 178, 94, 250, 174, 122, 50, 167, 109, 2, 154, 141, 170, 159, 120, 196, 227, 150, 138, 220, 54, 1, 245, 217, 236, 10, 173, 201]}}, {'serverId': 0}, {'autoconnect': {'type': 'Boolean', 'value': True}}, {'useCertificate': {'type': 'Boolean', 'value': False}}, {'useLoginToken': {'type': 'Boolean', 'value': False}}, {'sessionOptionalSalt': {'type': 'Number', 'value': ''}}, {'failedAttempts': {'type': 'Vector.<uint>', 'value': []}}]
A ce stade on est juste avant l'exception (avant de lire le sessionOptionalSalt sur 8 octets) et dans le buffer il reste 3 octets 00 00 00.
Buffer de base:
Cliquez pour révéler
Cliquez pour masquer
5b260000000301140102390a0000000f00000266728002702ef9aa7a8da08756c2a3cbb82495a4e87f2f5b5567ef55e1f07cba34e2185ef3d6aa0871c489ec973fe170a498df4c6e3151eeb871fc6f39065de15aa8248c53f3f750c0dec6bce6dc7441672f7d928fc6dbc281704999ed88b8168655c9eceae5c2cf69afc7edfb4ab81463d529e79e3430dbdfeacdc461b6d6a57ae649c40e64c0cc5af94c93dd7a68421dda3472998179ca39974bc72bf7cc7a1e53d15e9223bc64391ada92da30f47e976b3bf4d03186104dd212ccccea82793fb9b59e2ef81a6046905f5fc6a463a6ac4cf73264555e7625cd545cb12d78ec8b1fb18f0cab5f52bfb25efaae7a32a76d029a8daa9f78c4e3968adc3601f5d9ec0aadc90000000000
Pour info revoila ma fonction:
def deserialize(self):
box = int.from_bytes(self.buffer_reader.read_byte(), "big")
self.autoconnect["value"] = BooleanByteWrapper.get_flag(box, 0)
self.useCertificate["value"] = BooleanByteWrapper.get_flag(box, 1)
self.useLoginToken["value"] = BooleanByteWrapper.get_flag(box, 2)
self.version["value"] = Version()
self.version["value"].deserialize(self.buffer_reader)
self.lang = self.buffer_reader.read_utf()
credentials_length = self.buffer_reader.read_var_int()
for i in range(credentials_length):
self.credentials["value"].append(int.from_bytes(self.buffer_reader.read_byte(), "big"))
self.serverId = self.buffer_reader.read_short()
self.sessionOptionalSalt = self.buffer_reader.read_var_long()
failed_attempts_length = self.buffer_reader.read_ushort()
for i in range(failed_attempts_length):
self.failedAttempts["value"].append(self.buffer_reader.read_read_var_uh_short())
Donc on arrive a self.lang = self.buffer_reader.read_utf() qui renvoit "fr" donc jusque la on est bon. Le fichier as:
package com.ankamagames.dofus.network.messages.connection
{
import com.ankamagames.dofus.network.types.version.Version;
import com.ankamagames.jerakine.network.CustomDataWrapper;
import com.ankamagames.jerakine.network.ICustomDataInput;
import com.ankamagames.jerakine.network.ICustomDataOutput;
import com.ankamagames.jerakine.network.INetworkMessage;
import com.ankamagames.jerakine.network.NetworkMessage;
import com.ankamagames.jerakine.network.utils.BooleanByteWrapper;
import com.ankamagames.jerakine.network.utils.FuncTree;
import flash.utils.ByteArray;
public class IdentificationMessage extends NetworkMessage implements INetworkMessage
{
public static const protocolId:uint = 5833;
private var _isInitialized:Boolean = false;
public var version:Version;
public var lang:String = "";
public var credentials:Vector.<int>;
public var serverId:int = 0;
public var autoconnect:Boolean = false;
public var useCertificate:Boolean = false;
public var useLoginToken:Boolean = false;
public var sessionOptionalSalt:Number = 0;
public var failedAttempts:Vector.<uint>;
private var _versiontree:FuncTree;
private var _credentialstree:FuncTree;
private var _failedAttemptstree:FuncTree;
public function IdentificationMessage()
{
this.version = new Version();
this.credentials = new Vector.<int>();
this.failedAttempts = new Vector.<uint>();
super();
}
override public function get isInitialized() : Boolean
{
return this._isInitialized;
}
override public function getMessageId() : uint
{
return 5833;
}
public function initIdentificationMessage(version:Version = null, lang:String = "", credentials:Vector.<int> = null, serverId:int = 0, autoconnect:Boolean = false, useCertificate:Boolean = false, useLoginToken:Boolean = false, sessionOptionalSalt:Number = 0, failedAttempts:Vector.<uint> = null) : IdentificationMessage
{
this.version = version;
this.lang = lang;
this.credentials = credentials;
this.serverId = serverId;
this.autoconnect = autoconnect;
this.useCertificate = useCertificate;
this.useLoginToken = useLoginToken;
this.sessionOptionalSalt = sessionOptionalSalt;
this.failedAttempts = failedAttempts;
this._isInitialized = true;
return this;
}
override public function reset() : void
{
this.version = new Version();
this.credentials = new Vector.<int>();
this.serverId = 0;
this.autoconnect = false;
this.useCertificate = false;
this.useLoginToken = false;
this.sessionOptionalSalt = 0;
this.failedAttempts = new Vector.<uint>();
this._isInitialized = false;
}
override public function pack(output:ICustomDataOutput) : void
{
var data:ByteArray = new ByteArray();
this.serialize(new CustomDataWrapper(data));
writePacket(output,this.getMessageId(),data);
}
override public function unpack(input:ICustomDataInput, length:uint) : void
{
this.deserialize(input);
}
override public function unpackAsync(input:ICustomDataInput, length:uint) : FuncTree
{
var tree:FuncTree = new FuncTree();
tree.setRoot(input);
this.deserializeAsync(tree);
return tree;
}
public function serialize(output:ICustomDataOutput) : void
{
this.serializeAs_IdentificationMessage(output);
}
public function serializeAs_IdentificationMessage(output:ICustomDataOutput) : void
{
var _box0:uint = 0;
_box0 = BooleanByteWrapper.setFlag(_box0,0,this.autoconnect);
_box0 = BooleanByteWrapper.setFlag(_box0,1,this.useCertificate);
_box0 = BooleanByteWrapper.setFlag(_box0,2,this.useLoginToken);
output.writeByte(_box0);
this.version.serializeAs_Version(output);
output.writeUTF(this.lang);
output.writeVarInt(this.credentials.length);
for(var _i3:uint = 0; _i3 < this.credentials.length; _i3++)
{
output.writeByte(this.credentials[_i3]);
}
output.writeShort(this.serverId);
if(this.sessionOptionalSalt < -9007199254740990 || this.sessionOptionalSalt > 9007199254740990)
{
throw new Error("Forbidden value (" + this.sessionOptionalSalt + ") on element sessionOptionalSalt.");
}
output.writeVarLong(this.sessionOptionalSalt);
output.writeShort(this.failedAttempts.length);
for(var _i9:uint = 0; _i9 < this.failedAttempts.length; _i9++)
{
if(this.failedAttempts[_i9] < 0)
{
throw new Error("Forbidden value (" + this.failedAttempts[_i9] + ") on element 9 (starting at 1) of failedAttempts.");
}
output.writeVarShort(this.failedAttempts[_i9]);
}
}
public function deserialize(input:ICustomDataInput) : void
{
this.deserializeAs_IdentificationMessage(input);
}
public function deserializeAs_IdentificationMessage(input:ICustomDataInput) : void
{
var _val3:int = 0;
var _val9:uint = 0;
this.deserializeByteBoxes(input);
this.version = new Version();
this.version.deserialize(input);
this._langFunc(input);
var _credentialsLen:uint = input.readVarInt();
for(var _i3:uint = 0; _i3 < _credentialsLen; _i3++)
{
_val3 = input.readByte();
this.credentials.push(_val3);
}
this._serverIdFunc(input);
this._sessionOptionalSaltFunc(input);
var _failedAttemptsLen:uint = input.readUnsignedShort();
for(var _i9:uint = 0; _i9 < _failedAttemptsLen; _i9++)
{
_val9 = input.readVarUhShort();
if(_val9 < 0)
{
throw new Error("Forbidden value (" + _val9 + ") on elements of failedAttempts.");
}
this.failedAttempts.push(_val9);
}
}
public function deserializeAsync(tree:FuncTree) : void
{
this.deserializeAsyncAs_IdentificationMessage(tree);
}
public function deserializeAsyncAs_IdentificationMessage(tree:FuncTree) : void
{
tree.addChild(this.deserializeByteBoxes);
this._versiontree = tree.addChild(this._versiontreeFunc);
tree.addChild(this._langFunc);
this._credentialstree = tree.addChild(this._credentialstreeFunc);
tree.addChild(this._serverIdFunc);
tree.addChild(this._sessionOptionalSaltFunc);
this._failedAttemptstree = tree.addChild(this._failedAttemptstreeFunc);
}
private function deserializeByteBoxes(input:ICustomDataInput) : void
{
var _box0:uint = input.readByte();
this.autoconnect = BooleanByteWrapper.getFlag(_box0,0);
this.useCertificate = BooleanByteWrapper.getFlag(_box0,1);
this.useLoginToken = BooleanByteWrapper.getFlag(_box0,2);
}
private function _versiontreeFunc(input:ICustomDataInput) : void
{
this.version = new Version();
this.version.deserializeAsync(this._versiontree);
}
private function _langFunc(input:ICustomDataInput) : void
{
this.lang = input.readUTF();
}
private function _credentialstreeFunc(input:ICustomDataInput) : void
{
var length:uint = input.readVarInt();
for(var i:uint = 0; i < length; i++)
{
this._credentialstree.addChild(this._credentialsFunc);
}
}
private function _credentialsFunc(input:ICustomDataInput) : void
{
var _val:int = input.readByte();
this.credentials.push(_val);
}
private function _serverIdFunc(input:ICustomDataInput) : void
{
this.serverId = input.readShort();
}
private function _sessionOptionalSaltFunc(input:ICustomDataInput) : void
{
this.sessionOptionalSalt = input.readVarLong();
if(this.sessionOptionalSalt < -9007199254740990 || this.sessionOptionalSalt > 9007199254740990)
{
throw new Error("Forbidden value (" + this.sessionOptionalSalt + ") on element of IdentificationMessage.sessionOptionalSalt.");
}
}
private function _failedAttemptstreeFunc(input:ICustomDataInput) : void
{
var length:uint = input.readUnsignedShort();
for(var i:uint = 0; i < length; i++)
{
this._failedAttemptstree.addChild(this._failedAttemptsFunc);
}
}
private function _failedAttemptsFunc(input:ICustomDataInput) : void
{
var _val:uint = input.readVarUhShort();
if(_val < 0)
{
throw new Error("Forbidden value (" + _val + ") on elements of failedAttempts.");
}
this.failedAttempts.push(_val);
}
}
}