python类Jump()的实例源码

bap_comments.py 文件源码 项目:bap-ida-python 作者: BinaryAnalysisPlatform 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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])
jumper.py 文件源码 项目:IDAPPL 作者: yufengzjj 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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
strcluster.py 文件源码 项目:ida_strcluster 作者: Comsecuris 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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.py 文件源码 项目:Reef 作者: darx0r 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def OnSelectLine( self, n ):

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


# ------------------------------------------------------------------------------
TraceWidget.py 文件源码 项目:idasec 作者: RobinDavid 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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"
TraceWidget.py 文件源码 项目:idasec 作者: RobinDavid 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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"
create_tab_table.py 文件源码 项目:win_driver_plugin 作者: mwrlabs 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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)


问题


面经


文章

微信
公众号

扫码关注公众号