Module ps_parsers :: Class xrefs_parser
[show private | hide private]
[frames | no frames]

Class xrefs_parser


Cross-reference lists contain function offset addresses, source node offset addresses and destination node offset addresses. The cross-reference list contains the enumeration of all intra-modular calls and is used to create connected graphs and recursive graph views. Cross-reference list file format:
   function offset address:source node offset address:destination node offset address
   000000e0:0000011e:00015edc

Method Summary
  __init__(self, base_address)
Initialize internal member variables.
  __module_test__(self)
Run a few basic tests to ensure the class is working.
  add_xref_entry(self, function, source, destination, dupe_check)
Add a cross-reference entry to the internal lists.
  del_xref_entry(self, index)
Delete the cross-reference entry at the specified index.
Tuple get_xref_entry(self, index)
Get the cross-reference entry at the specified index.
List get_xrefs_from(self, function)
Return a list of all intra-modular cross-references from the specified function.
Integer num_entries(self)
Get the entry count for this cross-reference list.
  parse(self, filename)
Open the specified Cross-reference list filename and process the data into the internal lists.
  save(self, filename)
Save a cross-reference list to the specified file.

Method Details

__init__(self, base_address=0)
(Constructor)

Initialize internal member variables.
Parameters:
base_address - Optional address to re-base parsed xref offsets to.
           (type=DWORD)

__module_test__(self)

Run a few basic tests to ensure the class is working.

add_xref_entry(self, function, source, destination, dupe_check=False)

Add a cross-reference entry to the internal lists.
Parameters:
function - Source function offset address
           (type=DWORD)
source - Source node offset address
           (type=DWORD)
destination - Destination node offset address
           (type=DWORD)
dupe_check - Optional flag specifying whether or not to check for duplicates before adding entry (slow).
           (type=Boolean)
Raises:
psx - An exception is raised if the entry to add already exists.

del_xref_entry(self, index)

Delete the cross-reference entry at the specified index.
Parameters:
index - Cross-reference index
           (type=Integer)
Raises:
psx - An exception is raised if the requested index is out of range.

get_xref_entry(self, index)

Get the cross-reference entry at the specified index.
Parameters:
index - Cross-reference index
           (type=Integer)
Returns:
Function offset address, source node offset address, destination node offset address
           (type=Tuple)
Raises:
psx - An exception is raised if the requested index is out of range.

get_xrefs_from(self, function)

Return a list of all intra-modular cross-references from the specified function.
Returns:
List of functions cross-referenced from the specified origin.
           (type=List)

num_entries(self)

Get the entry count for this cross-reference list.
Returns:
Cross-reference count
           (type=Integer)

parse(self, filename)

Open the specified Cross-reference list filename and process the data into the internal lists. File format:
   function offset address:source node offset address:destination node offset address
   000000e0:0000011e:00015edc
Parameters:
filename - Filename
           (type=String)
Raises:
psx - An exception is raised if requested cross-reference file can not be opened.

save(self, filename)

Save a cross-reference list to the specified file. The contents of the cross-reference are generated from our internal variables in sorted order. File format:
   function offset address:source node offset address:destination node offset address
   000000e0:0000011e:00015edc
Parameters:
filename - Filename
           (type=String)
Raises:
psx - An exception is raised if the specified file can not be opened for writing.

Generated by Epydoc 2.1 on Tue Jul 05 12:05:31 2005 http://epydoc.sf.net