Python ida_name.set_name() Examples

The following are 3 code examples of ida_name.set_name(). 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 ida_name , or try the search function .
Example #1
Source File: ready_patterns.py    From HRAST with MIT License 6 votes vote down vote up
def getProc_addr(idx, ctx):
    import ida_bytes
    obj = ctx.get_obj("fcnPtr")
    print "%x" % obj.addr
    name = ctx.get_obj("fcnName")
    name_str = ida_bytes.get_strlit_contents(name.addr, -1, -1)
    ida_name.set_name(obj.addr, name_str)
    return False




#========================================
# This pattern will replace code like that
#   struct_XXX.field_X = (anytype)sub_XXXX
#   struct_XXX.field_Y = (anytype)sub_YYYY
# by
#   struct_XXX.sub_XXXX = (anytype)sub_XXXX
#   struct_XXX.sub_YYYY = (anytype)sub_YYYY
# where struct_XXX - global variable
# So, it's just renames structure fields
#======================================== 
Example #2
Source File: events.py    From IDArling with GNU General Public License v3.0 5 votes vote down vote up
def __call__(self):
        flags = ida_name.SN_LOCAL if self.local_name else 0
        ida_name.set_name(
            self.ea, Event.encode(self.new_name), flags | ida_name.SN_NOWARN
        )
        ida_kernwin.request_refresh(ida_kernwin.IWID_DISASMS)
        HexRaysEvent.refresh_pseudocode_view(self.ea) 
Example #3
Source File: name.py    From rematch with GNU General Public License v3.0 5 votes vote down vote up
def apply(self, data):
    name = str(data['name'])
    # TODO: flags should be abstructed away from thier enum values to support
    # changes between versions
    flags = data['flags']
    ida_name.set_name(self.offset, name, flags)