ida_medigate
ida_medigate copied to clipboard
TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
In C:\Program Files\IDA Pro 7.6\plugins\ida_medigate I copied all files from the master
then I write "C:/Program Files/IDA Pro 7.6/plugins/ida_medigate" in file
%APPDATA%\Hex-Rays\IDA Pro\idapythonrc.py
Then I tried to run : from ida_medigate.rtti_parser import GccRTTIParser
But I got error :
Python>from ida_medigate.rtti_parser import GccRTTIParser
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Program Files/IDA Pro 7.6/plugins\ida_medigate\rtti_parser.py", line 149, in <module>
class GccRTTIParser(RTTIParser):
File "C:\Program Files/IDA Pro 7.6/plugins\ida_medigate\rtti_parser.py", line 153, in GccRTTIParser
OFFSET_FROM_TYPEINF_SYM = 2 * utils.WORD_LEN
TypeError: unsupported operand type(s) for *: 'int' and 'NoneTyp
WORD_LEN is not updated. My guess is the callback that sets WORD_LEN when a new database is opened is not firing. It is defined in utils.py
#utils.py
WORD_LEN = None
def update_word_len(code, old=0):
global WORD_LEN
info = idaapi.get_inf_structure()
if info.is_64bit():
logging.debug("is 32 bit")
WORD_LEN = 8
elif info.is_32bit():
logging.debug("is 32 bit")
WORD_LEN = 4
idaapi.notify_when(idaapi.NW_OPENIDB, update_word_len)
One work-around is to import utils and call update_word_len, then try to import GccRTTIParser
import ida_medigate
ida_medigate.utils.update_len(1)
form ida_medigate.rtti_parser import GccRTTIParser