Skip to content

Commit

Permalink
Fix widget type check for IDA 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Apeng7364 committed Oct 23, 2024
1 parent d80b0ff commit 4d6a543
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions LazyIDA.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ def update(self, ctx):
target_attr = "widget_type"
else:
target_attr = "form_type"
if ctx.__getattribute__(target_attr) in (idaapi.BWN_DISASM, idaapi.BWN_DUMP):

if idaapi.IDA_SDK_VERSION >= 900:
dump_type = idaapi.BWN_HEXVIEW
else:
dump_type = idaapi.BWN_DUMP

if ctx.__getattribute__(target_attr) in (idaapi.BWN_DISASM, dump_type):
return idaapi.AST_ENABLE_FOR_WIDGET
else:
return idaapi.AST_DISABLE_FOR_WIDGET
Expand Down Expand Up @@ -408,7 +414,12 @@ def __init__(self):
def finish_populating_widget_popup(self, form, popup):
form_type = idaapi.get_widget_type(form)

if form_type == idaapi.BWN_DISASM or form_type == idaapi.BWN_DUMP:
if idaapi.IDA_SDK_VERSION >= 900:
dump_type = idaapi.BWN_HEXVIEW
else:
dump_dump_typeattr = idaapi.BWN_DUMP

if form_type == idaapi.BWN_DISASM or form_type == dump_type:
t0, t1, view = idaapi.twinpos_t(), idaapi.twinpos_t(), idaapi.get_current_viewer()
if idaapi.read_selection(view, t0, t1) or idc.get_item_size(idc.get_screen_ea()) > 1:
idaapi.attach_action_to_popup(form, popup, ACTION_XORDATA, None)
Expand Down

0 comments on commit 4d6a543

Please sign in to comment.