Package bakmei :: Module function :: Class function |

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

## Type function

    object --+
             |
         graph --+
                 |
    object --+   |
             |   |
          node --+
                 |
                function

A function.

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 function instance.
| ``add_cluster`(self, cluster)` Add a pgraph cluster to the graph.
| ``del_cluster`(self, id)` Remove a cluster from the graph.
bakmei.basic_block | ``find_basic_block`(self, ea)` Locate and return the basic block that contains the specified address.
Mixed | ``find_cluster`(self, attribute, value)` Find and return the cluster with the specified attribute / value pair.
Mixed | ``find_cluster_by_node`(self, attribute, value)` Find and return the cluster that contains the node with the specified attribute / value pair.
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.
Inherited from graph
| ``add_edge`(self, edge, prevent_dups)` Add a pgraph edge to the graph.
| ``add_graph`(self, other_graph)` Alias of graph_cat().
| ``add_node`(self, node)` Add a pgraph node to the graph.
| ``del_edge`(self, id, src, dst)` Remove an edge from the graph.
| ``del_graph`(self, other_graph)` Alias of graph_sub().
| ``del_node`(self, node_id)` Remove a node from the graph.
List | ``edges_from`(self, id)` Enumerate the edges from the specified node.
List | ``edges_to`(self, id)` Enumerate the edges to the specified node.
Mixed | ``find_edge`(self, attribute, value)` Find and return the edge with the specified attribute / value pair.
Mixed | ``find_node`(self, attribute, value)` Find and return the node with the specified attribute / value pair.
| ``graph_cat`(self, other_graph)` Concatenate the other graph into the current one.
pgraph.graph | ``graph_down`(self, from_node_id, max_depth)` Create a new graph, looking down, from the specified node id to the specified depth.
| ``graph_intersect`(self, other_graph)` Remove all elements from the current graph that do not exist in the other graph.
pgraph.graph | ``graph_proximity`(self, center_node_id, max_depth_up, max_depth_down)` Create a proximity graph centered around the specified node.
| ``graph_sub`(self, other_graph)` Remove the elements shared between the current graph and other graph from the current graph.
pgraph.graph | ``graph_up`(self, from_node_id, max_depth)` Create a new graph, looking up, from the specified node id to the specified depth.
String | ``render_graph_gml`(self)` Render the GML graph description.
pydot.Dot | ``render_graph_graphviz`(self)` Render the graphviz graph structure.
String | ``render_graph_udraw`(self)` Render the uDraw graph description.
String | ``render_graph_udraw_update`(self)` Render the uDraw graph update description.
List | ``sorted_nodes`(self)` Return a list of the nodes within the graph, sorted by id.
| ``update_node_id`(self, current_id, new_id)` Simply updating the id attribute of a node will sever the edges to / from the given node.
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
| `arg_size`: The size of the arguments.
| `args`: The arguments to the function.
| `ea_end`: The ending address of the function.
| `ea_start`: The starting address of the function.
| `flags`: The function flags.
| `frame_size`: The size of the function frame.
| `instructions_to`: The instructions that reference this function.
| `is_export`: Indicates if the function is exported.
| `is_import`: Indicates if the function is imported.
| `local_var_size`: The size of the local variables.
| `local_vars`: The local variables of the function.
| `name`: The name of the function.
| `num_args`: The number of arguments.
| `num_instructions`: Number of instructions in the function.
| `num_local_vars`: The number of local variables.
| `outbound_eas`: outbound_eas
| `ret_size`: The size of the stack correction.
| `saved_reg_size`: The size of the saved registers.
Inherited from graph
| `id`: The function id (internal use only).
| `nodes`: The basic blocks in the function.

Class Variable Summary
`list` | `chunks` = `[]`
Integer | `dbid`: Database Identifier
String | `DSN`: Database location
`dict` | `ext` = `{}`
`NoneType` | `module` = None
Inherited from graph
`NoneType` | `clusters` = None
`NoneType` | `edges` = None
`NoneType` | `id` = None
`NoneType` | `nodes` = 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
`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 function instance.

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

### add_cluster(self, cluster)

Add a pgraph cluster to the graph.

  Parameters:
    `cluster` - Cluster to add to graph
    (type=pGRAPH Cluster)
  Overrides:
    `pgraph.graph.graph.add_cluster` (inherited documentation)

### del_cluster(self, id)

Remove a cluster from the graph.

  Parameters:
    `id` - Identifier of cluster to remove from graph
    (type=Mixed)
  Overrides:
    `pgraph.graph.graph.del_cluster` (inherited documentation)

### find_basic_block(self, ea)

Locate and return the basic block that contains the specified address.

  Parameters:
    `ea` - An address within the basic block to find
    (type=DWORD)
  Returns:
    The basic block that contains the given address or None if not found.
    (type=bakmei.basic_block)

### find_cluster(self, attribute, value)

Find and return the cluster with the specified attribute / value pair.

  Parameters:
    `attribute` - Attribute name we are looking for
    (type=String)
    `value` - Value of attribute we are looking for
    (type=Mixed)
  Returns:
    Cluster, if attribute / value pair is matched. None otherwise.
    (type=Mixed)
  Overrides:
    `pgraph.graph.graph.find_cluster` (inherited documentation)

### find_cluster_by_node(self, attribute, value)

Find and return the cluster that contains the node with the specified attribute / value pair.

  Parameters:
    `attribute` - Attribute name we are looking for
    (type=String)
    `value` - Value of attribute we are looking for
    (type=Mixed)
  Returns:
    Cluster, if node with attribute / value pair is matched. None otherwise.
    (type=Mixed)
  Overrides:
    `pgraph.graph.graph.find_cluster_by_node` (inherited documentation)

### 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.

  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_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`

Property Details

### arg_size

The size of the arguments.

### args

The arguments to the function.

### ea_end

The ending address of the function.

### ea_start

The starting address of the function.

### flags

The function flags.

### frame_size

The size of the function frame.

### id

The function id (internal use only).

### instructions_to

The instructions that reference this function.

### is_export

Indicates if the function is exported.

### is_import

Indicates if the function is imported.

### local_var_size

The size of the local variables.

### local_vars

The local variables of the function.

### name

The name of the function.

### nodes

The basic blocks in the function.

### num_args

The number of arguments.

### num_instructions

Number of instructions in the function.

### num_local_vars

The number of local variables.

### outbound_eas

outbound_eas

### ret_size

The size of the stack correction.

### saved_reg_size

The size of the saved registers.

Class Variable Details

### chunks

  Type:
    `list`
  Value:

        []

### dbid

Database Identifier

  Type:
    Integer
  Value:

        None

### DSN

Database location

  Type:
    String
  Value:

        None

### ext

  Type:
    `dict`
  Value:

        {}

### module

  Type:
    `NoneType`
  Value:

        None

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