public static void HandleGenerateSingleSignOnTokenResponse2(BattlenetPacket packet) { packet.Read<uint>("Token", 0, 32); if (!packet.ReadBoolean()) { packet.ReadByteArray("SsoToken", 0, 9); packet.ReadByteArray("SsoId", 0, 10); } else packet.Read<uint>("Error", 0, 16); }
public static void HandleReadRequest(BattlenetPacket packet) { packet.ReadSkip(21); packet.Read<ulong>("Id", 0, 64, "RecordAddress"); packet.Read<uint>("Label", 0, 32, "RecordAddress"); packet.Read<uint>("RequestId", 0, 32); if (packet.ReadBoolean()) { var profiles = packet.Read<int>(0, 4); for (var i = 0; i < profiles; ++i) packet.Read<ulong>("ProfileId", 0, 64, "Specification", "Reader"); } var selection = packet.Read<int>(0, 3); switch (selection) { case 0: packet.ReadByteArray("PrefixPath", 0, 6, "All"); break; case 1: packet.ReadByteArray("PrefixPath", 0, 6, "Slice"); if (packet.ReadBoolean()) packet.Read<ulong>("SliceStart", long.MinValue, 64, "Slice"); if (packet.ReadBoolean()) packet.Read<ulong>("SliceEnd", long.MinValue, 64, "Slice"); if (packet.ReadBoolean()) packet.Read<uint>("RowLimit", 0, 32, "Slice"); if (packet.ReadBoolean()) packet.ReadBoolean("SingleDepth", "Slice"); break; case 2: packet.ReadByteArray("PrefixPath", 0, 6, "Random"); var indices = packet.Read<int>(0, 7); for (var i = 0; i < indices; ++i) packet.Read<ulong>("Index", 0, 64, "Random", "Indices"); break; case 3: var paths = packet.Read<int>(0, 5); for (var i = 0; i < paths; ++i) packet.ReadByteArray("PrefixPath", 0, 6, "MultiPath", "Paths"); break; case 4: packet.ReadByteArray("PrefixPath", 0, 6, "Range"); if (packet.ReadBoolean()) packet.Read<ulong>("RangeStart", long.MinValue, 64, "Range"); if (packet.ReadBoolean()) packet.Read<ulong>("RangeEnd", long.MinValue, 64, "Range"); if (packet.ReadBoolean()) packet.Read<uint>("RowLimit", 0, 32, "Range"); if (packet.ReadBoolean()) packet.ReadBoolean("SingleDepth", "Range"); break; } }
public static void HandleGenerateSingleSignOnTokenResponse2(BattlenetPacket packet) { packet.Read <uint>("Token", 0, 32); if (!packet.ReadBoolean()) { packet.ReadByteArray("SsoToken", 0, 9); packet.ReadByteArray("SsoId", 0, 10); } else { packet.Read <uint>("Error", 0, 16); } }
public static void HandleConnectionClosing(BattlenetPacket packet) { var packets = packet.Read <int>(0, 6); for (var i = 0; i < packets; ++i) { packet.ReadFourCC("Command", i); packet.Read <uint>("Time", 0, 32, i); packet.Read <ushort>("Size", 0, 16, i); packet.ReadFourCC("Layer", 0, 16, i); packet.Read <ushort>("Offset", 0, 16, i); } packet.Read <ClosingReason>("Reason", 0, 4); packet.ReadByteArray("BadData", 0, 8); if (packet.ReadBoolean()) { packet.Read <ushort>("Command", 0, 6); if (packet.ReadBoolean()) { packet.Read <ushort>("Channel", 0, 4); } } packet.Read <uint>("Now", 0, 32); }
public static void HandleSettingsAvailable(BattlenetPacket packet) { packet.ReadSkip(5); packet.ReadByteArray("Path", 0, 6); packet.ReadSkip(21); packet.Read <ulong>("Id", 0, 64, "Address"); packet.Read <uint>("Label", 0, 32, "Address"); packet.Read <SettingsType>("Type", 1, 2); }
public static void HandleConnectionClosing(BattlenetPacket packet) { var packets = packet.Read<int>(0, 6); for (var i = 0; i < packets; ++i) { packet.ReadFourCC("Command", i); packet.Read<uint>("Time", 0, 32, i); packet.Read<ushort>("Size", 0, 16, i); packet.ReadFourCC("Layer", 0, 16, i); packet.Read<ushort>("Offset", 0, 16, i); } packet.Read<ClosingReason>("Reason", 0, 4); packet.ReadByteArray("BadData", 0, 8); if (packet.ReadBoolean()) { packet.Read<ushort>("Command", 0, 6); if (packet.ReadBoolean()) packet.Read<ushort>("Channel", 0, 4); } packet.Read<uint>("Now", 0, 32); }
public static void HandleReadRequest(BattlenetPacket packet) { packet.ReadSkip(21); packet.Read <ulong>("Id", 0, 64, "RecordAddress"); packet.Read <uint>("Label", 0, 32, "RecordAddress"); packet.Read <uint>("RequestId", 0, 32); if (packet.ReadBoolean()) { var profiles = packet.Read <int>(0, 4); for (var i = 0; i < profiles; ++i) { packet.Read <ulong>("ProfileId", 0, 64, "Specification", "Reader"); } } var selection = packet.Read <int>(0, 3); switch (selection) { case 0: packet.ReadByteArray("PrefixPath", 0, 6, "All"); break; case 1: packet.ReadByteArray("PrefixPath", 0, 6, "Slice"); if (packet.ReadBoolean()) { packet.Read <ulong>("SliceStart", long.MinValue, 64, "Slice"); } if (packet.ReadBoolean()) { packet.Read <ulong>("SliceEnd", long.MinValue, 64, "Slice"); } if (packet.ReadBoolean()) { packet.Read <uint>("RowLimit", 0, 32, "Slice"); } if (packet.ReadBoolean()) { packet.ReadBoolean("SingleDepth", "Slice"); } break; case 2: packet.ReadByteArray("PrefixPath", 0, 6, "Random"); var indices = packet.Read <int>(0, 7); for (var i = 0; i < indices; ++i) { packet.Read <ulong>("Index", 0, 64, "Random", "Indices"); } break; case 3: var paths = packet.Read <int>(0, 5); for (var i = 0; i < paths; ++i) { packet.ReadByteArray("PrefixPath", 0, 6, "MultiPath", "Paths"); } break; case 4: packet.ReadByteArray("PrefixPath", 0, 6, "Range"); if (packet.ReadBoolean()) { packet.Read <ulong>("RangeStart", long.MinValue, 64, "Range"); } if (packet.ReadBoolean()) { packet.Read <ulong>("RangeEnd", long.MinValue, 64, "Range"); } if (packet.ReadBoolean()) { packet.Read <uint>("RowLimit", 0, 32, "Range"); } if (packet.ReadBoolean()) { packet.ReadBoolean("SingleDepth", "Range"); } break; } }
public static void HandleLogonResponse3(BattlenetPacket packet) { if (packet.ReadBoolean()) { if (packet.ReadBoolean()) // has module { packet.ReadFixedLengthString("Type", 4, "Strings"); packet.ReadFourCC("Region", "Strings"); var id = Convert.ToHexString(packet.ReadBytes("ModuleId", 32, "Strings")); var dataSize = packet.Read <int>("Data size", 0, 10); var data = packet.ReadBytes(dataSize); var module = new BattlenetModuleHandler(packet); if (!module.HandleData(id, data).HasValue) { packet.Stream.AddValue("Data", data, "Strings"); } } var errorType = packet.Read <byte>(2, 0); if (errorType == 1) { packet.Read <ushort>("Error", 0, 16); packet.Read <uint>("Failure", 0, 32); } } else { var modules = packet.Read <byte>(0, 3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { packet.ReadFixedLengthString("Type", 4, "FinalRequest", i); packet.ReadFourCC("Region", "FinalRequest", i); var id = Convert.ToHexString(packet.ReadBytes("ModuleId", 32, "FinalRequest", i)); var dataSize = packet.Read <int>("Data size", 0, 10, i); var data = packet.ReadBytes(dataSize); if (!module.HandleData(id, data, i).HasValue) { packet.Stream.AddValue("Data", data, "FinalRequest", i); } } packet.Read <uint>("PingTimeout", int.MinValue, 32); if (packet.ReadBoolean()) { Connection.ReadRegulatorInfo(packet, "RegulatorRules"); } packet.ReadString("GivenName", 0, 8); packet.ReadString("Surname", 0, 8); packet.Read <uint>("AccountId", 0, 32); packet.Read <byte>("Region", 0, 8); packet.Read <AccountFlags>("Flags", 0, 64); packet.Read <byte>("GameAccountRegion", 0, 8); packet.ReadString("GameAccountName", 1, 5); packet.Read <GameAccountFlags>("GameAccountFlags", 0, 64); packet.Read <uint>("LogonFailures", 0, 32); if (packet.ReadBoolean()) { packet.ReadByteArray("Raf", 0, 10); } } }
public static void HandleSingleSignOnRequest3(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); packet.ReadByteArray("SsoId", 0, 10); packet.Read <ulong>("Compatibility", 0, 64); }
public static void HandleLogonResponse3(BattlenetPacket packet) { if (packet.ReadBoolean()) { if (packet.ReadBoolean()) // has module { packet.ReadFixedLengthString("Type", 4, "Strings"); packet.ReadFourCC("Region", "Strings"); var id = Utilities.ByteArrayToHexString(packet.ReadBytes("ModuleId", 32, "Strings")); var dataSize = packet.Read<int>("Data size", 0, 10); var data = packet.ReadBytes(dataSize); var module = new BattlenetModuleHandler(packet); if (!module.HandleData(id, data).HasValue) packet.Stream.AddValue("Data", data, "Strings"); } var errorType = packet.Read<byte>(2, 0); if (errorType == 1) { packet.Read<ushort>("Error", 0, 16); packet.Read<uint>("Failure", 0, 32); } } else { var modules = packet.Read<byte>(0, 3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { packet.ReadFixedLengthString("Type", 4, "FinalRequest", i); packet.ReadFourCC("Region", "FinalRequest", i); var id = Utilities.ByteArrayToHexString(packet.ReadBytes("ModuleId", 32, "FinalRequest", i)); var dataSize = packet.Read<int>("Data size", 0, 10, i); var data = packet.ReadBytes(dataSize); if (!module.HandleData(id, data, i).HasValue) packet.Stream.AddValue("Data", data, "FinalRequest", i); } packet.Read<uint>("PingTimeout", int.MinValue, 32); if (packet.ReadBoolean()) Connection.ReadRegulatorInfo(packet, "RegulatorRules"); packet.ReadString("GivenName", 0, 8); packet.ReadString("Surname", 0, 8); packet.Read<uint>("AccountId", 0, 32); packet.Read<byte>("Region", 0, 8); packet.Read<AccountFlags>("Flags", 0, 64); packet.Read<byte>("GameAccountRegion", 0, 8); packet.ReadString("GameAccountName", 1, 5); packet.Read<GameAccountFlags>("GameAccountFlags", 0, 64); packet.Read<uint>("LogonFailures", 0, 32); if (packet.ReadBoolean()) packet.ReadByteArray("Raf", 0, 10); } }
public static void HandleSingleSignOnRequest3(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); packet.ReadByteArray("SsoId", 0, 10); packet.Read<ulong>("Compatibility", 0, 64); }
public static void HandleSettingsAvailable(BattlenetPacket packet) { packet.ReadSkip(5); packet.ReadByteArray("Path", 0, 6); packet.ReadSkip(21); packet.Read<ulong>("Id", 0, 64, "Address"); packet.Read<uint>("Label", 0, 32, "Address"); packet.Read<SettingsType>("Type", 1, 2); }