Open RestartFU opened 5 months ago
What's the entire buffer of nvmServerToClientHandshake
?
The entire 808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808 080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808000
fragment is part of the varint fyi .-.
After some debugging in the Discord server, a "patch" got written: (of course this would have to be copied onto other types as well)
func (r *Reader) Varuint32(x *uint32) {
var v uint32
+ var i int
- for i := 0; i < 35; i += 7 {
+ for {
b, err := r.r.ReadByte()
if err != nil {
r.panic(err)
}
v |= uint32(b&0x7f) << i
if b&0x80 == 0 {
*x = v
return
}
+ i += 7
}
- r.panic(errVarIntOverflow)
}
It turns out the client won't stop reading until it gets to the "end". This patch should be used temporarily though, since this is technically an issue on Bedrock's side where it doesn't have a strict limit on how much it should read.
some servers (ex: skill-mine.ru:19133) send invalid varints on purpose, preventing anyone using gophertunnel to join their servers
when removing the panic: