Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions LazyIDA.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,11 @@ def activate(self, ctx):
return 1

def update(self, ctx):
if ctx.form_type 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.widget_type in (idaapi.BWN_DISASM, dump_type):
return idaapi.AST_ENABLE_FOR_WIDGET
else:
return idaapi.AST_DISABLE_FOR_WIDGET
Expand Down Expand Up @@ -653,8 +657,12 @@ def __init__(self):
idaapi.UI_Hooks.__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:
widget_type = idaapi.get_widget_type(form)
if idaapi.IDA_SDK_VERSION >= 900:
dump_type = idaapi.BWN_HEXVIEW
else:
dump_type = idaapi.BWN_DUMP
if widget_type == idaapi.BWN_DISASM or widget_type == dump_type:
idaapi.attach_action_to_popup(form, popup, ACTION_PASTE, None)
idaapi.attach_action_to_popup(form, popup, ACTION_DUMPER, None)
idaapi.attach_action_to_popup(form, popup, ACTION_JMP, None)
Expand All @@ -666,7 +674,7 @@ def finish_populating_widget_popup(self, form, popup):
for action in ACTION_CONVERT:
idaapi.attach_action_to_popup(form, popup, action, "Convert/")

if form_type == idaapi.BWN_DISASM and (ARCH, BITS) in [(idaapi.PLFM_386, 32),
if widget_type == idaapi.BWN_DISASM and (ARCH, BITS) in [(idaapi.PLFM_386, 32),
(idaapi.PLFM_386, 64),
(idaapi.PLFM_ARM, 32), ]:
idaapi.attach_action_to_popup(form, popup, ACTION_SCANVUL, None)
Expand Down Expand Up @@ -719,7 +727,7 @@ def init(self):
ARCH = idaapi.ph_get_id()
if idaapi.inf_is_64bit():
BITS = 64
elif idaapi.inf_is_32bit():
elif idaapi.inf_is_32bit_or_higher():
BITS = 32
else:
BITS = 16
Expand Down