Package bakmei :: Module basic_block :: Class basic_block |

[show private | hide private]
[frames | no frames]

## Type basic_block

    object --+
             |
          node --+
                 |
                basic_block

A basic block instruction container.

Author: Cameron Hotchkies, Pedram Amini

Contact: chotchkies@tippingpoint.com

Organization: www.openrce.org

License: GNU General Public License 2.0 or later

Method Summary
| ``__init__`(self, DSN, database_id)` Initializes a basic block instance.
Boolean | ``overwrites_register`(self, register)` Indicates if the given register is modified by this block.
String | ``render_node_gml`(self, graph)` Overload the default node.render_node_gml() routine to create a custom label.
pydot.Node() | ``render_node_graphviz`(self, graph)` Overload the default node.render_node_graphviz() routine to create a custom label.
String | ``render_node_udraw`(self, graph)` Overload the default node.render_node_udraw() routine to create a custom label.
String | ``render_node_udraw_update`(self)` Overload the default node.render_node_udraw_update() routine to create a custom label.
| ``__deleteEaEnd`(self)` destructs the ending address of the basic block
| ``__deleteEaStart`(self)` destructs the starting address of the basic block
| ``__deleteInstructions`(self)` destructs the instructions in the basic block
| ``__deleteNodes`(self)` destructs the instructions in the basic block
| ``__deleteNumInstructions`(self)` destructs the number of instructions in the basic block
| ``__deleteSortedInstructions`(self)` destructs the instructions in the basic block
DWORD | ``__getEaEnd`(self)` Gets the ending address of the basic block.
DWORD | ``__getEaStart`(self)` Gets the starting address of the basic block.
[bakmei.instruction] | ``__getInstructions`(self)` Gets the instructions in the basic block.
[bakmei.instruction] | ``__getNodes`(self)` Gets the instructions in the basic block.
Integer | ``__getNumInstructions`(self)` Gets the number of instructions in the basic block.
List | ``__getSortedInstructions`(self)` Return a list of the instructions within the basic block, sorted by address.
| `__load_from_sql(self)`
| ``__setEaEnd`(self, value)` Sets the ending address of the basic block.
| ``__setEaStart`(self, value)` Sets the starting address of the basic block.
| ``__setInstructions`(self, value)` Sets the instructions in the basic block.
| ``__setNodes`(self, value)` Sets the instructions in the basic block.
| ``__setNumInstructions`(self, value)` Sets the number of instructions in the basic block.
| ``__setSortedInstructions`(self, value)` Sets the instructions in the basic block.
Inherited from object
| ``__delattr__`(...)` x.__delattr__('name') <==> del x.name
| ``__getattribute__`(...)` x.__getattribute__('name') <==> x.name
| ``__hash__`(x)` x.__hash__() <==> hash(x)
| ``__new__`(T, S, ...)` T.__new__(S, ...) -> a new object with type S, a subtype of T
| ``__reduce__`(...)` helper for pickle
| ``__reduce_ex__`(...)` helper for pickle
| ``__repr__`(x)` x.__repr__() <==> repr(x)
| ``__setattr__`(...)` x.__setattr__('name', value) <==> x.name = value
| ``__str__`(x)` x.__str__() <==> str(x)

Property Summary
| `ea_end`: The ending address of the basic block.
| `ea_start`: The starting address of the basic block.
| `instructions`: The instructions in the basic block keyed by address.
| `nodes`: The instructions in the basic block keyed by address.
| `num_instructions`: The number of instructions in the basic block.
| `sorted_instructions`: A list of instructions within the basic block sorted by address
Inherited from node
| `id`: The basic block id (internal use only)

Class Variable Summary
Integer | `dbid`: Database Identifier
String | `DSN`: Database location
`dict` | `ext` = `{}`
`NoneType` | `function` = None
`NoneType` | `module` = None
`bool` | `_basic_block__cached` = `False`
`NoneType` | `_basic_block__ea_end` = None
`NoneType` | `_basic_block__ea_start` = None
Inherited from node
`int` | `border_color` = 15658734
`int` | `color` = 15661055
`float` | `gml_height` = 0.0
`float` | `gml_line_width` = 1.0
`str` | `gml_pattern` = `'1'`
`int` | `gml_stipple` = 1
`str` | `gml_type` = `'rectangle'`
`float` | `gml_width` = 0.0
`float` | `gml_width_shape` = 1.0
`int` | `id` = 0
`str` | `label` = `''`
`int` | `number` = 0
`str` | `shape` = `'box'`
`NoneType` | `udraw_image` = None
`str` | `udraw_info` = `''`

Method Details

### __init__(self, DSN, database_id)
(Constructor)

Initializes a basic block instance.

  Parameters:
    `DSN` - The data source for the basic block to draw from.
    (type=String)
    `database_id` - The record ID of the basic block.
    (type=Integer)
  Overrides:
    `pgraph.node.node.__init__`

### overwrites_register(self, register)

Indicates if the given register is modified by this block.

  Parameters:
    `register` - The text representation of the register
    (type=String)
  Returns:
    True if the register is modified by any instruction in this block.
    (type=Boolean)

### render_node_gml(self, graph)

Overload the default node.render_node_gml() routine to create a custom label. Pass control to the default node renderer and then return the merged content.

  Returns:
    Contents of rendered node.
    (type=String)
  Overrides:
    `pgraph.node.node.render_node_gml`

### render_node_graphviz(self, graph)

