Game Packets

Certain frames contain game packets, which are recorded server game packets. While stored as byte arrays within these frames, the data is actually encoded in a bitstream format.

Frames contain multiple packets, concatenated together. Within a packet is a single protobuf message, encoded as bytes, we'll discuss this below.

Layout

Packets have three fields:

FieldTypeDescription
packet_idu_bit_varthe packet type
packet_sizevarintthe length of data in the packet (in bytes)
packet_databytesthe actual packet data
Make sure your parsing using a [bit-stream.](../types/bit.md)

Note:

While packet_data is a set of bytes, it may not be byte-aligned, which can occur overhead.

Packet IDs

Packet Data consists of protobuf messages with each packet_id corresponding to a given type.

Packet IDs come from multiple protobuf enums. At this time we can guess the following types are packet IDs:

  • SVC_Messages
  • NET_Messages
  • ECstrike15UserMessages
  • EBaseGameEvents
  • EBaseUserMessages
  • ECsgoGameEvents

It may be the case that some of these overlap, while we cannot confirm this fact, we have had success parsing in that order.

Packet Payloads

Each packet IDs matches to its given protobuf message.

Here are some notable ones:

Packet IdPayload TypeDescription
svc_ServerInfoCSVCMsg_ServerInfoServer Info (including build version, map name, class field size)
svc_ClassInfoCSVCMsg_ClassInfoMappings of class ids to their names/serializers
svc_PacketEntitiesCSVCMsg_PacketEntitiesA list of entity updates
svc_FlattenedSerializerCSVCMsg_FlattenedSerializerSerializer specifications

We wouldn't be able to list all the messages here, I would recommend exploring the protobuf files.

Most enum variants match to a respective message, but some have mismatched names.