Package pida :: Module function :: Class function
[show private | hide private]
[frames | no frames]

Type function

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


Method Summary
  __init__(self, ea_start, depth, analysis, module)
Analyze all the function chunks associated with the function starting at ea_start.
  __init_args_and_local_vars__(self)
Calculate the total size of arguments, # of arguments and # of local variables.
  __init_basic_blocks__(self)
Enumerate the basic block boundaries for the current function and store them in a graph structure.
  __init_collect_function_chunks__(self)
Generate and return the list of function chunks (including the main one) for the current function.
List branches_from(self, ea)
Enumerate and return the list of branches from the supplied address, *including* the next logical instruction.
List branches_to(self, ea)
Enumerate and return the list of branches to the supplied address, *excluding* the previous logical instruction.
pida.basic_block find_basic_block(self, ea)
Locate and return the basic block that contains the specified address.
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_cluster(self, cluster)
Add a pgraph cluster to the 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_cluster(self, id)
Remove a cluster from 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, 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_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.
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, to_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)

Class Variable Summary
NoneType analysis = None                                                                  
int arg_size = 0                                                                     
dict args = {}
list chunks = []
NoneType depth = None                                                                  
NoneType ea_end = None                                                                  
NoneType ea_start = None                                                                  
dict ext = {}
NoneType flags = None                                                                  
int frame_size = 0                                                                     
NoneType id = None                                                                  
bool is_import = False
int local_var_size = 0                                                                     
dict local_vars = {}
NoneType module = None                                                                  
NoneType name = None                                                                  
int num_args = 0                                                                     
int num_instructions = 0                                                                     
int num_local_vars = 0                                                                     
int ret_size = 0                                                                     
NoneType rpc_opcode = None                                                                  
NoneType rpc_uuid = None                                                                  
int saved_reg_size = 0                                                                     
    Inherited from graph
list clusters = []
dict edges = {}
dict nodes = {}
    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'

Method Details

__init__(self, ea_start, depth=7, analysis=0, module=None)
(Constructor)

Analyze all the function chunks associated with the function starting at ea_start. self.fill(ea_start).
Parameters:
ea_start - Effective address of start of function (inclusive)
           (type=DWORD)
depth - (Optional, Def=DEPTH_FULL) How deep to analyze the module
           (type=Integer)
analysis - (Optional, Def=ANALYSIS_NONE) Which extra analysis options to enable
           (type=Integer)
module - (Optional, Def=None) Pointer to parent module container
           (type=pida.module)
Overrides:
pgraph.graph.graph.__init__

See Also: defines.py

__init_args_and_local_vars__(self)

Calculate the total size of arguments, # of arguments and # of local variables. Update the internal class member variables appropriately.

__init_basic_blocks__(self)

Enumerate the basic block boundaries for the current function and store them in a graph structure.

__init_collect_function_chunks__(self)

Generate and return the list of function chunks (including the main one) for the current function. Ripped from idb2reml (Ero Carerra).

@rtype List
Returns:
List of function chunks (start, end tuples) for the current function.

branches_from(self, ea)

Enumerate and return the list of branches from the supplied address, *including* the next logical instruction. Part of the reason why we even need this function is that the "flow" argument to CodeRefsFrom does not appear to be functional.
Parameters:
ea - Effective address of instruction to enumerate jumps from.
           (type=DWORD)
Returns:
List of branches from the specified address.
           (type=List)

branches_to(self, ea)

Enumerate and return the list of branches to the supplied address, *excluding* the previous logical instruction. Part of the reason why we even need this function is that the "flow" argument to CodeRefsTo does not appear to be functional.
Parameters:
ea - Effective address of instruction to enumerate jumps to.
           (type=DWORD)
Returns:
List of branches to the specified address.
           (type=List)

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=pida.basic_block)

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

Class Variable Details

analysis

Type:
NoneType
Value:
None                                                                  

arg_size

Type:
int
Value:
0                                                                     

args

Type:
dict
Value:
{}                                                                     

chunks

Type:
list
Value:
[]                                                                     

depth

Type:
NoneType
Value:
None                                                                  

ea_end

Type:
NoneType
Value:
None                                                                  

ea_start

Type:
NoneType
Value:
None                                                                  

ext

Type:
dict
Value:
{}                                                                     

flags

Type:
NoneType
Value:
None                                                                  

frame_size

Type:
int
Value:
0                                                                     

id

Type:
NoneType
Value:
None                                                                  

is_import

Type:
bool
Value:
False                                                                  

local_var_size

Type:
int
Value:
0                                                                     

local_vars

Type:
dict
Value:
{}                                                                     

module

Type:
NoneType
Value:
None                                                                  

name

Type:
NoneType
Value:
None                                                                  

num_args

Type:
int
Value:
0                                                                     

num_instructions

Type:
int
Value:
0                                                                     

num_local_vars

Type:
int
Value:
0                                                                     

ret_size

Type:
int
Value:
0                                                                     

rpc_opcode

Type:
NoneType
Value:
None                                                                  

rpc_uuid

Type:
NoneType
Value:
None                                                                  

saved_reg_size

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Fri Jun 16 17:16:25 2006 http://epydoc.sf.net