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.

Attributes

SWIG_PYTHON_LEGACY_BOOL

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.cfg

SN_PUBLIC

if set, make name public

SN_NON_PUBLIC

if set, make name non-public

SN_WEAK

if set, make name weak

SN_NON_WEAK

if set, make name non-weak

SN_AUTO

if set, make name autogenerated

SN_NON_AUTO

if set, make name non-autogenerated

SN_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 failed

SN_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_NODUMMY

SN_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_IDBENC

SN_DELTAIL

if name cannot be set because of a tail byte, delete the hindering item

SN_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 literals

UCDR_NAME

regular (unmangled) names

UCDR_MANGLED

mangled names

UCDR_TYPE

type names

VNT_IDENT

identifier (e.g., function name)

VNT_TYPE

type name (can contain '<', '>', ...)

VNT_UDTMEM

UDT (structure, union, enum) member.

VNT_STRLIT

string literal

VNT_VISIBLE

visible cp (obsolete; will be deleted)

NT_NONE

name doesn't exist or has no value

NT_BYTE

name is byte name (regular name)

NT_LOCAL

name is local label

NT_STKVAR

name is stack variable name

NT_ENUM

name is symbolic constant

NT_ABS

name is absolute symbol (SEG_ABSSYM)

NT_SEG

name is segment or segment register name

NT_STROFF

name is structure member

NT_BMASK

name is a bit group mask name

NT_REGVAR

name is a renamed register (*value is idx into pfn->regvars)

GN_VISIBLE

replace forbidden characters by SUBSTCHAR

GN_COLORED

return colored name

GN_DEMANGLED

return demangled name

GN_STRICT

fail if cannot demangle

GN_SHORT

use short form of demangled name

GN_LONG

use long form of demangled name

GN_LOCAL

try to get local name first; if failed, get global

GN_ISRET

for dummy names: use retloc

GN_NOT_ISRET

for dummy names: do not use retloc

GN_NOT_DUMMY

do not return a dummy name

GETN_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 name

GETN_NODUMMY

do not create a new dummy name but pretend it exists

GNCN_NOSEG

ignore the segment prefix when producing the name

GNCN_NOCOLOR

generate an uncolored name

GNCN_NOLABEL

don't generate labels

GNCN_NOFUNC

don't generate funcname+... expressions

GNCN_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 number

GNCN_REQFUNC

return 0 if the address does not belong to a function

GNCN_REQNAME

return 0 if the address can only be represented as a hex number

GNCN_NODBGNM

don't use debug names

GNCN_PREFDBG

if using debug names, prefer debug names over function names

DEBNAME_EXACT

find a name at exactly the specified address

DEBNAME_LOWER

find a name with the address >= the specified address

DEBNAME_UPPER

find a name with the address > the specified address

DEBNAME_NICE

find a name with the address <= the specified address

DQT_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 name

DQT_NAME_TYPE

only detect the name type (data/code)

DQT_FULL

really demangle

CN_KEEP_TRAILING_DIGITS

do not remove "_d+" at the end of name

CN_KEEP_UNDERSCORES

do not remove leading underscores. but it is ok to remove __imp_.

ME_INTERR

ME_PARAMERR

ME_ILLSTR

ME_SMALLANS

ME_FRAME

ME_NOCOMP

ME_ERRAUTO

ME_NOHASHMEM

ME_NOSTRMEM

ME_NOERROR_LIMIT

M_PRCMSK

MT_DEFAULT

MT_CDECL

MT_PASCAL

MT_STDCALL

MT_FASTCALL

MT_THISCALL

MT_FORTRAN

MT_SYSCALL

MT_INTERRUPT

MT_MSFASTCALL

MT_CLRCALL

MT_DMDCALL

MT_VECTORCALL

MT_REGCALL

MT_LOCALNAME

M_SAVEREGS

M_CLASS

MT_PUBLIC

MT_PRIVATE

MT_PROTECT

MT_MEMBER

MT_VTABLE

MT_RTTI

M_PARMSK

MT_PARSHF

MT_PARMAX

M_ELLIPSIS

MT_VOIDARG

M_STATIC

M_VIRTUAL

M_AUTOCRT

M_TYPMASK

MT_OPERAT

MT_CONSTR

MT_DESTR

MT_CASTING

MT_CLRCDTOR

M_TRUNCATE

M_THUNK

M_ANONNSP

M_TMPLNAM

M_DBGNAME

M_COMPILER

MT_MSCOMP

MT_BORLAN

MT_WATCOM

MT_OTHER

MT_GNU

MT_GCC3

MT_VISAGE

MNG_PTRMSK

MNG_DEFNEAR

MNG_DEFNEARANY

MNG_DEFFAR

MNG_NOPTRTYP16

MNG_DEFHUGE

MNG_DEFPTR64

MNG_DEFNONE

MNG_NOPTRTYP

MNG_NODEFINIT

MNG_NOUNDERSCORE

MNG_NOTYPE

MNG_NORETTYPE

MNG_NOBASEDT

MNG_NOCALLC

MNG_NOPOSTFC

MNG_NOSCTYP

MNG_NOTHROW

MNG_NOSTVIR

MNG_NOECSU

MNG_NOCSVOL

MNG_NOCLOSUR

MNG_NOUNALG

MNG_NOMANAGE

MNG_NOMODULE

MNG_SHORT_S

MNG_SHORT_U

MNG_ZPT_SPACE

MNG_DROP_IMP

MNG_IGN_ANYWAY

MNG_IGN_JMP

MNG_MOVE_JMP

MNG_COMPILER_MSK

MNG_SHORT_FORM

MNG_LONG_FORM

MNG_CALC_VALID

cvar

ignore_none

ignore_regvar

ignore_llabel

ignore_stkvar

ignore_glabel

MANGLED_CODE

MANGLED_DATA

MANGLED_UNKNOWN

Classes

ea_name_vec_t

ea_name_t

NearestName

Utility class to help find the nearest name in a given ea/name dictionary

Functions

get_name(→ str)

get_colored_name(→ str)

set_name(→ 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(→ bool)

del_global_name(→ bool)

del_local_name(→ bool)

set_dummy_name(→ bool)

Give an autogenerated (dummy) name. Autogenerated names have special prefixes (loc_...).

make_name_auto(→ bool)

make_name_user(→ bool)

is_valid_cp(→ bool)

Is the given codepoint acceptable in the given context?

set_cp_validity(→ 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 range

get_cp_validity(→ 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 range

is_ident_cp(→ bool)

Can a character appear in a name? (present in ::NameChars or ::MangleChars)

is_strlit_cp(→ 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(→ bool)

Can a character be displayed in a name? (present in ::NameChars)

is_ident(→ bool)

Is a valid name? (including ::MangleChars)

is_uname(→ bool)

Is valid user-specified name? (valid name & !dummy prefix).

is_valid_typename(→ bool)

Is valid type name?

extract_name(→ str)

Extract a name or address from the specified string.

hide_name(→ None)

Remove name from the list of names

show_name(→ None)

Insert name to the list of names.

get_name_ea(→ 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(→ ida_idaapi.ea_t)

Get address of the name used in the expression for the address

get_name_value(→ uval_t *)

Get value of the name. This function knows about: regular names, enums, special segments, etc.

get_visible_name(→ str)

get_short_name(→ str)

get_long_name(→ str)

get_colored_short_name(→ str)

get_colored_long_name(→ str)

get_demangled_name(→ str)

get_colored_demangled_name(→ str)

get_name_color(→ color_t)

Calculate flags for get_ea_name() function.

get_name_expr(→ 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 <name> +/- <offset>). 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(→ str)

Get a nice colored name at the specified address. Ex:

append_struct_fields(→ str)

Append names of struct fields to a name if the name is a struct name.

is_public_name(→ bool)

make_name_public(→ None)

make_name_non_public(→ None)

is_weak_name(→ bool)

make_name_weak(→ None)

make_name_non_weak(→ None)

get_nlist_size(→ size_t)

get_nlist_idx(→ size_t)

is_in_nlist(→ bool)

get_nlist_ea(→ ida_idaapi.ea_t)

get_nlist_name(→ str)

rebuild_nlist(→ None)

reorder_dummy_names(→ None)

Renumber dummy names.

set_debug_name(→ bool)

get_debug_name(→ str)

del_debug_names(→ None)

get_debug_name_ea(→ ida_idaapi.ea_t)

demangle_name(→ str)

Demangle a name.

is_name_defined_locally(→ bool)

Is the name defined locally in the specified function?

cleanup_name(→ str)

get_mangled_name_type(→ mangled_name_type_t)

get_debug_names(→ PyObject *)

get_ea_name(→ str)

Get name at the specified address.

validate_name(→ 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

Module Contents

ida_name.SWIG_PYTHON_LEGACY_BOOL
class ida_name.ea_name_vec_t(*args)

Bases: object

thisown
push_back(*args) ea_name_t &
pop_back() None
size() size_t
empty() bool
at(_idx: size_t) ea_name_t const &
qclear() None
clear() None
resize(*args) None
grow(*args) None
capacity() size_t
reserve(cnt: size_t) None
truncate() None
swap(r: ea_name_vec_t) None
extract() ea_name_t *
inject(s: ea_name_t, len: size_t) None
begin(*args) qvector< ea_name_t >::const_iterator
end(*args) qvector< ea_name_t >::const_iterator
insert(it: ea_name_t, x: ea_name_t) qvector< ea_name_t >::iterator
erase(*args) qvector< ea_name_t >::iterator
append(x: ea_name_t) None
extend(x: ea_name_vec_t) None
front
back
ida_name.get_name(ea: ida_idaapi.ea_t) str
ida_name.get_colored_name(ea: ida_idaapi.ea_t) str
ida_name.MAXNAMELEN

Maximum length of a name in IDA (with the trailing zero)

ida_name.FUNC_IMPORT_PREFIX

Name prefix used by IDA for the imported functions.

ida_name.set_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.

Parameters:
  • ea – linear address. do nothing if ea is not valid (return 0). tail bytes can’t have names.

  • name – new name.

  • nullptr: do nothing (return 0).

  • “” : delete name.

  • otherwise this is a new name.

Parameters:

flags – Set name flags. If a bit is not specified, then the corresponding action is not performed and the name will retain the same bits as before calling this function. For new names, default is: non-public, non-weak, non-auto.

Returns:

1: ok, name is changed

Returns:

0: failure, a warning is displayed

ida_name.SN_CHECK

Fail if the name contains invalid characters.

ida_name.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.cfg

ida_name.SN_PUBLIC

if set, make name public

ida_name.SN_NON_PUBLIC

if set, make name non-public

ida_name.SN_WEAK

if set, make name weak

ida_name.SN_NON_WEAK

if set, make name non-weak

ida_name.SN_AUTO

if set, make name autogenerated

ida_name.SN_NON_AUTO

if set, make name non-autogenerated

ida_name.SN_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).

ida_name.SN_NOWARN

don’t display a warning if failed

ida_name.SN_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.

ida_name.SN_IDBENC

the name is given in the IDB encoding; non-ASCII bytes will be decoded accordingly. Specifying SN_IDBENC also implies SN_NODUMMY

ida_name.SN_FORCE

if the specified name is already present in the database, try variations with a numerical suffix like “_123”

ida_name.SN_NODUMMY

automatically prepend the name with ‘_’ if it begins with a dummy suffix such as ‘sub_’. See also SN_IDBENC

ida_name.SN_DELTAIL

if name cannot be set because of a tail byte, delete the hindering item

ida_name.SN_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.

ida_name.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.

ida_name.force_name(ea: ida_idaapi.ea_t, name: str, flags: int = 0) bool
ida_name.del_global_name(ea: ida_idaapi.ea_t) bool
ida_name.del_local_name(ea: ida_idaapi.ea_t) bool
ida_name.set_dummy_name(_from: ida_idaapi.ea_t, ea: ida_idaapi.ea_t) bool

Give an autogenerated (dummy) name. Autogenerated names have special prefixes (loc_…).

Parameters:

ea – linear address

Returns:

1: ok, dummy name is generated or the byte already had a name

Returns:

0: failure, invalid address or tail byte

ida_name.make_name_auto(ea: ida_idaapi.ea_t) bool
ida_name.make_name_user(ea: ida_idaapi.ea_t) bool
ida_name.UCDR_STRLIT

string literals

ida_name.UCDR_NAME

regular (unmangled) names

ida_name.UCDR_MANGLED

mangled names

ida_name.UCDR_TYPE

type names

ida_name.VNT_IDENT

identifier (e.g., function name)

ida_name.VNT_TYPE

type name (can contain ‘<’, ‘>’, …)

ida_name.VNT_UDTMEM

UDT (structure, union, enum) member.

ida_name.VNT_STRLIT

string literal

ida_name.VNT_VISIBLE

visible cp (obsolete; will be deleted)

ida_name.is_valid_cp(cp: wchar32_t, kind: nametype_t, data: void * = None) bool

Is the given codepoint acceptable in the given context?

ida_name.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 range

ida_name.get_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 range

ida_name.is_ident_cp(cp: wchar32_t) bool

Can a character appear in a name? (present in ::NameChars or ::MangleChars)

ida_name.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)

ida_name.is_visible_cp(cp: wchar32_t) bool

Can a character be displayed in a name? (present in ::NameChars)

ida_name.is_ident(name: str) bool

Is a valid name? (including ::MangleChars)

ida_name.is_uname(name: str) bool

Is valid user-specified name? (valid name & !dummy prefix).

Parameters:

name – name to test. may be nullptr.

Returns:

1: yes

Returns:

0: no

ida_name.is_valid_typename(name: str) bool

Is valid type name?

Parameters:

name – name to test. may be nullptr.

Returns:

1: yes

Returns:

0: no

ida_name.extract_name(line: str, x: int) str

Extract a name or address from the specified string.

Parameters:
  • line – input string

  • x – x coordinate of cursor

Returns:

-1 if cannot extract. otherwise length of the name

ida_name.hide_name(ea: ida_idaapi.ea_t) None

Remove name from the list of names

Parameters:

ea – address of the name

ida_name.show_name(ea: ida_idaapi.ea_t) None

Insert name to the list of names.

ida_name.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.

Parameters:

name – any name in the program or nullptr

Returns:

address of the name or BADADDR

ida_name.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 address

Parameters:

to – the referenced address

Returns:

address of the name used to represent the operand

ida_name.get_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.

Parameters:

name – any name in the program or nullptr

Returns:

Name value result codes

ida_name.NT_NONE

name doesn’t exist or has no value

ida_name.NT_BYTE

name is byte name (regular name)

ida_name.NT_LOCAL

name is local label

ida_name.NT_STKVAR

name is stack variable name

ida_name.NT_ENUM

name is symbolic constant

ida_name.NT_ABS

name is absolute symbol (SEG_ABSSYM)

ida_name.NT_SEG

name is segment or segment register name

ida_name.NT_STROFF

name is structure member

ida_name.NT_BMASK

name is a bit group mask name

ida_name.NT_REGVAR

name is a renamed register (*value is idx into pfn->regvars)

ida_name.GN_VISIBLE

replace forbidden characters by SUBSTCHAR

ida_name.GN_COLORED

return colored name

ida_name.GN_DEMANGLED

return demangled name

ida_name.GN_STRICT

fail if cannot demangle

ida_name.GN_SHORT

use short form of demangled name

ida_name.GN_LONG

use long form of demangled name

ida_name.GN_LOCAL

try to get local name first; if failed, get global

ida_name.GN_ISRET

for dummy names: use retloc

ida_name.GN_NOT_ISRET

for dummy names: do not use retloc

ida_name.GN_NOT_DUMMY

do not return a dummy name

ida_name.get_visible_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) str
ida_name.get_short_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) str
ida_name.get_long_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) str
ida_name.get_colored_short_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) str
ida_name.get_colored_long_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) str
ida_name.get_demangled_name(ea: ida_idaapi.ea_t, inhibitor: int, demform: int, gtn_flags: int = 0) str
ida_name.get_colored_demangled_name(ea: ida_idaapi.ea_t, inhibitor: int, demform: int, gtn_flags: int = 0) str
ida_name.get_name_color(_from: ida_idaapi.ea_t, ea: ida_idaapi.ea_t) color_t

Calculate flags for get_ea_name() function.

Get name color.

Parameters:

ea – linear address

ida_name.GETN_APPZERO

meaningful only if the name refers to a structure. append a struct field name if the field offset is zero?

ida_name.GETN_NOFIXUP

ignore the fixup information when producing the name

ida_name.GETN_NODUMMY

do not create a new dummy name but pretend it exists

ida_name.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 <name> +/- <offset>). It also knows about structure members and arrays. If the specified address doesn’t have a name, a dummy name is generated.

Parameters:
  • n – number of referencing operand. for data items specify 0

  • ea – address to convert to name expression

  • off – the value of name expression. this parameter is used only to check that the name expression will have the wanted value. ‘off’ may be equal to BADADDR but this is discouraged because it prohibits checks.

  • flags – Name expression flags

Returns:

< 0 if address is not valid, no segment or other failure. otherwise the length of the name expression in characters.

ida_name.get_nice_colored_name(ea: ida_idaapi.ea_t, flags: int = 0) str

Get a nice colored name at the specified address. Ex: * segment:sub+offset * segment:sub:local_label * segment:label * segment:address * segment:address+offset

Parameters:
  • ea – linear address

  • flags – Nice colored name flags

Returns:

the length of the generated name in bytes.

ida_name.GNCN_NOSEG

ignore the segment prefix when producing the name

ida_name.GNCN_NOCOLOR

generate an uncolored name

ida_name.GNCN_NOLABEL

don’t generate labels

ida_name.GNCN_NOFUNC

don’t generate funcname+… expressions

ida_name.GNCN_SEG_FUNC

generate both segment and function names (default is to omit segment name if a function name is present)

ida_name.GNCN_SEGNUM

segment part is displayed as a hex number

ida_name.GNCN_REQFUNC

return 0 if the address does not belong to a function

ida_name.GNCN_REQNAME

return 0 if the address can only be represented as a hex number

ida_name.GNCN_NODBGNM

don’t use debug names

ida_name.GNCN_PREFDBG

if using debug names, prefer debug names over function names

ida_name.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.

Parameters:
  • disp – displacement from the name

  • n – operand number in which the name appears

  • path – path in the struct. path is an array of id’s. maximal length of array is MAXSTRUCPATH. the first element of the array is the structure id. consecutive elements are id’s of used union members (if any).

  • flags – the input flags. they will be returned if the struct cannot be found.

  • delta – delta to add to displacement

  • appzero – should append a struct field name if the displacement is zero?

Returns:

flags of the innermost struct member or the input flags

ida_name.is_public_name(ea: ida_idaapi.ea_t) bool
ida_name.make_name_public(ea: ida_idaapi.ea_t) None
ida_name.make_name_non_public(ea: ida_idaapi.ea_t) None
ida_name.is_weak_name(ea: ida_idaapi.ea_t) bool
ida_name.make_name_weak(ea: ida_idaapi.ea_t) None
ida_name.make_name_non_weak(ea: ida_idaapi.ea_t) None
ida_name.get_nlist_size() size_t
ida_name.get_nlist_idx(ea: ida_idaapi.ea_t) size_t
ida_name.is_in_nlist(ea: ida_idaapi.ea_t) bool
ida_name.get_nlist_ea(idx: size_t) ida_idaapi.ea_t
ida_name.get_nlist_name(idx: size_t) str
ida_name.rebuild_nlist() None
ida_name.reorder_dummy_names() None

