using System.Collections.Generic; using System.Linq; using System.Text.Json; bool logProfileGroups = false; Send(Out["GetExtendedProfileByName"],"CHAT-GPT",false); OnIntercept(In["ExtendedProfile"], async p => { try { var packet = p.Packet; var profileData = new Dictionary { ["UserId"] = packet.ReadInt(), ["Username"] = packet.ReadString(), ["Figure"] = packet.ReadString(), ["Motto"] = packet.ReadString(), ["CreationDate"] = packet.ReadString(), ["AchievementScore"] = packet.ReadInt(), ["FriendCount"] = packet.ReadInt(), ["IsFriend"] = packet.ReadBool(), ["FriendRequestSentByMe"] = packet.ReadBool(), ["IsOnline"] = packet.ReadBool() }; int groupCount = packet.ReadInt(); profileData["GroupCount"] = groupCount; if (logProfileGroups) { profileData["Groups"] = Enumerable.Range(0, groupCount).Select(_ => new Dictionary { ["GroupId"] = packet.ReadInt(), ["GroupName"] = packet.ReadString(), ["BadgeCode"] = packet.ReadString(), ["Colour1Hex"] = packet.ReadString(), ["Colour2Hex"] = packet.ReadString(), ["IsFavourite"] = packet.ReadBool(), ["OwnerId"] = packet.ReadInt(), ["HasForum"] = packet.ReadBool() }).ToList(); } else { for (int i = 0; i < groupCount; i++) { packet.ReadInt(); packet.ReadString(); packet.ReadString(); packet.ReadString(); packet.ReadString(); packet.ReadBool(); packet.ReadInt(); packet.ReadBool(); } } profileData["LastAccessSecondsAgo"] = packet.ReadInt(); profileData["ProfileVisible"] = packet.ReadBool(); packet.ReadBool(); profileData["FriendshipsCount"] = packet.ReadInt(); profileData["FriendshipsPendingCount"] = packet.ReadInt(); profileData["StarGems"] = packet.ReadInt(); if ((packet.Length - packet.Position) > 0) try { profileData["AllowDirectMail"] = packet.ReadBool(); } catch { } if ((packet.Length - packet.Position) > 0) try { packet.ReadBool(); } catch { } p.Block(); Log(JsonSerializer.Serialize(profileData, new JsonSerializerOptions { WriteIndented = true })); } catch (IndexOutOfRangeException) { Log("!#!# ERR: Packet structure mismatch\n" + p); } catch (Exception ex) { Log($"!#!# ERR: {ex.GetType().Name}\n{p}"); } }); Wait();