Skip to content

Commit

Permalink
Fix highlight detection (IDA 7 compat bug)
Browse files Browse the repository at this point in the history
  • Loading branch information
trou committed Oct 20, 2017
1 parent a3a0f90 commit 01ec2b9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/idabincat/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1474,9 +1474,17 @@ def __init__(self, state):
def activate(self, ctx):
self.s.gui.show_windows()

highlighted = idaapi.get_highlighted_identifier()
# IDA 7 compat bug: get_highlighted_identifier is mapped to
# get_highlight which expects a widget as arguments
# moreover, it returns a tuple instead of a String
try:
highlighted = idaapi.get_highlighted_identifier()
except TypeError:
highlighted = idaapi.get_highlight(ctx.widget)
if highlighted is None:
highlighted = ''
return 0
elif type(highlighted) is tuple:
highlighted = highlighted[0]
address = self.s.current_ea
# guess whether highlighted text is register or address
try:
Expand Down

0 comments on commit 01ec2b9

Please sign in to comment.