Ejemplo n.º 1
0
def get_ea_name(ea, fromaddr=idc.BADADDR, true=False, user=False):
    """Get the name of an address.

    This function returns the name associated with the byte at the specified address.

    Arguments:
        ea: The linear address whose name to find.

    Options:
        fromaddr: The referring address. Default is BADADDR. Some addresses have a
            location-specific name (for example, labels within a function). If fromaddr is not
            BADADDR, then this function will try to retrieve the name of ea from fromaddr's
            perspective. The global name will be returned if no location-specific name is found.
        true: Retrieve the true name rather than the display name. Default is False.
        user: Return "" if the name is not a user name.

    Returns:
        The name of the address or "".
    """
    if user and not idc.hasUserName(idc.GetFlags(ea)):
        return ""
    if true:
        return idc.GetTrueNameEx(fromaddr, ea)
    else:
        return idc.NameEx(fromaddr, ea)
Ejemplo n.º 2
0
Archivo: util.py Proyecto: d-ned/mcsema
def get_symbol_name(from_ea, ea=None, allow_dummy=False):
    if ea is None:
        ea = from_ea

    global _FORCED_NAMES
    if ea in _FORCED_NAMES:
        return _FORCED_NAMES[ea]

    flags = idc.GetFlags(ea)
    if not allow_dummy and idaapi.has_dummy_name(flags):
        return ""

    name = ""
    try:
        name = name or idc.GetTrueNameEx(from_ea, ea)
    except:
        pass

    try:
        name = name or idc.GetFunctionName(ea)
    except:
        pass

    return name
Ejemplo n.º 3
0
def getFunctionName(ea):
    return idc.GetTrueNameEx(ea,ea)