better-rtti-parser
better-rtti-parser copied to clipboard
sometimes typename is none
Hello,
I have a weird issue in your script that sometimes it didn't found the typename and the script crash. As I don't have many time right now to debug I made a simple patch. Do you have a idea why it happend ?
diff '--color=auto' -ru ida-better-rtti-parser_mod/core/common.py ida-better-rtti-parser/core/common.py
--- ida-better-rtti-parser_mod/core/common.py 2022-09-22 11:29:18.943743648 +0200
+++ ida-better-rtti-parser/core/common.py 2022-09-22 11:29:57.103631866 +0200
@@ -144,10 +144,7 @@
Ex:
Base::SomeClass::ClassTemplate<int,double,char> --> ClassTemplate
"""
- if name:
- return re.sub('(<.*>|.*::)', '', name)
- else:
- return None
+ return re.sub('(<.*>|.*::)', '', name)
def get_function_signature(func_ea) -> FunctionSignature:
@@ -181,9 +178,8 @@
sig = get_function_signature(func_ea)
for typename in typenames:
- if typename:
- ret += str(len(typename))
- ret += typename
+ ret += str(len(typename))
+ ret += typename
ret += 'E'
Hi. Don't really sure about exact cause of this issue. Probably bad parsing of rtti or typename isn't included in every rtti table.
Haven't used the plugin for a long time, so I can't say if I'm going to fix it in near future.
Nevertheless, thanks for reporting an issue!