Repository navigation
Protocol Exchange Objects
Every object traded over YY is either a typed exchange object, which starts with cc, or an envelope of messages, which starts with aa. This page gives the binary layouts of the typed objects. Envelopes are on CEC Messages. The order they are sent in is on Exchange Flow.
All integers are little-endian unless stated.
Implemented in: cec::object, link.
| Offset | Size | Field |
|---|---|---|
0x00 |
2 | Magic 63 63 (cc) |
0x02 |
2 | Flags: 0x0000 or 0xffff (meaning unknown) |
0x04 |
4 | Type |
0x08 |
4 | Reserved, 0 |
0x0c |
4 | Payload length |
0x10 |
n | Payload |
The total length of an object is payload length + 0x10. The receiving YY session uses this to know when an object is complete.
Requests have odd types. Most answers use the type one above the request.
| Type | Name | Flags sent | Payload | Answer |
|---|---|---|---|---|
0x11 |
Services | 0xffff |
Service TLVs and token | 0x12 |
0x21 |
Console ID | 0xffff |
8 bytes | 0x22 |
0x23 |
Unknown | 0xffff |
u32 1 |
0x24 with u32 2 |
0x31 |
Offer | 0xffff |
Title list |
0x32, the answerer's own offer |
0x33 |
Verdict | 0xffff |
Title list with codes |
0x34, the answerer's verdict |
0x41 |
Session open | 0x0000 |
40 bytes | 0x42 |
0x43 |
Capabilities | 0x0000 |
16 bytes |
0x43, unchanged |
0x81 |
Message list | 0x0000 |
Envelope titles and sizes | The answerer's own 0x81
|
0xf2 |
Scanning | 0xffff |
4 zero bytes | None |
The purpose of 0x23/0x24 is not known. The values 1 and 2 are what consoles send. Type 0xf2 is sent by a console that went back to scanning; ctrpass also sends it once in one recovery case (see YY Transport).
Payload, 40 bytes:
| Offset | Size | Field |
|---|---|---|
0x00 |
8 | Random |
0x08 |
8 | Zero |
0x10 |
4 | Random |
0x14 |
6 | Sender's MAC |
0x1a |
2 | Zero |
0x1c |
12 | Current local time, CEC timestamp format |
The meaning of the random fields is not known. ctrpass fills them from the system random source.
The CEC timestamp format:
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | Year |
| 4 | 1 | Month, 1-12 |
| 5 | 1 | Day |
| 6 | 1 | Weekday, days since Sunday |
| 7 | 1 | Hour |
| 8 | 1 | Minute |
| 9 | 1 | Second |
| 10 | 2 | Millisecond |
It has no time zone. ctrpass writes the host's clock as if it were local console time.
16 bytes that both sides send unchanged:
1b 00 10 00 1a 80 0f 00 ff ff ff ff 84 54 12 00
The meaning of the fields is not known. The answer is the answerer's own 0x43 object, with the same type.
The payload is the same TLV list as in the discovery vendor element, without the OUI and subtype: one or more 1,1 TLVs of service records, then a 0,15 TLV with the 8-byte token. See Discovery. Inside the link the full list is sent, not only what fit in a probe.
8 bytes. ctrpass sends a new random value for each exchange.
The offer (0x31, 0x32) and verdict (0x33, 0x34) payloads use the same list format.
Header, 0x2c bytes:
| Offset | Size | Field |
|---|---|---|
0x00 |
2 | Magic 65 65 (ee) |
0x02 |
2 | Zero |
0x04 |
4 | Total list length: 0x2c + 0x20 × count
|
0x08 |
4 | Entry count, at most 24 |
0x0c |
32 | Zero; meaning unknown |
Entries follow, 0x20 bytes each:
| Offset | Size | Field |
|---|---|---|
0x00 |
4 | Title ID |
0x04 |
1 | Send mode of the title's messages |
0x05 |
1 | Flags of the title's messages |
0x06 |
2 | Code: 0 in an offer, 1 admit, 2 refuse in a verdict |
0x08 |
4 | Total bytes of the title's containers |
0x0c |
4 | Number of containers |
0x10 |
16 | Zero; meaning unknown |
The mode and flags come from the first container of the title. A side that sends nothing still sends an offer and a verdict, with zero entries.
Payload, always 196 bytes:
| Offset | Size | Field |
|---|---|---|
0x00 |
4 | Envelope count, at most 24 |
0x04 |
8 × 24 | Entries: u32 title ID, u32 envelope length in bytes |
Unused entries are zero. The envelopes listed follow as separate objects, in the same order.
flowchart TD
plan["Plan: chosen services and messages"] --> so["0x41 session open"]
so --> cap["0x43 capabilities"]
cap --> svc["0x11 services: link records and token"]
svc --> group["Group messages by title, in order of first appearance"]
group --> env["One envelope per title"]
group --> ent["One offer entry per title"]
env --> list["0x81 message list"]
ent --> cid["0x21 console ID, random"]
cid --> t23["0x23 value 1"]
t23 --> off["0x31 offer"]
off --> ver["0x33 verdict: offer entries with code 1"]
ver --> list
list --> envs["Envelopes"]
The resulting list is: 0x41, 0x43, 0x11, 0x21, 0x23, 0x31, 0x33, 0x81, envelope, envelope, .... With no messages, the offer and verdict are empty lists and the message list has a count of 0.
How to set up
- Overview and requirements
- Choosing a Wi-Fi adapter
- Building and installing
- Making the key file
- Desktop app
- Command line
- Messages and emulators
- Troubleshooting
Plugins
Protocol
- Overview
- Discovery
- Link setup
- Frames and CCMP
- YY transport
- Exchange flow
- Exchange objects
- CEC messages
- CEC message boxes
- Mii records
- Mii Plaza
- Keys
ctrpass library
Linux