ida_medigate icon indicating copy to clipboard operation
ida_medigate copied to clipboard

TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'

Open joroMaser opened this issue 4 years ago • 1 comments

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

joroMaser avatar Nov 10 '21 08:11 joroMaser

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

RoberaHaile avatar Apr 29 '25 20:04 RoberaHaile