From 2e45f82d6a79853d60072224fd45aef6a9cab464 Mon Sep 17 00:00:00 2001 From: Mrs4s <1844812067@qq.com> Date: Thu, 24 Sep 2020 17:44:56 +0800 Subject: [PATCH] fix encrypt. --- protocol/crypto/crypto.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/protocol/crypto/crypto.go b/protocol/crypto/crypto.go index c3d17086..6d521e7b 100644 --- a/protocol/crypto/crypto.go +++ b/protocol/crypto/crypto.go @@ -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) }) }