mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 07:55:33 +01:00
fix encryption not working with S6
This commit is contained in:
@@ -3,6 +3,7 @@ package network
|
|||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
|
_config "erupe-ce/config"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
@@ -47,10 +48,15 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
dataSize := uint32(cph.DataSize) + (uint32(cph.Pf0-0x03) * 0x1000)
|
|
||||||
|
|
||||||
// Now read the encrypted packet body after getting its size from the header.
|
// Now read the encrypted packet body after getting its size from the header.
|
||||||
encryptedPacketBody := make([]byte, dataSize)
|
var encryptedPacketBody []byte
|
||||||
|
|
||||||
|
// Don't know when support for this was added, works in Forward.4, doesn't work in Season 6.0
|
||||||
|
if _config.ErupeConfig.RealClientMode < _config.F1 {
|
||||||
|
encryptedPacketBody = make([]byte, cph.DataSize)
|
||||||
|
} else {
|
||||||
|
encryptedPacketBody = make([]byte, uint32(cph.DataSize)+(uint32(cph.Pf0-0x03)*0x1000))
|
||||||
|
}
|
||||||
_, err = io.ReadFull(cc.conn, encryptedPacketBody)
|
_, err = io.ReadFull(cc.conn, encryptedPacketBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user