Renumber dummy names.

ida_name.DEBNAME_EXACT

find a name at exactly the specified address

ida_name.DEBNAME_LOWER

find a name with the address >= the specified address

ida_name.DEBNAME_UPPER

find a name with the address > the specified address

ida_name.DEBNAME_NICE

find a name with the address <= the specified address

class ida_name.ea_name_t(*args)

Bases: object

thisown
ea: ida_idaapi.ea_t
name: str
ida_name.set_debug_name(ea: ida_idaapi.ea_t, name: str) bool
ida_name.get_debug_name(ea_ptr: ea_t *, how: debug_name_how_t) str
ida_name.del_debug_names(ea1: ida_idaapi.ea_t, ea2: ida_idaapi.ea_t) None
ida_name.get_debug_name_ea(name: str) ida_idaapi.ea_t
ida_name.DQT_NPURGED_8

only calculate number of purged bytes (sizeof(arg)==8)

ida_name.DQT_NPURGED_4

only calculate number of purged bytes (sizeof(arg)==4)

ida_name.DQT_NPURGED_2

only calculate number of purged bytes (sizeof(arg)==2)

ida_name.DQT_COMPILER

only detect compiler that generated the name

ida_name.DQT_NAME_TYPE

only detect the name type (data/code)

ida_name.DQT_FULL

really demangle

ida_name.demangle_name(name: str, disable_mask: int, demreq: demreq_type_t = DQT_FULL) str

Demangle a name.

Parameters:
  • name – name to demangle

  • disable_mask – bits to inhibit parts of demangled name (see MNG_). by the M_COMPILER bits a specific compiler can be selected (see MT_).

  • demreq – the request type demreq_type_t

Returns:

ME_… or MT__ bitmasks from demangle.hpp

ida_name.is_name_defined_locally(*args) bool

Is the name defined locally in the specified function?

Parameters:
  • pfn – pointer to function

  • name – name to check

  • ignore_name_def – which names to ignore when checking

  • ea1 – the starting address of the range inside the function (optional)

  • ea2 – the ending address of the range inside the function (optional)

Returns:

true if the name has been defined

ida_name.cleanup_name(ea: ida_idaapi.ea_t, name: str, flags: int = 0) str
ida_name.CN_KEEP_TRAILING_DIGITS

do not remove “_d+” at the end of name

ida_name.CN_KEEP_UNDERSCORES

do not remove leading underscores. but it is ok to remove __imp_.

