Exemplo n.º 1
0
    def activate(self, ctx):
        hx_view = idaapi.get_widget_vdui(ctx.widget)
        if not self.check(hx_view):
            return

        data = []
        offset = hx_view.item.e.m
        struct_type = idaapi.remove_pointer(hx_view.item.e.x.type)
        ordinal = helper.get_ordinal(struct_type)
        result = struct_xrefs.XrefStorage().get_structure_info(ordinal, offset)
        for xref_info in result:
            data.append([
                idaapi.get_short_name(xref_info.func_ea) + "+" + hex(int(xref_info.offset)),
                xref_info.type,
                xref_info.line
            ])

        field_name = helper.get_member_name(struct_type, offset)
        chooser = forms.MyChoose(
            data,
            "Cross-references to {0}::{1}".format(struct_type.dstr(), field_name),
            [["Function", 20 | idaapi.CHCOL_PLAIN],
             ["Type", 2 | idaapi.CHCOL_PLAIN],
             ["Line", 40 | idaapi.CHCOL_PLAIN]]
        )
        idx = chooser.Show(True)
        if idx == -1:
            return

        xref = result[idx]
        idaapi.open_pseudocode(xref.func_ea + xref.offset, False)
Exemplo n.º 2
0
 def handle(self, event, *args):
     cfunc, level_of_maturity = args
     if level_of_maturity == idaapi.CMAT_FINAL:
         StructXrefCollectorVisitor(cfunc,
                                    struct_xrefs.XrefStorage()).process()