Transformers
Transformers perform static tranforms or encoding on the parent element. Transforms are typically, but not always, two directional: encode and decode. Examples include ZIP compression, Base64 encoding, HTML encoding, etc.
Transfomers differ from Fixups in they operate on the parent element while Fixups reference another element’s data.
Example:
<DataModel name="Base64TLV"> <Number name="Type" size="8" signed="false" value="1" token="true" /> <Number name="Length" size="16" signed="false"> <Relation type="size" of="base64Block" /> </Number> <Block name="base64Block"> <Transformer class="Base64Encode" /> <Blob name="Data" /> </Block> </DataModel>
The output of the above data model is 0x01<len(b64(Data))><b64(Data)>
Default Transformers in Peach 3
Compression
Crypto
Encode
Type
Misc