1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-05 03:23:50 +08:00

fix decode error.

This commit is contained in:
Mrs4s 2020-10-05 23:48:13 +08:00
parent cc0279f22e
commit 7538f1f128

View File

@ -85,19 +85,23 @@ func decodeLoginResponse(c *QQClient, _ uint16, payload []byte) (interface{}, er
c.t104 = m[0x104] c.t104 = m[0x104]
c.t174 = t174 c.t174 = t174
c.t402 = m[0x402] c.t402 = m[0x402]
phone := func() string {
r := binary.NewReader(m[0x178])
return r.ReadStringLimit(int(r.ReadInt32()))
}()
if t204, ok := m[0x204]; ok { // 同时支持扫码验证 ? if t204, ok := m[0x204]; ok { // 同时支持扫码验证 ?
return LoginResponse{ return LoginResponse{
Success: false, Success: false,
Error: SMSNeededError | UnsafeDeviceError, Error: SMSNeededError | UnsafeDeviceError,
VerifyUrl: string(t204), VerifyUrl: string(t204),
SMSPhone: string(m[0x178][4:]), SMSPhone: phone,
ErrorMessage: string(m[0x17e]), ErrorMessage: string(m[0x17e]),
}, nil }, nil
} }
return LoginResponse{ return LoginResponse{
Success: false, Success: false,
Error: SMSNeededError, Error: SMSNeededError,
SMSPhone: string(m[0x178][4:]), SMSPhone: phone,
ErrorMessage: string(m[0x17e]), ErrorMessage: string(m[0x17e]),
}, nil }, nil
} }