Add tests for obfuscated2 clientside

This commit is contained in:
9seconds
2021-03-22 11:34:32 +03:00
parent 4d2d21e101
commit 69203f3e23
21 changed files with 320 additions and 22 deletions
+10 -2
View File
@@ -35,10 +35,18 @@ type handshakeFrame struct {
data [handshakeFrameLen]byte
}
func (h *handshakeFrame) dc() int16 {
func (h *handshakeFrame) dc() int {
data := h.data[handshakeFrameOffsetDC:handshakeFrameOffsetEnd]
idx := int16(binary.LittleEndian.Uint16(data))
return int16(binary.LittleEndian.Uint16(data))
switch {
case idx > 0:
return int(idx) - 1
case idx < 0:
return -int(idx + 1)
default:
return 0
}
}
func (h *handshakeFrame) key() []byte {