Example #1
0
def get_name_ea(*args) -> "ea_t":
    r"""
    get_name_ea(_from, name) -> ea_t


    Get address of the name. Dummy names (like byte_xxxx where xxxx are
    hex digits) are parsed by this function to obtain the address. The
    database is not consulted for them. This function works only with
    regular names.
    
    @param _from: linear address where the name is used. if not
                  applicable, then should be  BADADDR . (C++: ea_t)
    @param name: any name in the program or NULL (C++: const char *)
    @return: address of the name or  BADADDR
    """
    return _ida_name.get_name_ea(*args)
Example #2
0
    def __name_or_ea(name_or_ea):
        """
        Function that accepts a name or an ea and checks if the address is enabled.
        If a name is passed then idaapi.get_name_ea() is applied to retrieve the name
        @return:
            - Returns the resolved EA or
            - Raises an exception if the address is not enabled
        """

        # a string? try to resolve it
        if type(name_or_ea) == types.StringType:
            ea = _ida_name.get_name_ea(_ida_idaapi.BADADDR, name_or_ea)
        else:
            ea = name_or_ea
        # could not resolve name or invalid address?
        if ea == _ida_idaapi.BADADDR or not _ida_bytes.is_mapped(ea):
            raise ValueError, "Undefined function " + name_or_ea
        return ea
Example #3
0
    def __name_or_ea(name_or_ea):
        """
        Function that accepts a name or an ea and checks if the address is enabled.
        If a name is passed then idaapi.get_name_ea() is applied to retrieve the name
        @return:
            - Returns the resolved EA or
            - Raises an exception if the address is not enabled
        """

        # a string? try to resolve it
        if type(name_or_ea) == bytes:
            ea = _ida_name.get_name_ea(_ida_idaapi.BADADDR, name_or_ea)
        else:
            ea = name_or_ea
        # could not resolve name or invalid address?
        if ea == _ida_idaapi.BADADDR or not _ida_bytes.is_mapped(ea):
            raise ValueError("Undefined function " + name_or_ea)
        return ea
Example #4
0
def get_name_ea(*args):
    """
  get_name_ea(_from, name) -> ea_t
  """
    return _ida_name.get_name_ea(*args)