Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传群文件存在问题 新发现 #344

Open
kkgg0521 opened this issue Dec 13, 2023 · 1 comment
Open

上传群文件存在问题 新发现 #344

kkgg0521 opened this issue Dec 13, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kkgg0521
Copy link

手表协议, 以下代码 只会走 t = 1 的情况将无法使用上传群文件接口

`

// ConfigPushSvc.PushReq
func decodePushReqPacket(c *QQClient, pkt *network.Packet) (any, error) {

request := &jce.RequestPacket{}
request.ReadFrom(jce.NewJceReader(pkt.Payload))
data := &jce.RequestDataVersion2{}
data.ReadFrom(jce.NewJceReader(request.SBuffer))
r := jce.NewJceReader(data.Map["PushReq"]["ConfigPush.PushReq"][1:])
t := r.ReadInt32(1)

jceBuf := r.ReadBytes(2)
if len(jceBuf) > 0 {
	switch t {
	case 1:
		ssoPkt := jce.NewJceReader(jceBuf)
		servers := ssoPkt.ReadSsoServerInfos(1)
		if len(servers) > 0 {
			var adds []netip.AddrPort
			for _, s := range servers {
				if strings.Contains(s.Server, "com") {
					continue
				}
				c.debug("got new server addr: %v location: %v", s.Server, s.Location)
				addr, err := netip.ParseAddr(s.Server)
				if err == nil {
					adds = append(adds, netip.AddrPortFrom(addr, uint16(s.Port)))
				}
			}
			f := true
			for _, e := range c.eventHandlers.serverUpdatedHandlers {
				cover(func() {
					if !e(c, &ServerUpdatedEvent{Servers: servers}) {
						f = false
					}
				})
			}
			if f {

				c.SetCustomServer(adds)
			}
			return nil, nil
		}
	case 2:
		fmtPkt := jce.NewJceReader(jceBuf)
		list := &jce.FileStoragePushFSSvcList{}
		list.ReadFrom(fmtPkt)
		c.debug("got file storage svc push.")
		// c.fileStorageInfo = list
		rsp := cmd0x6ff.C501RspBody{}
		if err := proto.Unmarshal(list.BigDataChannel.PbBuf, &rsp); err == nil && rsp.RspBody != nil {
			c.highwaySession.SigSession = rsp.RspBody.SigSession
			c.highwaySession.SessionKey = rsp.RspBody.SessionKey
			for _, srv := range rsp.RspBody.Addrs {
				if srv.ServiceType.Unwrap() == 10 {
					for _, addr := range srv.Addrs {
						c.highwaySession.AppendAddr(addr.Ip.Unwrap(), addr.Port.Unwrap())
					}
				}
				/*
					if srv.ServiceType.Unwrap() == 21 {
						for _, addr := range srv.Addrs {
							c.otherSrvAddrs = append(c.otherSrvAddrs, fmt.Sprintf("%v:%v", binary.UInt32ToIPV4Address(addr.Ip.Unwrap()), addr.Port.Unwrap()))
						}
					}

				*/
			}
		}
	}
}

seq := r.ReadInt64(3)
_, resp := c.buildConfPushRespPacket(t, seq, jceBuf)
return nil, c.sendPacket(resp)

}

`

@SinKingCloud
Copy link

#347 (comment)

@fumiama fumiama added bug Something isn't working help wanted Extra attention is needed labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants