-
Notifications
You must be signed in to change notification settings - Fork 37
/
Packets.txt
151 lines (151 loc) · 3.45 KB
/
Packets.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Packet
// Content
Header
// name type ?value
/// EAX Message Authentication Code
mac [u8; 8]
/// Packet id
p_id u16
/// Client id
?c_id u16
// Pre condition
++ *from_client
/// Flags:
///
/// - 0x80 Unencrypted
/// - 0x40 Compressed
/// - 0x20 Newprotocol
/// - 0x10 Fragmented
flags -
/// Packet type: Higher nibble: Flags; Lower nibble: Packet type
///
/// Packet types:
///
/// - 0x0 Voice
/// - 0x1 Voice whisper
/// - 0x2 Command
/// - 0x3 Command low
/// - 0x4 Ping
/// - 0x5 Pong
/// - 0x6 Ack
/// - 0x7 Ack low
/// - 0x8 Init
p_type u8
// Post conditions
++ (res.p_type & 0xf) <= 8
// Enum
#Data
#C2SInit
++ header.mac.iter().eq(b"TS3INIT1")
++ header.c_id.is_some()
++ header.get_type() == PacketType::Init
Init0
/// Teamspeak version as timestamp
version u32
/// Init packet step number
- u8 0
/// Current timestamp
timestamp u32
random0 [u8; 4]
/// Reserved
- [u8; 8] [0; 8]
Init2
/// Teamspeak version as timestamp
version u32
/// Init packet step number
- u8 2
random1 [u8; 16]
random0_r [u8; 4]
Init4
/// Teamspeak version as timestamp
version u32
/// Init packet step number
- u8 4
x [u8; 64]
n [u8; 64]
level u32
random2 [u8; 100]
/// y = x ^ (2 ^ level) % n
y [u8; 64]
command Command
++ if let C2SInit::Init4 { ref command, .. } = res { command.command == "clientinitiv" && command.has_arg("alpha") && command.has_arg("omega") } else { true }
#S2CInit
++ header.mac.iter().eq(b"TS3INIT1")
++ header.c_id.is_none()
++ header.get_type() == PacketType::Init
Init1
/// Init packet step number
- u8 1
random1 [u8; 16]
/// Reversed `random0`
random0_r [u8; 4]
Init3
/// Init packet step number
- u8 3
x [u8; 64]
n [u8; 64]
level u32
random2 [u8; 100]
Init127
/// Init packet step number
- u8 127
- u8 0
VoiceC2S
++ header.get_type() == PacketType::Voice
++ header.c_id.is_some()
id u16
codec_type u8
voice_data Vec<u8>
VoiceS2C
++ header.get_type() == PacketType::Voice
++ header.c_id.is_none()
id u16
/// The id of the talking client
from_id u16
codec_type u8
voice_data Vec<u8>
VoiceWhisperC2S
++ header.get_type() == PacketType::VoiceWhisper
++ header.c_id.is_some()
++ !header.get_newprotocol()
id u16
codec_type u8
channel_count u8
client_count u8
/// [u64; channel_count], [u16; client_count], voice_data
data Vec<u8>
VoiceWhisperNewC2S
++ header.get_type() == PacketType::VoiceWhisper
++ header.c_id.is_some()
++ header.get_newprotocol()
id u16
codec_type u8
whisper_type u8
whisper_target u8
/// The targeted channel or group id (or 0 if not applicable)
target_id u64
voice_data Vec<u8>
VoiceWhisperS2C
++ header.get_type() == PacketType::VoiceWhisper
++ header.c_id.is_none()
id u16
/// The id of the talking client
from_id u16
codec_type u8
voice_data Vec<u8>
Command Command
++ header.get_type() == PacketType::Command
CommandLow Command
++ header.get_type() == PacketType::CommandLow
Ping
++ header.get_type() == PacketType::Ping
//- u16 0xeee9
/// Pong with packet id
Pong u16
++ header.get_type() == PacketType::Pong
/// Pong with packet id
Ack u16
++ header.get_type() == PacketType::Ack
/// Pong with packet id
AckLow u16
++ header.get_type() == PacketType::AckLow