7
7
"""
8
8
defines few simple classes( parsers ), which deals with .dll, .map, .so files.
9
9
10
- Those classes extract decorated\mangled names from the files. Later, they undecorate
11
- the name and extract the functions calling convention.
10
+ Those classes extract decorated\mangled names from the files. Later the extracted
11
+ symbols are used for:
12
+ * building "dynamic library" public interface
13
+ * extracting function calling convention
12
14
"""
13
15
14
16
import os
@@ -80,13 +82,13 @@ def merge( self, symbol):
80
82
raise NotImplementedError ()
81
83
82
84
def parse ( self ):
83
- """main class method
85
+ """the main method of the class
84
86
85
87
loads information from the binary file and merges it into the declarations
86
88
tree.
87
89
88
- The return value of the function is dictionary, where key is decorated
89
- declaration name and value is a declaration.
90
+ The return value of the function is dictionary, where the key is
91
+ decorated/mangled declaration name and the value is a declaration.
90
92
"""
91
93
self .__loaded_symbols = self .load_symbols ()
92
94
result = {}
@@ -103,7 +105,7 @@ def parse( self ):
103
105
CCTS = declarations .CALLING_CONVENTION_TYPES
104
106
105
107
class formated_mapping_parser_t ( libparser_t ):
106
- """base parser class for few MSVC binary files """
108
+ """convenience class, which formats existing declarations """
107
109
def __init__ ( self , global_ns , binary_file , hint ):
108
110
libparser_t .__init__ ( self , global_ns , binary_file )
109
111
self .__formated_decls = {}
@@ -209,6 +211,7 @@ def merge( self, smbl ):
209
211
210
212
211
213
class so_file_parser_t ( formated_mapping_parser_t ):
214
+ """parser for Linux .so file"""
212
215
nm_executable = 'nm'
213
216
#numeric-sort used for mapping between mangled and unmangled name
214
217
cmd_mangled = '%(nm)s --extern-only --dynamic --defined-only --numeric-sort %(lib)s'
0 commit comments