The Volatility Framework
convert.DWARFParser Class Reference

A parser for DWARF files. More...

Inheritance diagram for convert.DWARFParser:

Public Member Functions

def __init__ (self)
 
def resolve (self, memb)
 Lookup anonymouse member and replace it with a well known one. More...
 
def resolve_refs (self)
 Replace references with types. More...
 
def deep_replace (self, t, search, repl)
 Recursively replace anonymous references. More...
 
def get_deepest (self, t)
 
def base_type_name (self, data)
 Replace references to base types. More...
 
def feed_line (self, line)
 
def process_statement (self, kind, level, data, statement_id)
 Process a single parsed statement. More...
 
def process_variable (self, data)
 
def finalize (self)
 Finalize the output. More...
 
def print_output (self)
 

Public Attributes

 current_level
 
 name_stack
 
 id_to_name
 
 all_vtypes
 
 vtypes
 
 enums
 
 all_vars
 
 vars
 
 all_local_vars
 
 local_vars
 
 anons
 

Static Public Attributes

tuple dwarf_header_regex
 
tuple dwarf_key_val_regex
 
dictionary sz2tp = {8: 'long long', 4: 'long', 2: 'short', 1: 'char'}
 
dictionary tp2vol
 

Detailed Description

A parser for DWARF files.

Member Function Documentation

def convert.DWARFParser.base_type_name (   self,
  data 
)

Replace references to base types.

def convert.DWARFParser.deep_replace (   self,
  t,
  search,
  repl 
)

Recursively replace anonymous references.

def convert.DWARFParser.finalize (   self)

Finalize the output.

def convert.DWARFParser.process_statement (   self,
  kind,
  level,
  data,
  statement_id 
)

Process a single parsed statement.

def convert.DWARFParser.resolve (   self,
  memb 
)

Lookup anonymouse member and replace it with a well known one.

def convert.DWARFParser.resolve_refs (   self)

Replace references with types.

Member Data Documentation

tuple convert.DWARFParser.dwarf_header_regex
static
Initial value:
1 = re.compile(
2  r'<(?P<level>\d+)><(?P<statement_id>[0-9+]+)><(?P<kind>\w+)>')
tuple convert.DWARFParser.dwarf_key_val_regex
static
Initial value:
1 = re.compile(
2  '\s*(?P<keyname>\w+)<(?P<val>[^>]*)>')
dictionary convert.DWARFParser.tp2vol
static
Initial value:
1 = {
2  'sizetype' : 'long long',
3  'bool' : 'int',
4  '_Bool': 'unsigned char',
5  'char': 'char',
6  'float': 'float',
7  'double': 'double',
8  'long double': 'double',
9  'int': 'int',
10  'long int': 'long',
11  'long long int': 'long long',
12  'long long unsigned int': 'unsigned long long',
13  'long unsigned int': 'unsigned long',
14  'short int': 'short',
15  'short unsigned int': 'unsigned short',
16  'unsigned short' : 'unsigned short',
17  'short' : 'short',
18  'signed char': 'signed char',
19  'unsigned char': 'unsigned char',
20  'unsigned int': 'unsigned int',
21  }

The documentation for this class was generated from the following file: