1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00
MiraiGo/internal/tlv/t544.go
2023-03-05 17:58:28 +08:00

24 lines
727 B
Go

package tlv
import "github.com/Mrs4s/MiraiGo/binary"
func T544(userId uint64, moduleId string, subCmd uint32, sdkVersion string, guid []byte, signer func(string, []byte) []byte) []byte {
return binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x544)
salt := binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt64(userId)
w.WriteBytesShort(guid)
w.WriteBytesShort([]byte(sdkVersion))
w.WriteUInt32(subCmd)
})
w.WriteBytesShort(signer(moduleId, salt)) // temporary solution
})
}
func T544Custom(moduleId string, salt []byte, signer func(string, []byte) []byte) []byte {
return binary.NewWriterF(func(w *binary.Writer) {
w.WriteUInt16(0x544)
w.WriteBytesShort(signer(moduleId, salt))
})
}