def up(self):
'''Return all the structures that reference this specific structure.'''
x, sid = idaapi.xrefblk_t(), self.id
# grab first structure that references this one
ok = x.first_to(sid, 0)
if not ok:
return ()
# continue collecting all structures that references this one
res = [(x.frm,x.iscode,x.type)]
while x.next_to():
res.append((x.frm,x.iscode,x.type))
# convert refs into a list of OREFs
refs = [ interface.OREF(xrfrom, xriscode, interface.ref_t.of(xrtype)) for xrfrom, xriscode, xrtype in res ]
# return as a tuple
return map(utils.compose(operator.itemgetter(0), instance), refs)
评论列表
文章目录