Skip to content

Array type object

Philippe Proulx edited this page Mar 18, 2016 · 3 revisions

A CTF array or sequence (variable-length array) type.

See also: Type object.

Properties

Property Type Description Required? Default value
class String Set to array Required N/A
element-type Type object or string (alias name) Type of array type's elements Required N/A
length Positive integer (static array) or string (variable-length array) Array type's length Required N/A

If the length property is a string, the array type has a variable length (CTF sequence). In this case, the property's value refers to a previous structure field. The length property's value may be prefixed with one of the following strings to indicate an absolute lookup within a previous (or current) dynamic scope:

  • trace.packet.header.: trace packet header
  • stream.packet.context.: stream packet context
  • stream.event.header.: stream event header
  • stream.event.context.: stream event context
  • event.context.: event context
  • event.payload.: event payload

The pointed field must have an unsigned integer type.

Examples

16 bytes, static array:

class: array
length: 16
element-type:
  class: int
  size: 8

Variable-length array of null-terminated strings:

class: array
length: previous_field
element-type:
  class: string
Clone this wiki locally