1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix: WriteIntLvPacket length error (#226)

This commit is contained in:
源文雨 2021-12-23 23:04:13 +08:00 committed by GitHub
parent 3e84f279c1
commit cf864799cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,9 +100,9 @@ func (w *Writer) EncryptAndWrite(key []byte, data []byte) {
} }
func (w *Writer) WriteIntLvPacket(offset int, f func(*Writer)) { func (w *Writer) WriteIntLvPacket(offset int, f func(*Writer)) {
w.FillUInt32() pos := w.FillUInt32()
f(w) f(w)
w.WriteUInt32At(0, uint32(w.Len()-4+offset)) w.WriteUInt32At(pos, uint32(w.Len()+offset-pos-4))
} }
func (w *Writer) WriteBytesShort(data []byte) { func (w *Writer) WriteBytesShort(data []byte) {