Python idc 模块,Jump() 实例源码

我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用idc.Jump()

项目:bap-ida-python    作者:BinaryAnalysisPlatform    | 项目源码 | 文件源码
def run(self, arg):
        comms = {}
        for addr in ida.addresses():
            comm = idaapi.get_cmt(addr, 0)
            if comm:
                try:
                    parsed = bap_comment.parse(comm)
                    if parsed:
                        for (name, data) in parsed.items():
                            comms[(addr, name)] = data
                except:
                    idc.Message("BAP> failed to parse string {0}\n{1}".
                                format(comm, str(sys.exc_info()[1])))
        comms = [(name, addr, data)
                 for ((addr, name), data) in comms.items()]
        attrs = Attributes(comms)
        choice = attrs.Show(modal=True)
        if choice >= 0:
            idc.Jump(comms[choice][1])
项目:IDAPPL    作者:yufengzjj    | 项目源码 | 文件源码
def jump_click(self):
        global cur_selection, last_off
        if cur_selection != (None, None, None, None):
            off = self.off_edit.text()
            if off == "":
                off = "0"
            try:
                off = long(off, 16)
            except:
                pass
            if isinstance(off, long):
                last_off = hex(off).upper()
                idc.Jump(cur_selection[1] + off)
                self.close()
                self.deleteLater()
                return
            print "wrong format offset:" + off
项目:ida_strcluster    作者:Comsecuris    | 项目源码 | 文件源码
def doubleClickEvent(self, event):
        index = event.pos()
        try:
            item = self.model.itemFromIndex(self.view.indexAt(event.pos()))
            column = item.column()
            ea = item.ea
        except:
            return

        if ea != -1:
            idc.Jump(ea)
项目:Reef    作者:darx0r    | 项目源码 | 文件源码
def OnSelectLine( self, n ):

        row = ReefConfig.CHOOSER_ROW( *self.items[n] )
        to = row.Address
        idc.Jump( int(to, 16) )


# ------------------------------------------------------------------------------
项目:idasec    作者:RobinDavid    | 项目源码 | 文件源码
def go_to_instruction(self, item):
        table = self.index_map[self.traces_tab.currentIndex()]
        addr_item = table.item(item.row(), 1)
        addr_s = addr_item.text()
        try:
            addr = int(addr_s, 0)
            idc.Jump(addr)
        except Exception:
            print "Cannot jump to the selected location"
项目:idasec    作者:RobinDavid    | 项目源码 | 文件源码
def disassemble_from_trace(self):
        try:
            index = self.traces_tab.currentIndex()
            trace = self.core.traces[self.id_map[index]]

            self.disassemble_button.setFlat(True)
            found_match = False
            for k, inst in trace.instrs.items():
                if k in trace.metas:
                    for name, arg1, arg2 in trace.metas[k]:
                        if name == "wave":
                            self.parent.log("LOG", "Wave n°%d encountered at (%s,%x) stop.." % (arg1, k, inst.address))
                            prev_inst = trace.instrs[k-1]
                            idc.MakeComm(prev_inst.address, "Jump into Wave %d" % arg1)
                            self.disassemble_button.setFlat(False)
                            return
                # TODO: Check that the address is in the address space of the program
                if not idc.isCode(idc.GetFlags(inst.address)):
                    found_match = True
                    # TODO: Add an xref with the previous instruction
                    self.parent.log("LOG", "Addr:%x not decoded as an instruction" % inst.address)
                    if idc.MakeCode(inst.address) == 0:
                        self.parent.log("ERROR", "Fail to decode at:%x" % inst.address)
                    else:
                        idaapi.autoWait()
                        self.parent.log("SUCCESS", "Instruction decoded at:%x" % inst.address)

            if not found_match:
                self.parent.log("LOG", "All instruction are already decoded")
            self.disassemble_button.setFlat(False)
        except KeyError:
            print "No trace found to use"
项目:win_driver_plugin    作者:mwrlabs    | 项目源码 | 文件源码
def OnSelectLine(self, n):

        item = self.items[n]

        jump_ea = int(item[0], 16)
        # Only jump for valid addresses
        if idaapi.IDA_SDK_VERSION < 700:
            valid_addr = idc.isEnabled(jump_ea)
        else:
            valid_addr = idc.is_mapped(jump_ea)
        if valid_addr:
            idc.Jump(jump_ea)