Overload the default node.render_node_graphviz() routine to create a custom label. Pass control to the default node renderer and then return the merged content.

  Parameters:
    `graph` - Top level graph object containing the current node
    (type=pgraph.graph)
  Returns:
    Pydot object representing node
    (type=pydot.Node())
  Overrides:
    `pgraph.node.node.render_node_graphviz`

### render_node_udraw(self, graph)

Overload the default node.render_node_udraw() routine to create a custom label. Pass control to the default node renderer and then return the merged content.

  Parameters:
    `graph` - Top level graph object containing the current node
    (type=pgraph.graph)
  Returns:
    Contents of rendered node.
    (type=String)
  Overrides:
    `pgraph.node.node.render_node_udraw`

### render_node_udraw_update(self)

Overload the default node.render_node_udraw_update() routine to create a custom label. Pass control to the default node renderer and then return the merged content.

  Returns:
    Contents of rendered node.
    (type=String)
  Overrides:
    `pgraph.node.node.render_node_udraw_update`

### __deleteEaEnd(self)

destructs the ending address of the basic block

### __deleteEaStart(self)

destructs the starting address of the basic block

### __deleteInstructions(self)

destructs the instructions in the basic block

### __deleteNodes(self)

destructs the instructions in the basic block

### __deleteNumInstructions(self)

destructs the number of instructions in the basic block

### __deleteSortedInstructions(self)

destructs the instructions in the basic block

### __getEaEnd(self)

Gets the ending address of the basic block.

  Returns:
    The ending address of the basic block.
    (type=DWORD)

### __getEaStart(self)

Gets the starting address of the basic block.

  Returns:
    The starting address of the basic block.
    (type=DWORD)

### __getInstructions(self)

Gets the instructions in the basic block.

  Returns:
    The instructions in the basic block.
    (type=[bakmei.instruction])

### __getNodes(self)

Gets the instructions in the basic block.

  Returns:
    The instructions in the basic block.
    (type=[bakmei.instruction])

### __getNumInstructions(self)

Gets the number of instructions in the basic block.

  Returns:
    The number of instructions in the basic block.
    (type=Integer)

### __getSortedInstructions(self)

Return a list of the instructions within the basic block, sorted by address.

  Returns:
    List of instructions, sorted by id.
    (type=List)

### __setEaEnd(self, value)

Sets the ending address of the basic block.

  Parameters:
    `value` - The ending address of the basic block.
    (type=DWORD)

### __setEaStart(self, value)

Sets the starting address of the basic block.

  Parameters:
    `value` - The starting address of the basic block.
    (type=DWORD)

### __setInstructions(self, value)

Sets the instructions in the basic block. (This will raise an exception as this is read-only)

  Parameters:
    `value` - The number of instructions in the basic block.
    (type=[bakmei.instruction])

### __setNodes(self, value)

Sets the instructions in the basic block. (This will raise an exception as this is read-only)

  Parameters:
    `value` - The number of instructions in the basic block.
    (type=[bakmei.instruction])

### __setNumInstructions(self, value)

Sets the number of instructions in the basic block. (This will raise an exception as this is read-only)

  Parameters:
    `value` - The number of instructions in the basic block.
    (type=Integer)

### __setSortedInstructions(self, value)

Sets the instructions in the basic block. (This will raise an exception as this is read-only)

  Parameters:
    `value` - The number of instructions in the basic block.
    (type=[bakmei.instruction])

Property Details

### ea_end

The ending address of the basic block.

  Get Method:
    `__getEaEnd`(self)
  Set Method:
    `__setEaEnd`(self, value)
  Delete Method:
    `__deleteEaEnd`(self)

### ea_start

The starting address of the basic block.

  Get Method:
    `__getEaStart`(self)
  Set Method:
    `__setEaStart`(self, value)
  Delete Method:
    `__deleteEaStart`(self)

### id

The basic block id (internal use only)

  Get Method:
    `__getEaStart`(self)
  Set Method:
    `__setEaStart`(self, value)
  Delete Method:
    `__deleteEaStart`(self)

### instructions

The instructions in the basic block keyed by address.

  Get Method:
    `__getInstructions`(self)
  Set Method:
    `__setInstructions`(self, value)
  Delete Method:
    `__deleteInstructions`(self)

### nodes

The instructions in the basic block keyed by address.

  Get Method:
    `__getNodes`(self)
  Set Method:
    `__setNodes`(self, value)
  Delete Method:
    `__deleteNodes`(self)

### num_instructions

The number of instructions in the basic block.

  Get Method:
    `__getNumInstructions`(self)
  Set Method:
    `__setNumInstructions`(self, value)
  Delete Method:
    `__deleteNumInstructions`(self)

### sorted_instructions

A list of instructions within the basic block sorted by address

  Get Method:
    `__getSortedInstructions`(self)
  Set Method:
    `__setSortedInstructions`(self, value)
  Delete Method:
    `__deleteSortedInstructions`(self)

Class Variable Details

### dbid

Database Identifier

  Type:
    Integer
  Value:

        None

### DSN

Database location

  Type:
    String
  Value:

        None

### ext

  Type:
    `dict`
  Value:

        {}

### function

  Type:
    `NoneType`
  Value:

        None

### module

  Type:
    `NoneType`
  Value:

        None

### _basic_block__cached

  Type:
    `bool`
  Value:

        False

### _basic_block__ea_end

  Type:
    `NoneType`
  Value:

        None

### _basic_block__ea_start

  Type:
    `NoneType`
  Value:

        None

Generated by Epydoc 2.1 on Wed Mar 14 16:32:07 2007 | http://epydoc.sf.net