|
|
@@ -1,7 +1,5 @@
|
|
1
|
1
|
package obfuscated2
|
|
2
|
2
|
|
|
3
|
|
-import "encoding/binary"
|
|
4
|
|
-
|
|
5
|
3
|
const (
|
|
6
|
4
|
DefaultDC = 2
|
|
7
|
5
|
|
|
|
@@ -10,14 +8,12 @@ const (
|
|
10
|
8
|
handshakeFrameLenKey = 32
|
|
11
|
9
|
handshakeFrameLenIV = 16
|
|
12
|
10
|
handshakeFrameLenConnectionType = 4
|
|
13
|
|
- handshakeFrameLenDC = 2
|
|
14
|
11
|
|
|
15
|
12
|
handshakeFrameOffsetStart = 8
|
|
16
|
13
|
handshakeFrameOffsetKey = handshakeFrameOffsetStart
|
|
17
|
14
|
handshakeFrameOffsetIV = handshakeFrameOffsetKey + handshakeFrameLenKey
|
|
18
|
15
|
handshakeFrameOffsetConnectionType = handshakeFrameOffsetIV + handshakeFrameLenIV
|
|
19
|
16
|
handshakeFrameOffsetDC = handshakeFrameOffsetConnectionType + handshakeFrameLenConnectionType
|
|
20
|
|
- handshakeFrameOffsetEnd = handshakeFrameOffsetDC + handshakeFrameLenDC
|
|
21
|
17
|
)
|
|
22
|
18
|
|
|
23
|
19
|
// Connection-Type: Secure. We support only fake tls.
|
|
|
@@ -38,8 +34,7 @@ type handshakeFrame struct {
|
|
38
|
34
|
}
|
|
39
|
35
|
|
|
40
|
36
|
func (h *handshakeFrame) dc() int {
|
|
41
|
|
- data := h.data[handshakeFrameOffsetDC:handshakeFrameOffsetEnd]
|
|
42
|
|
- idx := int16(binary.LittleEndian.Uint16(data))
|
|
|
37
|
+ idx := int16(h.data[handshakeFrameOffsetDC]) | int16(h.data[handshakeFrameOffsetDC+1])<<8 // nolint: gomnd, lll // little endian for int16 is here
|
|
43
|
38
|
|
|
44
|
39
|
switch {
|
|
45
|
40
|
case idx > 0:
|