diff --git a/HexRaysPyTools/callbacks/scanners.py b/HexRaysPyTools/callbacks/scanners.py index c32a948..e06e3df 100644 --- a/HexRaysPyTools/callbacks/scanners.py +++ b/HexRaysPyTools/callbacks/scanners.py @@ -127,7 +127,13 @@ def activate(self, ctx): NewDeepSearchVisitor(cfunc, 0, obj, cache.temporary_structure).process() def update(self, ctx): - if ctx.form_type == idaapi.BWN_FUNCS: + try: + # IDA >= 9 + type_ = ctx.widget_type + except: + type_ = ctx.form_type + + if type_ == idaapi.BWN_FUNCS: idaapi.attach_action_to_popup(ctx.widget, None, self.name) return idaapi.AST_ENABLE_FOR_WIDGET return idaapi.AST_DISABLE_FOR_WIDGET diff --git a/HexRaysPyTools/core/const.py b/HexRaysPyTools/core/const.py index 389bc50..f84d4c2 100644 --- a/HexRaysPyTools/core/const.py +++ b/HexRaysPyTools/core/const.py @@ -1,4 +1,5 @@ import idaapi +import ida_ida EA64 = None EA_SIZE = None @@ -33,7 +34,12 @@ def init(): PX_WORD_TINFO, DUMMY_FUNC, CONST_PCHAR_TINFO, CHAR_TINFO, PCHAR_TINFO, CONST_VOID_TINFO, \ WORD_TINFO, PWORD_TINFO, EA64, EA_SIZE - EA64 = idaapi.get_inf_structure().is_64bit() + try: + EA64 = idaapi.get_inf_structure().is_64bit() + except: + # IDA 9 + EA64 = not ida_ida.inf_is_32bit_exactly() + EA_SIZE = 8 if EA64 else 4 VOID_TINFO = idaapi.tinfo_t(idaapi.BT_VOID) diff --git a/HexRaysPyTools/core/helper.py b/HexRaysPyTools/core/helper.py index 20275d3..eafee04 100644 --- a/HexRaysPyTools/core/helper.py +++ b/HexRaysPyTools/core/helper.py @@ -1,6 +1,7 @@ import collections import logging +import ida_ida import idaapi import idc @@ -20,7 +21,11 @@ def is_imported_ea(ea): def is_code_ea(ea): - if idaapi.cvar.inf.procname == "ARM": + try: + procname = ida_ida.inf_get_procname() + except: + procname = idaapi.cvar.inf.procname + if procname == "ARM": # In case of ARM code in THUMB mode we sometimes get pointers with thumb bit set flags = idaapi.get_full_flags(ea & -2) # flags_t else: diff --git a/readme.md b/readme.md index 1a702ac..3b7dc46 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,7 @@ About The plugin assists in the creation of classes/structures and detection of virtual tables. It also facilitates transforming decompiler output faster and allows to do some stuff which is otherwise impossible. -**Note**: The plugin supports IDA Pro 7.x with Python 2/3. +**Note**: The plugin supports IDA Pro 7.x with Python 2/3; it loads in IDA Pro 9.x with Python 3 but has not yet been extensively tested Installation ============