TS3INIT packet structure

Tarpid

Member
Feb 13, 2016
5
2
38
Does anyone researched a structure of response data returned from this packet?
Does it include version string or any useful info about a server?

It length of 32 bytes and always starts with "TS3INIT1":
Code:
54 53 33 49 4e 49 54 31 00 65 88 01 ...
But other 20 bytes are random for each connection.
 
Last edited:

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Does anyone researched a structure of response data returned from this packet?
yes
Does it include version string or any useful info about a server?
no, but some information about the client.
The primary focus in this part of the connection is to prevent DOS attacks.

If you want to understand those packages I'd recommend you to look here, or for a implementation example here.
The protocol paper is still work in progress and does not offer the basic scheme of all packages (which in this case is 8 byte mac, 2 byte packet id, 1 byte type + flags, the 01 is already belonging to the data)

Alternatively you can take an hour or two and try to read through my code, the TS3Crypt.cs is ok documented and explains most of what is happening during ecryption etc. For a highel level understanding you should also take a look at the Ts3FullClient class and the PacketHandler

~Splamy
 

Tarpid

Member
Feb 13, 2016
5
2
38
Very thanks for the reply! After a handshake what packet have to be sent to receive a server version?
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Short answer:
client to server: >
server to client: <
> clientinitiv[...]
< clientinitivexpand[...]
> clientinit[...]
< initserver[...] <- here
(also you will already need ecryption for the first two packets and there is a ecpryption change after clientinitivexpand)

The long answer is too long to write here, check out the code (it's only a few functions) or wait a few weeks for the final paper.
 

Jackbox

Active Member
Jan 2, 2016
197
96
74
Short answer:
client to server: >
server to client: <
> clientinitiv[...]
< clientinitivexpand[...]
> clientinit[...]
< initserver[...] <- here
(also you will already need ecryption for the first two packets and there is a ecpryption change after clientinitivexpand)

The long answer is too long to write here, check out the code (it's only a few functions) or wait a few weeks for the final paper.
I am excited for the coming paper, this is going to be good. :)
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Damn, an open source musicbot and alternative teamspeak client, that's hot.

Is there a special reason why you don't have releases for thr most common distributions (ubuntu/debian)?
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Damn, an open source musicbot and alternative teamspeak client, that's hot.

Is there a special reason why you don't have releases for thr most common distributions (ubuntu/debian)?
The same reason why I don't have any release for any platform (Except the alpha thing which is not a real prerelease but the last version that does not work with my client as base):
The project is far from finished and I'm still working on a lot of things. If someone is willed to compile it for himself to take a sneak peak I will gladly support him, take criticism and accept ideas for improvement. But until then I will keep it in a kinda alpha state where I'm free to break stuff at any time.
 

Spawner

Member
Apr 22, 2017
1
0
33
So how can I know the data sent here:

Code:
   0x0000:  4528 0052 62e9 0000 7511 b3d4 a0b2 d15e  E(.Rb...u......^
    0x0010:  5fac 5cf8 f936 2703 003e 50f1 5453 3349  _.\..6'..>P.TS3I
    0x0020:  4e49 5431 0065 0000 8805 469e 2804 2f84  NIT1.e....F.(./.
    0x0030:  90be d99a c5fe ca3f ee67 c4bf 760d b2e4  .......?.g..v...
    0x0040:  6a7f 2b8b e5d4 300a 0594 0344 2fde eaf4  j.+...0....D/...
    0x0050:  68a2
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Thanks for your answer and i look forward to the first release so i can use it in a production environment :)
If i can help you out financially, let me know ;)

P.S. I think your project should have it's own thread to receive more attention by contributors and potential investors ^^
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
I actually read through all of that and damn, the thread starts to derail damn early.
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Thanks for your answer and i look forward to the first release so i can use it in a production environment :)
If i can help you out financially, let me know ;)

P.S. I think your project should have it's own thread to receive more attention by contributors and potential investors ^^
That's nice, but I don't take donations (yet). Simply because it doesn't make anything faster. At the moment as a student my only limit is time and somewhat motivation.

He kind of did back last May (almost a year ago).

https://r4p3.net/threads/ts3-protocol.2163/
Haha, yeah I remember, that isn't really a worthy post for the Bot :p. That was before all started, when we still used the real client with a plugin, pulseaudio, virual-x server and a seperate bot controller. Good ol' times, but I had a dream, that on day... ^^

Yeah, maybe I could make a proper thread for the Bot, but before that I will need to setup a small contribution guide, because if someone should really make a pr it should be in a format that I want to accept.
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
I Would also highly apprectiate it if you would atleast start to kinda document the ts3client library on readthedocs or something.
  • Events that you can register for (client.onConnect for example)
  • Functions you can use (client.kickFromServer(), etc)
  • How to get any variable from own client and other clients.
  • Also all dataTypes and eventArgs.
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Oy mate documantition? You wanna slow the project down?
Uh just kidding, yeah I know it could really need a bit more documentation, but that is also work and takes time and that is time I can invest into writing code. Also while I'm the only one working on it and my userbase is pretty small I can talk personally if someone needs a quickstart.
Regading your points:
Events that you can register for (client.onConnect for example) / Functions you can use (client.kickFromServer(), etc)
Hm, one thing is my client is a pretty 'shallow' implementation above the underlying command system so most of the commands can be easiliy looked up in the official ts3 docs.
My goal is just to make a homogeneous calling interface for the query and full client.
Also I'm planning to write a script which would parse the ts3doc and autogenerate all functions (including their comments). The parser would just have to be powerful enough to support various exceptions and rewriting options.

How to get any variable from own client and other clients.
This might be a classical case for some basic tutorial for the most common functions with a few examples. (As everything when I have time)

Also all dataTypes and eventArgs.
Most of the stuff is autogenerated and self-explanatory or can be deferred from the ts3doc

on readthedocs
I've taken a look there and I'm not quite sure how this works, but if it works the way i think it works then it is a lot of work
 

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Thanks for your explaining answer.
> Also while I'm the only one working on it and my userbase is pretty small I can talk personally if someone needs a quickstart.
Sounds like a good option though :)
 

Najsr

Moderator
TeamSpeak Developer
Apr 23, 2016
483
249
167
Let's refresh this thread :D
I have a question. @Splamy do you know the structure of voice packet? Because digging trough the code isn't easy for me :D
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Thanks ^^
Also another question, did you implement playback for your ts3client? :D
Not yet, wou will have to read the voice packets manually, the incomming packets should all have the same structure (cant entirely remember incomming whisper packets right now though)
 
Top