ida_name.ME_INTERR
ida_name.ME_PARAMERR
ida_name.ME_ILLSTR
ida_name.ME_SMALLANS
ida_name.ME_FRAME
ida_name.ME_NOCOMP
ida_name.ME_ERRAUTO
ida_name.ME_NOHASHMEM
ida_name.ME_NOSTRMEM
ida_name.ME_NOERROR_LIMIT
ida_name.M_PRCMSK
ida_name.MT_DEFAULT
ida_name.MT_CDECL
ida_name.MT_PASCAL
ida_name.MT_STDCALL
ida_name.MT_FASTCALL
ida_name.MT_THISCALL
ida_name.MT_FORTRAN
ida_name.MT_SYSCALL
ida_name.MT_INTERRUPT
ida_name.MT_MSFASTCALL
ida_name.MT_CLRCALL
ida_name.MT_DMDCALL
ida_name.MT_VECTORCALL
ida_name.MT_REGCALL
ida_name.MT_LOCALNAME
ida_name.M_SAVEREGS
ida_name.M_CLASS
ida_name.MT_PUBLIC
ida_name.MT_PRIVATE
ida_name.MT_PROTECT
ida_name.MT_MEMBER
ida_name.MT_VTABLE
ida_name.MT_RTTI
ida_name.M_PARMSK
ida_name.MT_PARSHF
ida_name.MT_PARMAX
ida_name.M_ELLIPSIS
ida_name.MT_VOIDARG
ida_name.M_STATIC
ida_name.M_VIRTUAL
ida_name.M_AUTOCRT
ida_name.M_TYPMASK
ida_name.MT_OPERAT
ida_name.MT_CONSTR
ida_name.MT_DESTR
ida_name.MT_CASTING
ida_name.MT_CLRCDTOR
ida_name.M_TRUNCATE
ida_name.M_THUNK
ida_name.M_ANONNSP
ida_name.M_TMPLNAM
ida_name.M_DBGNAME
ida_name.M_COMPILER
ida_name.MT_MSCOMP
ida_name.MT_BORLAN
ida_name.MT_WATCOM
ida_name.MT_OTHER
ida_name.MT_GNU
ida_name.MT_GCC3
ida_name.MT_VISAGE
ida_name.MNG_PTRMSK
ida_name.MNG_DEFNEAR
ida_name.MNG_DEFNEARANY
ida_name.MNG_DEFFAR
ida_name.MNG_NOPTRTYP16
ida_name.MNG_DEFHUGE
ida_name.MNG_DEFPTR64
ida_name.MNG_DEFNONE
ida_name.MNG_NOPTRTYP
ida_name.MNG_NODEFINIT
ida_name.MNG_NOUNDERSCORE
ida_name.MNG_NOTYPE
ida_name.MNG_NORETTYPE
ida_name.MNG_NOBASEDT
ida_name.MNG_NOCALLC
ida_name.MNG_NOPOSTFC
ida_name.MNG_NOSCTYP
ida_name.MNG_NOTHROW
ida_name.MNG_NOSTVIR
ida_name.MNG_NOECSU
ida_name.MNG_NOCSVOL
ida_name.MNG_NOCLOSUR
ida_name.MNG_NOUNALG
ida_name.MNG_NOMANAGE
ida_name.MNG_NOMODULE
ida_name.MNG_SHORT_S
ida_name.MNG_SHORT_U
ida_name.MNG_ZPT_SPACE
ida_name.MNG_DROP_IMP
ida_name.MNG_IGN_ANYWAY
ida_name.MNG_IGN_JMP
ida_name.MNG_MOVE_JMP
ida_name.MNG_COMPILER_MSK
ida_name.MNG_SHORT_FORM
ida_name.MNG_LONG_FORM
ida_name.MNG_CALC_VALID
ida_name.get_mangled_name_type(name: str) mangled_name_type_t
ida_name.get_debug_names(*args) PyObject *
ida_name.get_ea_name(ea: ida_idaapi.ea_t, gtn_flags: int = 0) str

Get name at the specified address.

Parameters:
  • ea – linear address

  • gtn_flags – how exactly the name should be retrieved. combination of bits for get_ea_name() function. There is a convenience bits

Returns:

success

ida_name.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).

Parameters:
  • name – ptr to name. the name will be modified

  • type – the type of name we want to validate

  • flags – see SN_*

Returns:

success

class ida_name.NearestName(ea_names)

Bases: object

Utility class to help find the nearest name in a given ea/name dictionary

update(ea_names)

Updates the ea/names map

find(ea)

Returns a tupple (ea, name, pos) that is the nearest to the passed ea If no name is matched then None is returned

ida_name.calc_gtn_flags(fromaddr, ea)

Calculate flags for get_ea_name() function

Parameters:
  • fromaddr – the referring address. May be BADADDR.

  • ea – linear address

Returns:

flags

ida_name.cvar
ida_name.ignore_none
ida_name.ignore_regvar
ida_name.ignore_llabel
ida_name.ignore_stkvar
ida_name.ignore_glabel
ida_name.MANGLED_CODE
ida_name.MANGLED_DATA
ida_name.MANGLED_UNKNOWN