Synalyze It!  1.10
Public Member Functions | List of all members
StructureMapper Class Reference

The StructureMapper class. More...

Public Member Functions

long mapStructure (Structure structure)
 Map a structure at the current position to a file. More...
 
long mapStructureAtPosition (Structure structure, long position, long size)
 Map a structure at the given position to a file. More...
 
long mapElementWithSize (Element element, int maxSize)
 Map an element at the current position to a file. Maximum size is specified in bytes. More...
 
long mapElementWithSizeBits (Element element, int maxSize)
 Map an element at the current position to a file. Maximum size is specified in bits. More...
 
 setDynamicEndianness (ENDIAN_TYPE endianness)
 Set dynamic endianness. More...
 
ENDIAN_TYPE getDynamicEndianness ()
 Get endianness set currently. More...
 
ByteArray getCurrentByteArray ()
 Current byte array being processed. More...
 
ByteView getCurrentByteView ()
 Current byte view being processed. More...
 
Structure getCurrentGrammar ()
 Current grammar being processed. More...
 
LogSrc getCurrentLogSrc ()
 Current log source used for output. More...
 
Results getCurrentResults ()
 Current results used while mapping structures. More...
 
Structure getCurrentStructure ()
 Current structure being mapped. More...
 
Element getCurrentElement ()
 Current structure element being mapped. This is of course the scripting element... More...
 
long getCurrentOffset ()
 Current file offset of the mapping operation. More...
 
 setCurrentOffset (unsigned long offset)
 Set current file offset of the mapping operation. More...
 
long getCurrentRemainingSize ()
 Current remaining size of the mapping operation. More...
 
 process ()
 Process file and return results. More...
 
 dump (outputFile)
 Process file and write results to file. More...
 

Detailed Description

The StructureMapper class.

A structure mapper object maps the structures of a grammar to a file (ByteView / ByteArray).

Author
Andreas Pehnack
Date
2009-08-16

Member Function Documentation

dump ( outputFile  )

Process file and write results to file.

Author
Andreas Pehnack
Date
2015-10-16
Parameters
[in]outputFileName of output file
ByteArray getCurrentByteArray ( )

Current byte array being processed.

Author
Andreas Pehnack
Date
2012-12-22
Returns
Current byte array
ByteView getCurrentByteView ( )

Current byte view being processed.

Author
Andreas Pehnack
Date
2011-10-17
Returns
Current byte view
Element getCurrentElement ( )

Current structure element being mapped. This is of course the scripting element...

Author
Andreas Pehnack
Date
2011-10-14
Returns
Current structure element
Structure getCurrentGrammar ( )

Current grammar being processed.

Author
Andreas Pehnack
Date
2011-10-17
Returns
Current grammar
LogSrc getCurrentLogSrc ( )

Current log source used for output.

Author
Andreas Pehnack
Date
2011-10-17
Returns
Current log source
long getCurrentOffset ( )

Current file offset of the mapping operation.

Author
Andreas Pehnack
Date
2011-10-14
Returns
Current file offset
long getCurrentRemainingSize ( )

Current remaining size of the mapping operation.

Author
Andreas Pehnack
Date
2011-10-14
Returns
Current remaining size
Results getCurrentResults ( )

Current results used while mapping structures.

Author
Andreas Pehnack
Date
2011-10-17
Returns
Current results
Structure getCurrentStructure ( )

Current structure being mapped.

Author
Andreas Pehnack
Date
2011-10-14
Returns
Current structure
ENDIAN_TYPE getDynamicEndianness ( )

Get endianness set currently.

The returned endianness is used by structure elements having set their endianness to dynamic.

Author
Andreas Pehnack
Date
2011-10-18
Returns
The endianness currently set
long mapElementWithSize ( Element  element,
int  maxSize 
)

Map an element at the current position to a file. Maximum size is specified in bytes.

The maximum length the element may take is also passed.

Author
Andreas Pehnack
Date
2012-02-05
Parameters
[in]elementThe element to be applied
[in]maxSizeThe maximum size the element may have in bytes
Returns
Number of mapped bytes
long mapElementWithSizeBits ( Element  element,
int  maxSize 
)

Map an element at the current position to a file. Maximum size is specified in bits.

The maximum length the element may take is also passed. (in bits)

Author
Andreas Pehnack
Date
2016-08-24
Parameters
[in]elementThe element to be applied
[in]maxSizeBitsThe maximum size the element may have in bits
Returns
Number of mapped bits
long mapStructure ( Structure  structure)

Map a structure at the current position to a file.

The length of the structure is added in the results to the enclosing structure.

Author
Andreas Pehnack
Date
2011-10-12
Parameters
[in]structureThe structure to apply
Returns
Number of mapped bytes
long mapStructureAtPosition ( Structure  structure,
long  position,
long  size 
)

Map a structure at the given position to a file.

The length of the structure is not added in the results to the enclosing structure.

Author
Andreas Pehnack
Date
2011-10-12
Parameters
[in]structureThe structure to apply
[in]positionWhere to apply the structure
[in]sizeMaximum space the structure can consume
Returns
Number of mapped bytes
process ( )

Process file and return results.

Author
Andreas Pehnack
Date
2015-10-17
setCurrentOffset ( unsigned long  offset)

Set current file offset of the mapping operation.

Author
Andreas Pehnack
Date
2012-01-19
Parameters
[in]offsetNew offset to continue processing after script
setDynamicEndianness ( ENDIAN_TYPE  endianness)

Set dynamic endianness.

This endianness will be used by structure elements having set their endianness to dynamic.

Author
Andreas Pehnack
Date
2011-10-18
Parameters
[in]endiannessThe endianness to use from now on

The documentation for this class was generated from the following file: