Python idaapi.get_screen_ea() Examples
The following are 19
code examples of idaapi.get_screen_ea().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
idaapi
, or try the search function
.
Example #1
Source File: PatternGenerationWidget.py From grap with MIT License | 6 votes |
def _onFuncButtonClicked(self): if not self.cc.PatternGenerator.graph.graph: print("WARNING: Unloaded CFG. Make sure to first \"Load the CFG\"") return ea = idaapi.get_screen_ea() if ea: func = idaapi.ida_funcs.get_func(ea) if func: if self.cc.PatternGenerator.rootNode is None: print("[I] Adding root node as function entrypoint: %x", func.start_ea) self.cc.PatternGenerator.setRootNode(func.start_ea) print("[I] Adding nodes to cover whole function") flowchart = idaapi.FlowChart(func) for bb in flowchart: last_inst_addr = idc.prev_head(bb.end_ea) self.cc.PatternGenerator.addTargetNode(last_inst_addr) self._render_if_real_time()
Example #2
Source File: LazyIDA.py From LazyIDA with MIT License | 6 votes |
def activate(self, ctx): if self.action == ACTION_HX_REMOVERETTYPE: vdui = idaapi.get_widget_vdui(ctx.widget) self.remove_rettype(vdui) vdui.refresh_ctext() elif self.action == ACTION_HX_COPYEA: ea = idaapi.get_screen_ea() if ea != idaapi.BADADDR: copy_to_clip("0x%X" % ea) print("Address 0x%X has been copied to clipboard" % ea) elif self.action == ACTION_HX_COPYNAME: name = idaapi.get_highlight(idaapi.get_current_viewer())[0] if name: copy_to_clip(name) print("%s has been copied to clipboard" % name) elif self.action == ACTION_HX_GOTOCLIP: loc = parse_location(clip_text()) print("Goto location 0x%x" % loc) idc.jumpto(loc) else: return 0 return 1
Example #3
Source File: codeblock.py From Sark with MIT License | 5 votes |
def get_codeblock(ea=None): if ea is None: ea = idaapi.get_screen_ea() flowchart_ = get_flowchart(ea) for code_block in flowchart_: if code_block.start_ea == ea: # External blocks can be zero-sized. return code_block if code_block.start_ea <= ea < code_block.end_ea: return code_block
Example #4
Source File: ui.py From ida-minsc with BSD 3-Clause "New" or "Revised" License | 5 votes |
def address(cls): '''Return the current address.''' return idaapi.get_screen_ea()
Example #5
Source File: idc.py From source with MIT License | 5 votes |
def here(): return idaapi.get_screen_ea()
Example #6
Source File: idc.py From source with MIT License | 5 votes |
def ScreenEA(): return idaapi.get_screen_ea()
Example #7
Source File: LazyIDA.py From LazyIDA with MIT License | 5 votes |
def finish_populating_widget_popup(self, form, popup): form_type = idaapi.get_widget_type(form) if form_type == idaapi.BWN_DISASM or form_type == idaapi.BWN_DUMP: t0, t1, view = idaapi.twinpos_t(), idaapi.twinpos_t(), idaapi.get_current_viewer() if idaapi.read_selection(view, t0, t1) or idc.get_item_size(idc.get_screen_ea()) > 1: idaapi.attach_action_to_popup(form, popup, ACTION_XORDATA, None) idaapi.attach_action_to_popup(form, popup, ACTION_FILLNOP, None) for action in ACTION_CONVERT: idaapi.attach_action_to_popup(form, popup, action, "Convert/") if form_type == idaapi.BWN_DISASM and (ARCH, BITS) in [(idaapi.PLFM_386, 32), (idaapi.PLFM_386, 64), (idaapi.PLFM_ARM, 32),]: idaapi.attach_action_to_popup(form, popup, ACTION_SCANVUL, None)
Example #8
Source File: LazyIDA.py From LazyIDA with MIT License | 5 votes |
def activate(self, ctx): if self.action == ACTION_COPYEA: ea = idc.get_screen_ea() if ea != idaapi.BADADDR: copy_to_clip("0x%X" % ea) print("Address 0x%X has been copied to clipboard" % ea) elif self.action == ACTION_GOTOCLIP: loc = parse_location(clip_text()) if loc != idaapi.BADADDR: print("Goto location 0x%x" % loc) idc.jumpto(loc) return 1
Example #9
Source File: ida_api.py From lighthouse with MIT License | 5 votes |
def get_current_address(self): return idaapi.get_screen_ea()
Example #10
Source File: ida_integration.py From lighthouse with MIT License | 5 votes |
def _pre_open_coverage_xref(self): """ Grab a contextual address before opening the coverage xref dialog. """ self.open_coverage_xref(idaapi.get_screen_ea()) #------------------------------------------------------------------------------ # IDA UI Helpers #------------------------------------------------------------------------------
Example #11
Source File: main_gui.py From IDAngr with BSD 2-Clause "Simplified" License | 5 votes |
def activate(self, ctx): global _idangr_ctx, _idangr_panel if self.action == "Find": addr = idaapi.get_screen_ea() if addr in _idangr_ctx.avoid: _idangr_ctx.avoid.remove(addr) _idangr_panel.remove_avoid(addr) if addr in _idangr_ctx.find: return _idangr_ctx.find.append(addr) _idangr_panel.add_find(addr) elif self.action == "Avoid": addr = idaapi.get_screen_ea() if addr in _idangr_ctx.find: _idangr_ctx.find.remove(addr) _idangr_panel.remove_find(addr) if addr in _idangr_ctx.avoid: return _idangr_ctx.avoid.append(addr) _idangr_panel.add_avoid(addr) elif self.action == "Symbolic": addr = idaapi.get_screen_ea() #if addr in _idangr_ctx.simmem: # return m = IDAngrAddMemDialog.get_mem(addr) if m != None: _idangr_panel.add_mem(m[0], m[1]) #_idangr_ctx.simmem.append(m)
Example #12
Source File: codeblock.py From Sark with MIT License | 5 votes |
def get_flowchart(ea=None): if ea is None: ea = idaapi.get_screen_ea() func = idaapi.get_func(ea) flowchart_ = FlowChart(func) return flowchart_
Example #13
Source File: codeblock.py From Sark with MIT License | 5 votes |
def __init__(self, f=None, bounds=None, flags=idaapi.FC_PREDS, ignore_external=False): if f is None and bounds is None: f = idaapi.get_screen_ea() if f is not None: f = get_func(f) if ignore_external: flags |= idaapi.FC_NOEXT super(FlowChart, self).__init__(f=f, bounds=bounds, flags=flags)
Example #14
Source File: codeblock.py From Sark with MIT License | 5 votes |
def __init__(self, id_ea=None, bb=None, fc=None): if bb is None and fc is None: if id_ea is None: id_ea = idaapi.get_screen_ea() temp_codeblock = get_codeblock(id_ea) self.__dict__.update(temp_codeblock.__dict__) else: super(CodeBlock, self).__init__(id=id_ea, bb=bb, fc=fc)
Example #15
Source File: PatternGenerationWidget.py From grap with MIT License | 5 votes |
def _onRemoveTargetNode(self): try: self.cc.PatternGenerator.removeTargetNode(idc.get_screen_ea()) except: self.cc.PatternGenerator.removeTargetNode(idc.ScreenEA()) self._render_if_real_time()
Example #16
Source File: PatternGenerationWidget.py From grap with MIT License | 5 votes |
def setMatchType(self, type): try: selection, begin, end = None, None, None err = idaapi.read_selection(selection, begin, end) if err and selection: for ea in range(begin, end+1): self.cc.PatternGenerator.setMatchType(ea, type) else: self.cc.PatternGenerator.setMatchType(idc.get_screen_ea(), type) except: self.cc.PatternGenerator.setMatchType(idc.ScreenEA(), type) self._render_if_real_time()
Example #17
Source File: PatternGenerationWidget.py From grap with MIT License | 5 votes |
def _onAddTargetNode(self): try: self.cc.PatternGenerator.addTargetNode(idc.get_screen_ea()) except: self.cc.PatternGenerator.addTargetNode(idc.ScreenEA()) self._render_if_real_time()
Example #18
Source File: PatternGenerationWidget.py From grap with MIT License | 5 votes |
def _onSetRootNode(self): try: self.cc.PatternGenerator.setRootNode(idc.get_screen_ea()) except: self.cc.PatternGenerator.setRootNode(idc.ScreenEA()) self._render_if_real_time()
Example #19
Source File: ida_prefix.py From prefix with MIT License | 4 votes |
def get_cursor_func_ref(): """ Get the function reference under the user cursor. Returns BADADDR or a valid function address. """ current_widget = idaapi.get_current_widget() form_type = idaapi.get_widget_type(current_widget) vu = idaapi.get_widget_vdui(current_widget) # # hexrays view is active # if vu: cursor_addr = vu.item.get_ea() # # disassembly view is active # elif form_type == idaapi.BWN_DISASM: cursor_addr = idaapi.get_screen_ea() opnum = idaapi.get_opnum() if opnum != -1: # # if the cursor is over an operand value that has a function ref, # use that as a valid rename target # op_addr = idc.get_operand_value(cursor_addr, opnum) op_func = idaapi.get_func(op_addr) if op_func and op_func.start_ea == op_addr: return op_addr # unsupported/unknown view is active else: return idaapi.BADADDR # # if the cursor is over a function definition or other reference, use that # as a valid rename target # cursor_func = idaapi.get_func(cursor_addr) if cursor_func and cursor_func.start_ea == cursor_addr: return cursor_addr # fail return idaapi.BADADDR