What is Peach
Installing
Tutorials
Methodology
Introduction
Training
Enterprise
FAQ
Support Forums
Peach 3
Peach Pits
 General Conf
 Data Modeling
 State Modeling
 Agents
  Monitors
 Test
  Publishers
  Loggers
Running
Minset
Peach 2.3

License

Number

The Number element defines a binary number of lengths 8, 16, 24, 32, or 64 bits. The Number element is a child element of DataModel, Block, or Choice.

Attributes:

  • name — [Required] Name of the number.

  • size — [Required] Size of number in bits. Valid options are 1 through 64.

  • value — The default value to assign to the number.

  • valueType — The representation of the value. Valid options are string and hex. [Optional]

  • token — This element is treated as a token when parsing, defaults to False Valid options true and false.

  • endian — Byte order of the number, defaults to little. Valid options are big, little, and network. Network is the same as big.

  • signed —  The number is signed or unsigned, defaults to true. Valid options are true and false.

  • constraint — A constraint in the form of a python expression. Used during data cracking.

  • mutable — Is data element changeable (should it be mutated during fuzzing), defaults to true. Valid options true and false.

  • minOccurs — The minimum number of times this number must occur. Defaults to 1. Valid options are a positive integer value.

  • maxOccurs — The maximum number of times this number can occur. No default. Valid options are a positive integer value.

Valid Child-Elements:

Examples:

A simple number example this will produce a 32 bit (4 byte) number with a default value of 5.

<DataModel name="NumberExample1">
 <Number name="Hi5" value="5" size="32"/>
</DataModel>

To only use 16 bits (two byte) change the size to 16.

<DataModel name="NumberExample2">
 <Number name="Hi5" value="5" size="16"/>
</DataModel>

Signed

To indicate this is an unsigned data element set the signed attribute equal to "false". The default is true.

<DataModel name="NumberExample3">
 <Number name="Hi5" value="5" size="32" signed="false"/>
</DataModel>

Value Type:

The valueType defines how to interprete the value attribute. Valid options are string and hex. The default is string.

To assign a value of 1000 to Hi5.

<DataModel name="NumberExample4">
 <Number name="Hi5" value="1000" valueType="string" size="16" signed="false" />
</DataModel>

To assign a value of 43981 in hex.

<DataModel name="NumberExample5">
 <Number name="Hi5" value="AB CD" valueType="hex" size="16" signed="false" />
</DataModel>

Endian

To change the endianness of the number set the endian attribute. Endianness defines in which order the bytes are the least or most significant.

<DataModel name="NumberExample6">
 <Number name="Hi5" value="AB CD" valueType="hex" size="16" signed="false" endian="big" />
</DataModel>

Will produce the bytes in the following order.

 AB CD
<DataModel name="NumberExample7">
 <Number name="Hi5" value="AB CD" valueType="hex" size="16" signed="false" endian="little" />
</DataModel>

Will produce the bytes in the following order.

 CD AB