ValueType Attribute
The valueType attribute specifies what type of data is contained in the value attribute.
Valid values: string, hex, and literal.
string (default)
The value provided is a string value. String value will be converted into the appropriate data element type. The Number element expects numerical values while String and Blob will take any values.
Examples:
A numerical representation of value 65.
<Number valueType="string" value="65" />
Output
A
A string representation of value 65.
<Number valueType="string" value="65" />
Output
65
hex
The value specified as a stream of hex bytes.
Peach is fairly good about figuring out different types of hex strings, e.g. "0x00 0x00" or "\x00 \x00" or "00 00 00 00 00" etc.
Examples:
A numerical representation of value 0x41.
<String valueType="hex" value="41" />
Output
A
A numerical representation of value 0x41.
<Number valueType="hex" value="41" />
Output
A
|
Note
|
The hex values must be EVEN numbered! For example this is WRONG: "0x000" and this is CORRECT: "0x0000" |
literal
Specify a python or ruby statement that evaluates to the wanted value. The evaluation occurs only once when the Pit is parsed into an internal dom tree. Literal should NOT be used in place of a relation or a fixup. Literals are only to be used for quick one-time expressions.
Examples:
<String valueType="literal" value="(1 + 2 + 3)**2" />
Output
36
<String valueType="literal" value="'hello world!'.upper()" />
Output
HELLO WORLD!


