ida_name
Functions that deal with names.
A non-tail address of the program may have a name. Tail addresses (i.e. the addresses in the middle of an instruction or data item) cannot have names.
Constants
MAXNAMELEN: Maximum length of a name in IDA (with the trailing zero)FUNC_IMPORT_PREFIX: Name prefix used by IDA for the imported functions.SN_CHECK: Fail if the name contains invalid characters.SN_NOCHECK: Replace invalid characters silently. If this bit is set, all invalid chars (not in NameChars or MangleChars) will be replaced by '_' List of valid characters is defined in ida.cfgSN_PUBLIC: if set, make name publicSN_NON_PUBLIC: if set, make name non-publicSN_WEAK: if set, make name weakSN_NON_WEAK: if set, make name non-weakSN_AUTO: if set, make name autogeneratedSN_NON_AUTO: if set, make name non-autogeneratedSN_NOLIST: if set, exclude name from the list. if not set, then include the name into the list (however, if other bits are set, the name might be immediately excluded from the list).SN_NOWARN: don't display a warning if failedSN_LOCAL: create local name. a function should exist. local names can't be public or weak. also they are not included into the list of names they can't have dummy prefixes.SN_IDBENC: the name is given in the IDB encoding; non-ASCII bytes will be decoded accordingly. Specifying SN_IDBENC also implies SN_NODUMMYSN_FORCE: if the specified name is already present in the database, try variations with a numerical suffix like "_123"SN_NODUMMY: automatically prepend the name with '' if it begins with a dummy suffix such as 'sub'. See also SN_IDBENCSN_DELTAIL: if name cannot be set because of a tail byte, delete the hindering itemSN_MULTI: if the specified address already has a name, then add the new name as a regular comment "Alternative name is ...". Except when the new name is public and the old one is not or when the old name is weak and the new one is not. In these cases we act as if bit SN_MULTI_FORCE is specified. If the new name only slightly differs from the old one, for example, only by the initial underscore or the artificial suffix '_##', then we ignore it.SN_MULTI_FORCE: if the specified address already has a name, put this old name into a regular comment and set the specified name. This bit may be used only with SN_MULTI.UCDR_STRLIT: string literalsUCDR_NAME: regular (unmangled) namesUCDR_MANGLED: mangled namesUCDR_TYPE: type namesVNT_IDENT: identifier (e.g., function name)VNT_TYPE: type name (can contain '<', '>', ...)VNT_UDTMEM: UDT (structure, union, enum) member.VNT_STRLIT: string literalVNT_VISIBLE: visible cp (obsolete; will be deleted)NT_NONE: name doesn't exist or has no valueNT_BYTE: name is byte name (regular name)NT_LOCAL: name is local labelNT_STKVAR: name is stack variable nameNT_ENUM: name is symbolic constantNT_ABS: name is absolute symbol (SEG_ABSSYM)NT_SEG: name is segment or segment register nameNT_STROFF: name is structure memberNT_BMASK: name is a bit group mask nameNT_REGVAR: name is a renamed register (*value is idx into pfn->regvars)GN_VISIBLE: replace forbidden characters by SUBSTCHARGN_COLORED: return colored nameGN_DEMANGLED: return demangled nameGN_STRICT: fail if cannot demangleGN_SHORT: use short form of demangled nameGN_LONG: use long form of demangled nameGN_LOCAL: try to get local name first; if failed, get globalGN_ISRET: for dummy names: use retlocGN_NOT_ISRET: for dummy names: do not use retlocGN_NOT_DUMMY: do not return a dummy nameGETN_APPZERO: meaningful only if the name refers to a structure. append a struct field name if the field offset is zero?GETN_NOFIXUP: ignore the fixup information when producing the nameGETN_NODUMMY: do not create a new dummy name but pretend it existsGNCN_NOSEG: ignore the segment prefix when producing the nameGNCN_NOCOLOR: generate an uncolored nameGNCN_NOLABEL: don't generate labelsGNCN_NOFUNC: don't generate funcname+... expressionsGNCN_SEG_FUNC: generate both segment and function names (default is to omit segment name if a function name is present)GNCN_SEGNUM: segment part is displayed as a hex numberGNCN_REQFUNC: return 0 if the address does not belong to a functionGNCN_REQNAME: return 0 if the address can only be represented as a hex numberGNCN_NODBGNM: don't use debug namesGNCN_PREFDBG: if using debug names, prefer debug names over function namesDEBNAME_EXACT: find a name at exactly the specified addressDEBNAME_LOWER: find a name with the address >= the specified addressDEBNAME_UPPER: find a name with the address > the specified addressDEBNAME_NICE: find a name with the address <= the specified addressDQT_NPURGED_8: only calculate number of purged bytes (sizeof(arg)==8)DQT_NPURGED_4: only calculate number of purged bytes (sizeof(arg)==4)DQT_NPURGED_2: only calculate number of purged bytes (sizeof(arg)==2)DQT_COMPILER: only detect compiler that generated the nameDQT_NAME_TYPE: only detect the name type (data/code)DQT_FULL: really demangleCN_KEEP_TRAILING_DIGITS: do not remove "_d+" at the end of nameCN_KEEP_UNDERSCORES: do not remove leading underscores. but it is ok to remove _imp.ME_INTERRME_PARAMERRME_ILLSTRME_SMALLANSME_FRAMEME_NOCOMPME_ERRAUTOME_NOHASHMEMME_NOSTRMEMME_NOERROR_LIMITM_PRCMSKMT_DEFAULTMT_CDECLMT_PASCALMT_STDCALLMT_FASTCALLMT_THISCALLMT_FORTRANMT_SYSCALLMT_INTERRUPTMT_MSFASTCALLMT_CLRCALLMT_DMDCALLMT_VECTORCALLMT_REGCALLMT_LOCALNAMEM_SAVEREGSM_CLASSMT_PUBLICMT_PRIVATEMT_PROTECTMT_MEMBERMT_VTABLEMT_RTTIM_PARMSKMT_PARSHFMT_PARMAXM_ELLIPSISMT_VOIDARGM_STATICM_VIRTUALM_AUTOCRTM_TYPMASKMT_OPERATMT_CONSTRMT_DESTRMT_CASTINGMT_CLRCDTORM_TRUNCATEM_THUNKM_ANONNSPM_TMPLNAMM_DBGNAMEM_COMPILERMT_MSCOMPMT_BORLANMT_WATCOMMT_OTHERMT_GNUMT_GCC3MT_VISAGEMNG_PTRMSKMNG_DEFNEARMNG_DEFNEARANYMNG_DEFFARMNG_NOPTRTYP16MNG_DEFHUGEMNG_DEFPTR64MNG_DEFNONEMNG_NOPTRTYPMNG_NODEFINITMNG_NOUNDERSCOREMNG_NOTYPEMNG_NORETTYPEMNG_NOBASEDTMNG_NOCALLCMNG_NOPOSTFCMNG_NOSCTYPMNG_NOTHROWMNG_NOSTVIRMNG_NOECSUMNG_NOCSVOLMNG_NOCLOSURMNG_NOUNALGMNG_NOMANAGEMNG_NOMODULEMNG_SHORT_SMNG_SHORT_UMNG_ZPT_SPACEMNG_DROP_IMPMNG_IGN_ANYWAYMNG_IGN_JMPMNG_MOVE_JMPMNG_COMPILER_MSKMNG_SHORT_FORMMNG_LONG_FORMMNG_CALC_VALIDcvarignore_noneignore_regvarignore_llabelignore_stkvarignore_glabelMANGLED_CODEMANGLED_DATAMANGLED_UNKNOWN
Classes Overview
ea_name_vec_tea_name_tNearestName: Utility class to help find the nearest name in a given ea/name dictionary
Functions Overview
get_name(ea: ida_idaapi.ea_t) -> strget_colored_name(ea: ida_idaapi.ea_t) -> strset_name(ea: ida_idaapi.ea_t, name: str, flags: int = 0) -> bool: Set or delete name of an item at the specified address. An item can be anything: instruction, function, data byte, word, string, structure, etc... Include name into the list of names.force_name(ea: ida_idaapi.ea_t, name: str, flags: int = 0) -> booldel_global_name(ea: ida_idaapi.ea_t) -> booldel_local_name(ea: ida_idaapi.ea_t) -> boolset_dummy_name(_from: ida_idaapi.ea_t, ea: ida_idaapi.ea_t) -> bool: Give an autogenerated (dummy) name. Autogenerated names have special prefixes (loc_...).make_name_auto(ea: ida_idaapi.ea_t) -> boolmake_name_user(ea: ida_idaapi.ea_t) -> boolis_valid_cp(cp: wchar32_t, kind: nametype_t, data: void * = None) -> bool: Is the given codepoint acceptable in the given context?set_cp_validity(*args) -> None: Mark the given codepoint (or range) as acceptable or unacceptable in the given context If 'endcp' is not BADCP, it is considered to be the end of the range: [cp, endcp), and is not included in the rangeget_cp_validity(*args) -> bool: Is the given codepoint (or range) acceptable in the given context? If 'endcp' is not BADCP, it is considered to be the end of the range: [cp, endcp), and is not included in the rangeis_ident_cp(cp: wchar32_t) -> bool: Can a character appear in a name? (present in ::NameChars or ::MangleChars)is_strlit_cp(cp: wchar32_t, specific_ranges: rangeset_crefvec_t const * = None) -> bool: Can a character appear in a string literal (present in ::StrlitChars) If 'specific_ranges' are specified, those will be used instead of the ones corresponding to the current culture (only if ::StrlitChars is configured to use the current culture)is_visible_cp(cp: wchar32_t) -> bool: Can a character be displayed in a name? (present in ::NameChars)is_ident(name: str) -> bool: Is a valid name? (including ::MangleChars)is_uname(name: str) -> bool: Is valid user-specified name? (valid name & !dummy prefix).is_valid_typename(name: str) -> bool: Is valid type name?extract_name(line: str, x: int) -> str: Extract a name or address from the specified string.hide_name(ea: ida_idaapi.ea_t) -> None: Remove name from the list of namesshow_name(ea: ida_idaapi.ea_t) -> None: Insert name to the list of names.get_name_ea(_from: ida_idaapi.ea_t, name: str) -> ida_idaapi.ea_t: Get the address of a name. This function resolves a name into an address. It can handle regular global and local names, as well as debugger names.get_name_base_ea(_from: ida_idaapi.ea_t, to: ida_idaapi.ea_t) -> ida_idaapi.ea_t: Get address of the name used in the expression for the addressget_name_value(_from: ida_idaapi.ea_t, name: str) -> uval_t *: Get value of the name. This function knows about: regular names, enums, special segments, etc.get_visible_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) -> strget_short_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) -> strget_long_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) -> strget_colored_short_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) -> strget_colored_long_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) -> strget_demangled_name(ea: ida_idaapi.ea_t, inhibitor: int, demform: int, gtn_flags: int = 0) -> strget_colored_demangled_name(ea: ida_idaapi.ea_t, inhibitor: int, demform: int, gtn_flags: int = 0) -> strget_name_color(_from: ida_idaapi.ea_t, ea: ida_idaapi.ea_t) -> color_t: Calculate flags for get_ea_name() function.get_name_expr(_from: ida_idaapi.ea_t, n: int, ea: ida_idaapi.ea_t, off: int, flags: int = 1) -> str: Convert address to name expression (name with a displacement). This function takes into account fixup information and returns a colored name expression (in the form +/- ). It also knows about structure members and arrays. If the specified address doesn't have a name, a dummy name is generated.get_nice_colored_name(ea: ida_idaapi.ea_t, flags: int = 0) -> str: Get a nice colored name at the specified address. Ex:append_struct_fields(disp: adiff_t *, n: int, path: tid_t const *, flags: flags64_t, delta: adiff_t, appzero: bool) -> str: Append names of struct fields to a name if the name is a struct name.is_public_name(ea: ida_idaapi.ea_t) -> boolmake_name_public(ea: ida_idaapi.ea_t) -> Nonemake_name_non_public(ea: ida_idaapi.ea_t) -> Noneis_weak_name(ea: ida_idaapi.ea_t) -> boolmake_name_weak(ea: ida_idaapi.ea_t) -> Nonemake_name_non_weak(ea: ida_idaapi.ea_t) -> Noneget_nlist_size() -> size_tget_nlist_idx(ea: ida_idaapi.ea_t) -> size_tis_in_nlist(ea: ida_idaapi.ea_t) -> boolget_nlist_ea(idx: size_t) -> ida_idaapi.ea_tget_nlist_name(idx: size_t) -> strrebuild_nlist() -> Nonereorder_dummy_names() -> None: Renumber dummy names.set_debug_name(ea: ida_idaapi.ea_t, name: str) -> boolget_debug_name(ea_ptr: ea_t *, how: debug_name_how_t) -> strdel_debug_names(ea1: ida_idaapi.ea_t, ea2: ida_idaapi.ea_t) -> Noneget_debug_name_ea(name: str) -> ida_idaapi.ea_tdemangle_name(name: str, disable_mask: int, demreq: demreq_type_t = DQT_FULL) -> str: Demangle a name.is_name_defined_locally(*args) -> bool: Is the name defined locally in the specified function?cleanup_name(ea: ida_idaapi.ea_t, name: str, flags: int = 0) -> strget_mangled_name_type(name: str) -> mangled_name_type_tget_debug_names(*args) -> PyObject *get_ea_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) -> str: Get name at the specified address.validate_name(name: str, type: nametype_t, flags: int = 1) -> PyObject *: Validate a name. If SN_NOCHECK is specified, this function replaces all invalid characters in the name with SUBSTCHAR. However, it will return false if name is valid but not allowed to be an identifier (is a register name).calc_gtn_flags(fromaddr, ea): Calculate flags for get_ea_name() function