1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix protocol.

This commit is contained in:
Mrs4s 2021-01-25 03:53:20 +08:00
parent 6ba8bb933f
commit d216d26eb1
3 changed files with 5 additions and 2 deletions

View File

@ -222,7 +222,7 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
}))
w.Write(tlv.T147(16, []byte(c.version.SortVersionName), c.version.ApkSign))
w.Write(tlv.T177(c.version.BuildTime, c.version.SdkVersion))
w.Write(tlv.T400(c.g, c.Uin, SystemDeviceInfo.Guid, []byte("stMNokHgxZUGhsYp"), 1, 16, c.t403))
w.Write(tlv.T400(c.g, c.Uin, SystemDeviceInfo.Guid, c.dpwd, 1, 16, c.t403))
w.Write(tlv.T187(SystemDeviceInfo.MacAddress))
w.Write(tlv.T188(SystemDeviceInfo.AndroidId))
w.Write(tlv.T194(SystemDeviceInfo.IMSIMd5))

View File

@ -57,6 +57,7 @@ type QQClient struct {
retryTimes int
version *versionInfo
dpwd []byte
syncCookie []byte
pubAccountCookie []byte
msgCtrlBuf []byte

View File

@ -6,6 +6,7 @@ import (
"fmt"
"github.com/Mrs4s/MiraiGo/client/pb/cmd0x6ff"
"github.com/Mrs4s/MiraiGo/client/pb/profilecard"
"github.com/Mrs4s/MiraiGo/utils"
"net"
"strconv"
"strings"
@ -40,8 +41,9 @@ func decodeLoginResponse(c *QQClient, _ uint16, payload []byte) (interface{}, er
reader.ReadUInt16()
m := reader.ReadTlvMap(2)
if m.Exists(0x402) {
c.dpwd = []byte(utils.RandomString(16))
c.t402 = m[0x402]
h := md5.Sum(append(append(SystemDeviceInfo.Guid, []byte("stMNokHgxZUGhsYp")...), c.t402...))
h := md5.Sum(append(append(SystemDeviceInfo.Guid, c.dpwd...), c.t402...))
c.g = h[:]
}
if t == 0 { // login success