本文整理汇总了Python中idc.Jump方法的典型用法代码示例。如果您正苦于以下问题:Python idc.Jump方法的具体用法?Python idc.Jump怎么用?Python idc.Jump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idc
的用法示例。
在下文中一共展示了idc.Jump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: itemDoubleClickSlot
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def itemDoubleClickSlot(self, index):
"""
TreeView DoubleClicked Slot.
@param index: QModelIndex object of the clicked tree index item.
@return:
"""
function = index.data(role=DIE.UI.Function_Role)
if function is not None:
ea = function.function_start
if function.is_lib_func:
ea = function.proto_ea
if ea is not None and ea is not idc.BADADDR:
idc.Jump(ea)
return True
func_context = index.data(role=DIE.UI.FunctionContext_Role)
if func_context is not None:
ea = func_context.calling_ea
if ea is not None and ea is not idc.BADADDR:
idc.Jump(ea)
return True
示例2: run
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
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])
示例3: __init__
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def __init__(self, bits):
super(IntelMask, self).__init__(bits)
self.maskings = [('ESP Offsets', 'sp_mask'),
('EBP Offsets', 'bp_mask'),
('Call Offsets', 'call_mask'),
('Jump Offsets', 'jmp_mask'),
('Global Offsets', 'global_mask'),
('Customize', 'custom_mask')]
self.registers = [ ('EAX', 'eax_mask'), ('EBX', 'ebx_mask'),
('ECX', 'ecx_mask'), ('EDX', 'edx_mask'),
('ESI', 'esi_mask'), ('EDI', 'edi_mask')]
if not is_32bit():
self.registers = []
self.gui = self._init_gui()
示例4: subsignature_selected
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def subsignature_selected(self, item):
try:
match = self.matches[item.subsignature_name]
self.match_label.setText("Match: EA: 0x%08x Length: % 4d Bytes: %s" % \
(match["ea"], len(match["data"]), " ".join("%02x" % ord(x) for x in match["data"])))
idc.Jump(match["ea"])
for ea, color in self.previous_colors:
idc.SetColor(ea, idc.CIC_ITEM, color)
self.previous_colors = []
for ea in idautils.Heads(match["ea"], match["ea"] + len(match["data"])):
self.previous_colors.append((ea, idc.GetColor(ea, idc.CIC_ITEM)))
idc.SetColor(ea, idc.CIC_ITEM, SIGALYZER_COLOR_HIGHLIGHTED)
except KeyError:
self.match_label.setText("No match")
for ea, color in self.previous_colors:
idc.SetColor(ea, idc.CIC_ITEM, color)
self.previous_colors = []
except IndexError:
log.exception("While selecting subsignature")
示例5: go_to_instruction
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
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"
示例6: disassemble_from_trace
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
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"
示例7: OnSelectLine
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
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)
示例8: OnJump
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def OnJump(self, row, column):
ea = self.tableWidget.item(row, column).text()
if column == 0:
idc.Jump(int(ea, 16))
示例9: enter
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def enter(self, n):
o = self.list[n-1]
idc.Jump(o.caller)
# -----------------------------------------------------------------------
示例10: jump_user_to
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def jump_user_to(self, where):
print "[+] Jumping to", where
idc.Jump(int(where, 16))
示例11: click_tree
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def click_tree(self):
i = self._switch_tree.currentItem()
addr = i.text(0).strip()
if not addr.startswith("0x"):
addr = idaapi.get_name_ea(idc.BADADDR, str(addr))
else:
addr = addr[2:10]
addr = int(addr, 16)
idc.Jump(addr)
return
示例12: clickRow
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def clickRow(self):
addr = int(self._call_table.item(self._call_table.currentRow(), 1).text(), 16)
if addr:
idc.Jump(addr)
示例13: click_row
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def click_row(self):
i = self._bytestring_table.item(self._bytestring_table.currentRow(), 0)
bstr = self._bytestring_table.item(self._bytestring_table.currentRow(), 2)
addr = i.text().strip()
bstr = bstr.text()
if not addr.startswith("0x"):
addr = idaapi.get_name_ea(idc.BADADDR, str(addr))
else:
addr = addr[2:10]
addr = int(addr, 16)
idc.Jump(addr)
self._clipboard.setText(bstr)
示例14: clickRow
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def clickRow(self):
try:
addr = int(self._import_table.item(self._import_table.currentRow(), 0).text(), 16)
idc.Jump(addr)
except Exception, e:
log.error("Exception encountered: {}".format(e))
示例15: click_row
# 需要导入模块: import idc [as 别名]
# 或者: from idc import Jump [as 别名]
def click_row(self):
addr = self._interesting_xor_table.item(self._interesting_xor_table.currentRow(), 1).text().strip()
addr= int(addr, 16)
idc.Jump(addr)