def extract_addresses(self):
'''A set of addresses associated with the line'''
anchor = idaapi.ctree_anchor_t()
line = copy(self.widget.line)
addresses = set()
while len(line) > 0:
skipcode_index = idaapi.tag_skipcode(line)
if skipcode_index == 0: # No code found
line = line[1:] # Skip one character ahead
else:
if tag_addrcode(line):
addr_tag = int(line[2:skipcode_index], 16)
anchor.value = addr_tag
if anchor.is_citem_anchor() \
and not anchor.is_blkcmt_anchor():
address = self.parent.treeitems.at(addr_tag).ea
if address != idaapi.BADADDR:
addresses.add(address)
line = line[skipcode_index:] # Skip the colorcodes
return addresses
评论列表
文章目录