Skip to content

Commit

Permalink
update some tlv packet
Browse files Browse the repository at this point in the history
  • Loading branch information
wdvxdr1123 committed Nov 19, 2021
1 parent 19e2050 commit 1f8edc2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion client/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
w.Write(tlv.T100(c.version.SSOVersion, 2, c.version.MainSigMap))
w.Write(tlv.T107(0))
w.Write(tlv.T108(c.ksid))
w.Write(tlv.T144(
c.deviceInfo.AndroidId,
c.deviceInfo.GenDeviceInfoData(),
Expand Down Expand Up @@ -348,6 +349,8 @@ func (c *QQClient) buildRequestTgtgtNopicsigPacket() (uint16, []byte) {
w.Write(tlv.T516())
w.Write(tlv.T521(0))
w.Write(tlv.T525(tlv.T536([]byte{0x01, 0x00})))
// w.Write(tlv.545())
w.Write(tlv.T545([]byte(c.deviceInfo.IMEI)))
})
packet := packets.BuildUniPacket(c.Uin, seq, "wtlogin.exchange_emp", 2, c.OutGoingPacketSessionId, []byte{}, make([]byte, 16), req)
return seq, packet
Expand All @@ -362,7 +365,7 @@ func (c *QQClient) buildRequestChangeSigPacket() (uint16, []byte) {
w.Write(tlv.T100(c.version.SSOVersion, 100, c.version.MainSigMap))
w.Write(tlv.T10A(c.sigInfo.tgt))
w.Write(tlv.T116(c.version.MiscBitmap, c.version.SubSigmap))
w.Write(tlv.T108(c.deviceInfo.IMEI))
w.Write(tlv.T108(c.ksid))
h := md5.Sum(c.sigInfo.d2Key)
w.Write(tlv.T144(
c.deviceInfo.AndroidId,
Expand Down
4 changes: 2 additions & 2 deletions internal/tlv/t108.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package tlv

import "github.com/Mrs4s/MiraiGo/binary"

func T108(imei string) []byte {
func T108(ksid []byte) []byte {
return binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x108)
w.WriteBytesShort([]byte(imei))
w.WriteBytesShort(ksid)
})
}
10 changes: 10 additions & 0 deletions internal/tlv/t545.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package tlv

import "github.com/Mrs4s/MiraiGo/binary"

func T545(imei []byte) []byte {
return binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x108)
w.WriteBytesShort(imei)
})
}

0 comments on commit 1f8edc2

Please sign in to comment.