From f050be42f2983bf6a2ddb033e7f2ebbdf46a985f Mon Sep 17 00:00:00 2001 From: Bottersnike Date: Thu, 13 Jan 2022 19:41:04 +0000 Subject: [PATCH] Correct content byte info --- templates/pages/packet.html | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/templates/pages/packet.html b/templates/pages/packet.html index cbe834a..92e9641 100644 --- a/templates/pages/packet.html +++ b/templates/pages/packet.html @@ -108,22 +108,22 @@ 0x42 - Compressed data + Packed names, contains data 0x43 - Compressed, no data + Packed names, schema only 0x45 - Decompressed data + Full names, contains data 0x46 - Decompressed, no data + Full names, schema only -

Decompressed packets contain an XML string. Compressed packets are what we're interested in here.

+

I haven't seen 0x44, so no idea what that one does, before you ask.

The encoding flag indicates the encoding for all string types in the packet (more on those later). Possible values are:

@@ -234,9 +234,15 @@
-

Structure names are encoded as densely packed 6 bit values, length prefixed (nlen). The acceptable - alphabet is 0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz, and the packed values - are indecies within this alphabet.

+

The encoding of structure names varies depending on the packet content byte. If the content flag indicates we have + full names, then nlen will be masked with 0x40. The string length is the unmasked value, + +1 (0-length names make no sense anyway). We can then read off the correct number of bytes, and decode accordingly. +

+

If we are instead parsing packed names, then the names are encoded as densely packed 6 bit values. The length prefix + (nlen) determines the length of the final unpacked string. The acceptable alphabet is + 0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz, and the packed values are indecies + within this alphabet. +

The children can be a combination of either attribute names, or child tags. Attribute names are represented by the byte 0x2E followed by a length prefixed name as defined above. Child tags follow the above @@ -366,7 +372,7 @@ 8 uint8[4] int - 4s16 + 4u16 @@ -539,7 +545,7 @@ 4 uint16[2] int - 2s16 + 2u16 0x33 @@ -689,7 +695,7 @@ 6 uint16[3] int - 3s16 + 3u16 0x3c