Module pywraps :: Class data_format_t
[frames] | no frames]

Class data_format_t

object --+
         |
        data_format_t

Information about a data format

Instance Methods
 
__init__(self, name, value_size=0, menu_name=None, props=0, hotkey=None, text_width=0)
Custom data format definition.
 
register(self, dtid)
Registers the data format with the given data type id and returns the type id or < 0 on failure
 
unregister(self, dtid)
Unregisters the data format with the given data type id
 
printf(self, value, current_ea, operand_num, dtid)
Convert a value buffer to colored string.
 
scan(self, input, current_ea, operand_num)
Convert from uncolored string 'input' to byte value
 
analyze(self, current_ea, operand_num)
(optional) Analyze custom data format occurrence.

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables
  id
contains the format id after the format gets registered
Properties

Inherited from object: __class__

Method Details

__init__(self, name, value_size=0, menu_name=None, props=0, hotkey=None, text_width=0)
(Constructor)

 

Custom data format definition.

Parameters:
  • name - Format name, must be unique
  • menu_name - Visible format name to use in menus
  • props - properties (currently 0)
  • hotkey - Hotkey for the corresponding menu item
  • value_size - size of the value in bytes. 0 means any size is ok
Overrides: object.__init__

printf(self, value, current_ea, operand_num, dtid)

 

Convert a value buffer to colored string.

Parameters:
  • value - The value to be printed
  • current_ea - The ea of the value
  • operand_num - The affected operand
  • dtid - custom data type id (0-standard built-in data type)
Returns:
a colored string representing the passed 'value' or None on failure

scan(self, input, current_ea, operand_num)

 

Convert from uncolored string 'input' to byte value

Parameters:
  • input - input string
  • current_ea - current address (BADADDR if unknown)
  • operand_num - current operand number (-1 if unknown)
Returns:
tuple (Boolean, string)
  • (False, ErrorMessage) if conversion fails
  • (True, Value buffer) if conversion succeeds

analyze(self, current_ea, operand_num)

 

(optional) Analyze custom data format occurrence. It can be used to create xrefs from the current item.

Parameters:
  • current_ea - current address (BADADDR if unknown)
  • operand_num - current operand number
Returns:
None