public static void HandleResumeRequest(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); packet.ReadString("Account", 3, 9); packet.Read <byte>("GameAccountRegion", 0, 8); packet.ReadString("GameAccountName", 1, 5); }
public static void HandleListUpdate(BattlenetPacket packet) { if (packet.ReadBoolean()) { packet.Read <uint>("Category", 0, 32); packet.ReadSingle("Population"); packet.Read <byte>("StateFlags", 0, 8); packet.ReadSkip(19); packet.Read <uint>("Type", int.MinValue, 32); packet.ReadString("Name", 0, 10); if (packet.ReadBoolean()) { packet.ReadString("Version", 0, 5, "PrivilegedData"); packet.Read <uint>("ConfigId", 0, 32, "PrivilegedData"); var ip = packet.ReadBytes(4); var port = packet.ReadBytes(2); Array.Reverse(port); packet.Stream.AddValue("Address", new IPEndPoint(new IPAddress(ip), BitConverter.ToUInt16(port, 0)), "PrivilegedData"); } packet.Read <RealmInfoFlags>("InfoFlags", 0, 8); } packet.Read <byte>("Region", 0, 8); packet.ReadSkip(12); packet.Read <byte>("Site", 0, 8); packet.Read <uint>("Realm", 0, 32); }
public static void HandleServerRealmUpdate(BattlenetPacket packet) { if (packet.Read <bool>(1)) { packet.Read <uint>("Timezone", 32); packet.ReadSingle("Population"); packet.Read <byte>("Lock", 8); packet.Read <uint>("Unk", 19); packet.Stream.AddValue("Type", packet.Read <uint>(32) + int.MinValue); packet.ReadString("Name", packet.Read <int>(10)); if (packet.Read <bool>("Has version", 1)) { packet.ReadString("Version", packet.Read <int>(5)); packet.Read <uint>("RealmId4", 32); var ip = packet.ReadBytes(4); var port = packet.ReadBytes(2); Array.Reverse(port); packet.Stream.AddValue("IP address", new IPAddress(ip)); packet.Stream.AddValue("Port", BitConverter.ToUInt16(port, 0)); } packet.Read <byte>("Flags", 8); } packet.Read <byte>("Region", 8); packet.Read <short>("Unk2", 12); packet.Read <byte>("Battlegroup", 8); packet.Read <uint>("Battlegroup index", 32); }
public static void HandlePatch(BattlenetPacket packet) { packet.ReadFourCC("ProgramId"); packet.ReadFourCC("Component"); packet.ReadString("Instructions", 0, 8); packet.ReadBoolean("More"); }
public static void HandleServerProofRequest(BattlenetPacket packet) { var modules = packet.Read <byte>(3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { packet.ReadString("Type", 4, i); packet.ReadFourCC("Region", i); var id = Utilities.ByteArrayToHexString(packet.ReadBytes(32)); packet.Stream.WriteLine(string.Format("[{0}] ModuleId: {1}", i, id)); var dataSize = packet.Read <int>("Data size", 10, i); var data = packet.ReadBytes(dataSize); var result = module.HandleData(id, data, i); if (!result.HasValue) { packet.Stream.WriteLine(string.Format("[{0}] Data: {1}", i, Utilities.ByteArrayToHexString(data))); } else if (!result.Value) { ModulesWaitingForData.Add(id); } } }
public static void HandleLogonRequest3(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); if (packet.ReadBoolean()) packet.ReadString("Account", 3, 9); packet.Read<ulong>("Compatibility", 0, 64); }
public static void HandleLogonRequest(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); if (packet.ReadBoolean()) { packet.ReadString("Account", 3, 9); } }
public static void HandleLogonRequest3(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); if (packet.ReadBoolean()) { packet.ReadString("Account", 3, 9); } packet.Read <ulong>("Compatibility", 0, 64); }
public static void HandleToonReady(BattlenetPacket packet) { packet.Read <ulong>("Region", 8); packet.ReadFourCC("Game"); packet.Read <ulong>("Realmaddress", 32); packet.ReadString("Name", packet.Read <int>(7) + 2); packet.Read <ulong>(21); packet.Read <ulong>("Unk64", 64); packet.Read <ulong>("Unk32", 32); packet.Stream.AddValue("Guid", new WowGuid64(packet.Read <ulong>(64))); packet.Read <ulong>("Realmaddress", 32); packet.Read <ulong>("Region", 8); packet.ReadFourCC("Game"); }
public static void HandleToonReady(BattlenetPacket packet) { packet.Read <byte>("Region", 0, 8, "Name"); packet.ReadFourCC("ProgramId", "Name"); packet.Read <uint>("Realm", 0, 32, "Name"); packet.ReadString("Name", 2, 7, "Name"); packet.ReadSkip(21); packet.Read <ulong>("Id", 0, 64, "ProfileAddress"); packet.Read <uint>("Label", 0, 32, "ProfileAddress"); packet.Read <ulong>("Id", 0, 64, "Handle"); packet.Read <uint>("Realm", 0, 32, "Handle"); packet.Read <byte>("Region", 0, 8, "Handle"); packet.ReadFourCC("ProgramId", "Handle"); }
public static void HandleGetStreamItemsResponse(BattlenetPacket packet) { packet.Read <ushort>("Unknown1", 16); packet.Read <ushort>("Unknown2", 16); packet.Read <uint>("Index", 32); var modules = packet.Read <byte>(6); for (var i = 0; i < modules; ++i) { packet.ReadString("Type", 4, i); packet.ReadFourCC("Region", i); packet.Stream.AddValue("ModuleId", Utilities.ByteArrayToHexString(packet.ReadBytes(32)), i); packet.Read <int>(27); // padding packet.Stream.AddValue("Publication time", Utilities.ByteArrayToHexString(BitConverter.GetBytes(packet.Read <uint>(32))), i); } }
public static void HandleInformationRequest(BattlenetPacket packet) { packet.ReadFourCC("Program"); packet.ReadFourCC("Platform"); packet.ReadFourCC("Locale"); var components = packet.Read <int>(6); for (var i = 0; i < components; ++i) { packet.ReadFourCC("Program", i); packet.ReadFourCC("Platform", i); packet.Read <uint>("Build", 32, i); } if (packet.Read <bool>(1)) { packet.ReadString("Login", packet.Read <int>(9) + 3); } }
public static void HandleComplete(BattlenetPacket packet) { var failed = packet.Read<bool>(1); if (failed) { if (packet.Read<bool>(1)) // has module { var type = packet.ReadString(4); var region = packet.ReadFourCC(); var id = Utilities.ByteArrayToHexString(packet.ReadBytes(32)); var dataSize = packet.Read<int>(10); var data = packet.ReadBytes(dataSize); var module = new BattlenetModuleHandler(packet); packet.Stream.WriteLine(string.Format("Type: {0}", type)); packet.Stream.WriteLine(string.Format("Region: {0}", region)); packet.Stream.WriteLine(string.Format("ModuleId: {0}", id)); packet.Stream.WriteLine(string.Format("Data size: {0}", dataSize)); if (!module.HandleData(id, data).HasValue) packet.Stream.WriteLine(string.Format("Data: {0}", Utilities.ByteArrayToHexString(data))); } var errorType = packet.Read<byte>(2); if (errorType == 1) { packet.Stream.WriteLine(string.Format("Result: {0}", packet.Read<ushort>(16))); packet.Stream.WriteLine(string.Format("Unk: {0}", packet.Read<uint>(32))); } } else { var modules = packet.Read<byte>(3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { var type = packet.ReadString(4); var region = packet.ReadFourCC(); var id = Utilities.ByteArrayToHexString(packet.ReadBytes(32)); var dataSize = packet.Read<int>(10); var data = packet.ReadBytes(dataSize); packet.Stream.WriteLine(string.Format("[{0}] Type: {1}", i, type)); packet.Stream.WriteLine(string.Format("[{0}] Region: {1}", i, region)); packet.Stream.WriteLine(string.Format("[{0}] ModuleId: {1}", i, id)); packet.Stream.WriteLine(string.Format("[{0}] Data size: {1}", i, dataSize)); if (!module.HandleData(id, data, i).HasValue) packet.Stream.WriteLine(string.Format("[{0}] Data: {1}", i, Utilities.ByteArrayToHexString(data))); } packet.Stream.WriteLine(string.Format("Ping timeout: {0}", packet.Read<uint>(32) + int.MinValue)); var hasOptionalData = packet.Read<bool>(1); if (hasOptionalData) { var hasConnectionInfo = packet.Read<bool>(1); if (hasConnectionInfo) { packet.Read<uint>("Threshold", 32); packet.Read<uint>("Rate", 32); } } packet.ReadString("First name", packet.Read<int>(8)); packet.ReadString("Last name", packet.Read<int>(8)); packet.Read<uint>("Account id", 32); packet.Read<byte>("Unk8", 8); packet.Read<ulong>("Unk64", 64); packet.Read<byte>("Unk8", 8); packet.ReadString("Account name", packet.Read<int>(5) + 1); packet.Read<ulong>("Unk64", 64); packet.Read<uint>("Unk32", 32); if (packet.Read<bool>("Unk1", 1)) packet.Stream.WriteLine(string.Format("Data: {0}", Utilities.ByteArrayToHexString(packet.ReadBytes(packet.Read<int>(10))))); } }
public static void HandleComplete(BattlenetPacket packet) { var failed = packet.Read <bool>(1); if (failed) { if (packet.Read <bool>(1)) // has module { packet.ReadString("Type", 4); packet.ReadFourCC("Region"); var id = Utilities.ByteArrayToHexString(packet.ReadBytes("ModuleId", 32)); var dataSize = packet.Read <int>("Data size", 10); var data = packet.ReadBytes(dataSize); var module = new BattlenetModuleHandler(packet); if (!module.HandleData(id, data).HasValue) { packet.Stream.AddValue("Data", data); } } var errorType = packet.Read <byte>(2); if (errorType == 1) { packet.Read <ushort>("Result", 16); packet.Read <uint>("Timeout", 32); } } else { var modules = packet.Read <byte>(3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { packet.ReadString("Type", 4); packet.ReadFourCC("Region"); var id = Utilities.ByteArrayToHexString(packet.ReadBytes("ModuleId", 32)); var dataSize = packet.Read <int>("Data size", 10); var data = packet.ReadBytes(dataSize); if (!module.HandleData(id, data, i).HasValue) { packet.Stream.AddValue("Data", data, i); } } packet.Stream.AddValue("Ping timeout", packet.Read <uint>(32) + int.MinValue); var hasOptionalData = packet.Read <bool>(1); if (hasOptionalData) { var hasConnectionInfo = packet.Read <bool>(1); if (hasConnectionInfo) { packet.Read <uint>("Threshold", 32); packet.Read <uint>("Rate", 32); } } packet.ReadString("First name", packet.Read <int>(8)); packet.ReadString("Last name", packet.Read <int>(8)); packet.Read <uint>("Account id", 32); packet.Read <byte>("Region", 8); packet.Read <ulong>("Account flags", 64); packet.Read <byte>("Game account region", 8); packet.ReadString("Game account name", packet.Read <int>(5) + 1); packet.Read <ulong>("Game account flags", 64); packet.Read <uint>("Failed logins", 32); if (packet.Read <bool>("Has RaF blob", 1)) { packet.ReadBytes("RaF Data", packet.Read <int>(10)); } } }
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 HandleResumeRequest(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); packet.ReadString("Account", 3, 9); packet.Read<byte>("GameAccountRegion", 0, 8); packet.ReadString("GameAccountName", 1, 5); }
public static void HandleLogonRequest(BattlenetPacket packet) { ReadRequestCommon(packet, "Common"); if (packet.ReadBoolean()) packet.ReadString("Account", 3, 9); }
public static void HandleListUpdate(BattlenetPacket packet) { if (packet.ReadBoolean()) { packet.Read<uint>("Category", 0, 32); packet.ReadSingle("Population"); packet.Read<byte>("StateFlags", 0, 8); packet.ReadSkip(19); packet.Read<uint>("Type", int.MinValue, 32); packet.ReadString("Name", 0, 10); if (packet.ReadBoolean()) { packet.ReadString("Version", 0, 5, "PrivilegedData"); packet.Read<uint>("ConfigId", 0, 32, "PrivilegedData"); var ip = packet.ReadBytes(4); var port = packet.ReadBytes(2); Array.Reverse(port); packet.Stream.AddValue("Address", new IPEndPoint(new IPAddress(ip), BitConverter.ToUInt16(port, 0)), "PrivilegedData"); } packet.Read<RealmInfoFlags>("InfoFlags", 0, 8); } packet.Read<byte>("Region", 0, 8); packet.ReadSkip(12); packet.Read<byte>("Site", 0, 8); packet.Read<uint>("Realm", 0, 32); }
public static void HandleServerRealmUpdate(BattlenetPacket packet) { if (!packet.Read<bool>(1)) return; packet.Read<uint>("Timezone", 32); packet.ReadSingle("Population"); packet.Read<byte>("Lock", 8); packet.Read<uint>("Unk", 19); packet.Stream.WriteLine(string.Format("Type: {0}", packet.Read<uint>(32) + int.MinValue)); packet.ReadString("Name", packet.Read<int>(10)); if (packet.Read<bool>("Has version", 1)) { packet.ReadString("Version", packet.Read<int>(5)); packet.Read<uint>("RealmId4", 32); var ip = packet.ReadBytes(4); var port = packet.ReadBytes(2); Array.Reverse(port); packet.Stream.WriteLine("IP address: {0}", new IPAddress(ip)); packet.Stream.WriteLine("Port: {0}", BitConverter.ToUInt16(port, 0)); } packet.Read<byte>("Flags", 8); packet.Read<byte>("Region", 8); packet.Read<short>("Unk2", 12); packet.Read<byte>("Battlegroup", 8); packet.Read<uint>("Battlegroup index", 32); }
public static void HandleToonReady(BattlenetPacket packet) { packet.Read<byte>("Region", 0, 8, "Name"); packet.ReadFourCC("ProgramId", "Name"); packet.Read<uint>("Realm", 0, 32, "Name"); packet.ReadString("Name", 2, 7, "Name"); packet.ReadSkip(21); packet.Read<ulong>("Id", 0, 64, "ProfileAddress"); packet.Read<uint>("Label", 0, 32, "ProfileAddress"); packet.Read<ulong>("Id", 0, 64, "Handle"); packet.Read<uint>("Realm", 0, 32, "Handle"); packet.Read<byte>("Region", 0, 8, "Handle"); packet.ReadFourCC("ProgramId", "Handle"); }
public static void HandleComplete(BattlenetPacket packet) { var failed = packet.Read <bool>(1); if (failed) { if (packet.Read <bool>(1)) // has module { var type = packet.ReadString(4); var region = packet.ReadFourCC(); var id = Utilities.ByteArrayToHexString(packet.ReadBytes(32)); var dataSize = packet.Read <int>(10); var data = packet.ReadBytes(dataSize); var module = new BattlenetModuleHandler(packet); packet.Stream.WriteLine(string.Format("Type: {0}", type)); packet.Stream.WriteLine(string.Format("Region: {0}", region)); packet.Stream.WriteLine(string.Format("ModuleId: {0}", id)); packet.Stream.WriteLine(string.Format("Data size: {0}", dataSize)); if (!module.HandleData(id, data).HasValue) { packet.Stream.WriteLine(string.Format("Data: {0}", Utilities.ByteArrayToHexString(data))); } } var errorType = packet.Read <byte>(2); if (errorType == 1) { packet.Stream.WriteLine(string.Format("Result: {0}", packet.Read <ushort>(16))); packet.Stream.WriteLine(string.Format("Unk: {0}", packet.Read <uint>(32))); } } else { var modules = packet.Read <byte>(3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { var type = packet.ReadString(4); var region = packet.ReadFourCC(); var id = Utilities.ByteArrayToHexString(packet.ReadBytes(32)); var dataSize = packet.Read <int>(10); var data = packet.ReadBytes(dataSize); packet.Stream.WriteLine(string.Format("[{0}] Type: {1}", i, type)); packet.Stream.WriteLine(string.Format("[{0}] Region: {1}", i, region)); packet.Stream.WriteLine(string.Format("[{0}] ModuleId: {1}", i, id)); packet.Stream.WriteLine(string.Format("[{0}] Data size: {1}", i, dataSize)); if (!module.HandleData(id, data, i).HasValue) { packet.Stream.WriteLine(string.Format("[{0}] Data: {1}", i, Utilities.ByteArrayToHexString(data))); } } packet.Stream.WriteLine(string.Format("Ping timeout: {0}", packet.Read <uint>(32) + int.MinValue)); var hasOptionalData = packet.Read <bool>(1); if (hasOptionalData) { var hasConnectionInfo = packet.Read <bool>(1); if (hasConnectionInfo) { packet.Read <uint>("Threshold", 32); packet.Read <uint>("Rate", 32); } } packet.ReadString("First name", packet.Read <int>(8)); packet.ReadString("Last name", packet.Read <int>(8)); packet.Read <uint>("Account id", 32); packet.Read <byte>("Unk8", 8); packet.Read <ulong>("Unk64", 64); packet.Read <byte>("Unk8", 8); packet.ReadString("Account name", packet.Read <int>(5) + 1); packet.Read <ulong>("Unk64", 64); packet.Read <uint>("Unk32", 32); if (packet.Read <bool>("Unk1", 1)) { packet.Stream.WriteLine(string.Format("Data: {0}", Utilities.ByteArrayToHexString(packet.ReadBytes(packet.Read <int>(10))))); } } }
public static void HandleGetStreamItemsResponse(BattlenetPacket packet) { packet.Read<ushort>("Unknown1", 16); packet.Read<ushort>("Unknown2", 16); packet.Read<uint>("Index", 32); var modules = packet.Read<byte>(6); for (var i = 0; i < modules; ++i) { packet.ReadString("Type", 4, i); packet.ReadFourCC("Region", i); packet.Stream.AddValue("ModuleId", Utilities.ByteArrayToHexString(packet.ReadBytes(32)), i); packet.Read<int>(27); // padding packet.Stream.AddValue("Publication time", Utilities.ByteArrayToHexString(BitConverter.GetBytes(packet.Read<uint>(32))), i); } }
public static void HandleInformationRequest(BattlenetPacket packet) { packet.ReadFourCC("Program"); packet.ReadFourCC("Platform"); packet.ReadFourCC("Locale"); var components = packet.Read<int>(6); for (var i = 0; i < components; ++i) { packet.ReadFourCC("Program", i); packet.ReadFourCC("Platform", i); packet.Read<uint>("Build", 32, i); } if (packet.Read<bool>(1)) packet.ReadString("Login", packet.Read<int>(9) + 3); }
public static void HandleToonReady(BattlenetPacket packet) { packet.Read<ulong>("Region", 8); packet.ReadFourCC("Game"); packet.Read<ulong>("Realmaddress", 32); packet.ReadString("Name", packet.Read<int>(7) + 2); packet.Read<ulong>(21); packet.Read<ulong>("Unk64", 64); packet.Read<ulong>("Unk32", 32); packet.Stream.AddValue("Guid", new WowGuid64(packet.Read<ulong>(64))); packet.Read<ulong>("Realmaddress", 32); packet.Read<ulong>("Region", 8); packet.ReadFourCC("Game"); }
public static void HandleComplete(BattlenetPacket packet) { var failed = packet.Read<bool>(1); if (failed) { if (packet.Read<bool>(1)) // has module { packet.ReadString("Type", 4); packet.ReadFourCC("Region"); var id = Utilities.ByteArrayToHexString(packet.ReadBytes("ModuleId", 32)); var dataSize = packet.Read<int>("Data size", 10); var data = packet.ReadBytes(dataSize); var module = new BattlenetModuleHandler(packet); if (!module.HandleData(id, data).HasValue) packet.Stream.AddValue("Data", data); } var errorType = packet.Read<byte>(2); if (errorType == 1) { packet.Read<ushort>("Result", 16); packet.Read<uint>("Timeout", 32); } } else { var modules = packet.Read<byte>(3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { packet.ReadString("Type", 4); packet.ReadFourCC("Region"); var id = Utilities.ByteArrayToHexString(packet.ReadBytes("ModuleId", 32)); var dataSize = packet.Read<int>("Data size", 10); var data = packet.ReadBytes(dataSize); if (!module.HandleData(id, data, i).HasValue) packet.Stream.AddValue("Data", data, i); } packet.Stream.AddValue("Ping timeout", packet.Read<uint>(32) + int.MinValue); var hasOptionalData = packet.Read<bool>(1); if (hasOptionalData) { var hasConnectionInfo = packet.Read<bool>(1); if (hasConnectionInfo) { packet.Read<uint>("Threshold", 32); packet.Read<uint>("Rate", 32); } } packet.ReadString("First name", packet.Read<int>(8)); packet.ReadString("Last name", packet.Read<int>(8)); packet.Read<uint>("Account id", 32); packet.Read<byte>("Region", 8); packet.Read<ulong>("Account flags", 64); packet.Read<byte>("Game account region", 8); packet.ReadString("Game account name", packet.Read<int>(5) + 1); packet.Read<ulong>("Game account flags", 64); packet.Read<uint>("Failed logins", 32); if (packet.Read<bool>("Has RaF blob", 1)) packet.ReadBytes("RaF Data", packet.Read<int>(10)); } }
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 HandleServerProofRequest(BattlenetPacket packet) { var modules = packet.Read<byte>(3); var module = new BattlenetModuleHandler(packet); for (var i = 0; i < modules; ++i) { packet.ReadString("Type", 4, i); packet.ReadFourCC("Region", i); var id = Utilities.ByteArrayToHexString(packet.ReadBytes(32)); packet.Stream.WriteLine(string.Format("[{0}] ModuleId: {1}", i, id)); var dataSize = packet.Read<int>("Data size", 10, i); var data = packet.ReadBytes(dataSize); var result = module.HandleData(id, data, i); if (!result.HasValue) packet.Stream.WriteLine(string.Format("[{0}] Data: {1}", i, Utilities.ByteArrayToHexString(data))); else if (!result.Value) ModulesWaitingForData.Add(id); } }