mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-08 04:55:56 +08:00
fix encrypt.
This commit is contained in:
parent
9ff687514e
commit
2e45f82d6a
@ -67,12 +67,10 @@ func NewEncryptSession(t133 []byte) *EncryptSession {
|
|||||||
|
|
||||||
func (e *EncryptSession) DoEncrypt(d, k []byte) []byte {
|
func (e *EncryptSession) DoEncrypt(d, k []byte) []byte {
|
||||||
return binary.NewWriterF(func(w *binary.Writer) {
|
return binary.NewWriterF(func(w *binary.Writer) {
|
||||||
w.WriteByte(0x01)
|
encrypt := binary.NewTeaCipher(k).Encrypt(d)
|
||||||
w.WriteByte(0x03)
|
w.WriteUInt16(uint16(len(k)))
|
||||||
w.Write(k)
|
w.Write(k)
|
||||||
w.WriteUInt16(258)
|
w.Write(encrypt)
|
||||||
w.WriteUInt16(0)
|
|
||||||
w.EncryptAndWrite(k, d)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user