22
22
# Utility functions
23
23
#
24
24
def info (formatted_string ):
25
- print formatted_string
25
+ print ( formatted_string )
26
26
27
27
def error (formatted_string ):
28
- print 'ERROR - %s' % formatted_string
28
+ print ( f 'ERROR - { formatted_string } ' )
29
29
30
30
def debug (formatted_string ):
31
31
if DEBUG :
32
- print 'DEBUG - %s' % formatted_string
33
-
32
+ print (f'DEBUG - { formatted_string } ' )
34
33
#
35
34
# String defining fuctionality
36
35
#
@@ -344,17 +343,20 @@ def create_pointer(addr, force_size=None):
344
343
345
344
STRIP_CHARS = [ '(' , ')' , '[' , ']' , '{' , '}' , ' ' , '"' ]
346
345
REPLACE_CHARS = ['.' , '*' , '-' , ',' , ';' , ':' , '/' , '\xb7 ' ]
347
- def clean_function_name (str ):
346
+ def clean_function_name (in_str ):
348
347
# Kill generic 'bad' characters
349
- str = filter (lambda x : x in string .printable , str )
348
+ s = ""
349
+ for c in in_str .decode ():
350
+ if c in string .printable :
351
+ s += c
350
352
351
353
for c in STRIP_CHARS :
352
- str = str .replace (c , '' )
354
+ s = s .replace (c , '' )
353
355
354
356
for c in REPLACE_CHARS :
355
- str = str .replace (c , '_' )
357
+ s = s .replace (c , '_' )
356
358
357
- return str
359
+ return s
358
360
359
361
def renamer_init ():
360
362
renamed = 0
@@ -363,7 +365,7 @@ def renamer_init():
363
365
if gopclntab is not None :
364
366
info ('type : %s' % type (gopclntab ))
365
367
start_ea = 0
366
- if isinstance (gopclntab , long ):
368
+ if isinstance (gopclntab , int ):
367
369
start_ea = gopclntab
368
370
else :
369
371
start_ea = gopclntab .start_ea
0 commit comments