1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-07 12:43:32 +08:00

fix encrypt.

This commit is contained in:
Mrs4s 2020-09-24 17:44:56 +08:00
parent 9ff687514e
commit 2e45f82d6a

View File

@ -67,12 +67,10 @@ func NewEncryptSession(t133 []byte) *EncryptSession {
func (e *EncryptSession) DoEncrypt(d, k []byte) []byte {
return binary.NewWriterF(func(w *binary.Writer) {
w.WriteByte(0x01)
w.WriteByte(0x03)
encrypt := binary.NewTeaCipher(k).Encrypt(d)
w.WriteUInt16(uint16(len(k)))
w.Write(k)
w.WriteUInt16(258)
w.WriteUInt16(0)
w.EncryptAndWrite(k, d)
w.Write(encrypt)
})
}