From dfd10f4405183eddf79329fee64dff2b81fb8306 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Thu, 23 Feb 2023 16:29:15 +0800 Subject: [PATCH] client: fix fetch qrcode --- client/decoders.go | 2 +- client/internal/network/transport.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/decoders.go b/client/decoders.go index 7899622b..b949fceb 100644 --- a/client/decoders.go +++ b/client/decoders.go @@ -253,7 +253,7 @@ func decodeTransEmpResponse(c *QQClient, pkt *network.Packet) (any, error) { } sig := body.ReadBytesShort() body.ReadUInt16() - m, err := tlv.NewDecoder(2, 2).DecodeRecordMap(reader.ReadAvailable()) + m, err := tlv.NewDecoder(2, 2).DecodeRecordMap(body.ReadAvailable()) if err != nil { return nil, err } diff --git a/client/internal/network/transport.go b/client/internal/network/transport.go index 3590d294..caa5bbed 100644 --- a/client/internal/network/transport.go +++ b/client/internal/network/transport.go @@ -21,8 +21,8 @@ func (t *Transport) packBody(req *Request, w *binary.Writer) { pos := w.FillUInt32() if req.Type == RequestTypeLogin { w.WriteUInt32(uint32(req.SequenceID)) - w.WriteUInt32((*t.Version).AppId) - w.WriteUInt32((*t.Version).SubAppId) + w.WriteUInt32(t.Version.AppId) + w.WriteUInt32(t.Version.SubAppId) w.Write([]byte{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}) tgt := t.Sig.TGT if len(tgt) == 0 || len(tgt) == 4 {