def render_img(self, buf, addr, mouse_offs):
colors = []
head = ida_idaapi.BADADDR
tail = ida_idaapi.BADADDR
if mouse_offs is not None:
if self.switch == 0: # data
head = get_item_head(addr + mouse_offs)
tail = get_item_end(addr + mouse_offs)
else: # code
f = get_func(addr + mouse_offs)
if f:
head = f.startEA
tail = f.endEA
for pos in xrange(len(buf)):
c = ord(buf[pos]) & 0xFF
highlight = False
if mouse_offs is not None:
if addr + pos >= head and addr + pos < tail:
highlight = True
if highlight:
colors.append(qRgb(c, 0xFF, self.hl_color))
else:
colors.append(qRgb(c, 0, 0))
return colors
评论列表
文章目录