From 31178593674b256231c5394037e489f3cefe30d8 Mon Sep 17 00:00:00 2001 From: Linwenxuan Date: Tue, 26 Mar 2024 20:00:55 +0800 Subject: [PATCH] [Core] Implemented trpc.qq_new_tech.status_svc.StatusService.Register --- KonataNT/Core/BaseClient.cs | 8 ++++++++ KonataNT/Core/Packet/Login/Tlv543.cs | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 KonataNT/Core/Packet/Login/Tlv543.cs diff --git a/KonataNT/Core/BaseClient.cs b/KonataNT/Core/BaseClient.cs index 9764f49..65817fe 100644 --- a/KonataNT/Core/BaseClient.cs +++ b/KonataNT/Core/BaseClient.cs @@ -171,6 +171,12 @@ public async Task QrCodeLogin() KeyStore.Tgt = collection.TlvMap[0x10a]; KeyStore.D2 = collection.TlvMap[0x143]; KeyStore.D2Key = collection.TlvMap[0x305]; + + var raw = collection.TlvMap[0x543]; + var layer = Tlv543.Deserialize(raw); + var layer1 = ((Tlv543)layer).Layer1; + var layer2 = layer1.Layer2; + KeyStore.Uid = layer2.Uid; var uidRaw = collection.TlvMap[0x543]; var t11A = collection.TlvMap[0x11a]; @@ -238,6 +244,8 @@ private async Task BotOnline(bool isReconnect = false) const string command = "trpc.qq_new_tech.status_svc.StatusService.Register"; var resp = await PacketHandler.SendPacket(command, statusRegister.Serialize()); + + Console.WriteLine(resp.Hex()); var arg = new BotOnlineEvent(isReconnect ? BotOnlineEvent.OnlineReason.Reconnect : BotOnlineEvent.OnlineReason.Login); EventEmitter.PostEvent(arg); diff --git a/KonataNT/Core/Packet/Login/Tlv543.cs b/KonataNT/Core/Packet/Login/Tlv543.cs new file mode 100644 index 0000000..4df6c8a --- /dev/null +++ b/KonataNT/Core/Packet/Login/Tlv543.cs @@ -0,0 +1,23 @@ +using KonataNT.Proto; + +#pragma warning disable CS8618 + +namespace KonataNT.Core.Packet.Login; + +[ProtoContract] +internal partial class Tlv543 +{ + [ProtoMember(9)] public Tlv543Layer1 Layer1 { get; set; } +} + +[ProtoContract] +internal partial class Tlv543Layer1 +{ + [ProtoMember(11)] public Tlv543Layer2 Layer2 { get; set; } +} + +[ProtoContract] +internal partial class Tlv543Layer2 +{ + [ProtoMember(1)] public string Uid { get; set; } +} \ No newline at end of file