Skip to content

Names

names

Classes:

  • DemangleFlags

    Flags for demangling operations.

  • Names

    Provides access to symbol and label management in the IDA database.

  • SetNameFlags

    Flags for set_name() function.

DemangleFlags

Bases: IntFlag

Flags for demangling operations.

Attributes:

CALC_VALID class-attribute instance-attribute

CALC_VALID = MNG_CALC_VALID

COMPILER_MSK class-attribute instance-attribute

COMPILER_MSK = MNG_COMPILER_MSK

DEFFAR class-attribute instance-attribute

DEFFAR = MNG_DEFFAR

DEFHUGE class-attribute instance-attribute

DEFHUGE = MNG_DEFHUGE

DEFNEAR class-attribute instance-attribute

DEFNEAR = MNG_DEFNEAR

DEFNEARANY class-attribute instance-attribute

DEFNEARANY = MNG_DEFNEARANY

DEFNONE class-attribute instance-attribute

DEFNONE = MNG_DEFNONE

DEFPTR64 class-attribute instance-attribute

DEFPTR64 = MNG_DEFPTR64

DROP_IMP class-attribute instance-attribute

DROP_IMP = MNG_DROP_IMP

IGN_ANYWAY class-attribute instance-attribute

IGN_ANYWAY = MNG_IGN_ANYWAY

IGN_JMP class-attribute instance-attribute

IGN_JMP = MNG_IGN_JMP

LONG_FORM class-attribute instance-attribute

LONG_FORM = MNG_LONG_FORM

MOVE_JMP class-attribute instance-attribute

MOVE_JMP = MNG_MOVE_JMP

NOBASEDT class-attribute instance-attribute

NOBASEDT = MNG_NOBASEDT

NOCALLC class-attribute instance-attribute

NOCALLC = MNG_NOCALLC

NOCLOSUR class-attribute instance-attribute

NOCLOSUR = MNG_NOCLOSUR

NOCSVOL class-attribute instance-attribute

NOCSVOL = MNG_NOCSVOL

NODEFINIT class-attribute instance-attribute

NODEFINIT = MNG_NODEFINIT

NOECSU class-attribute instance-attribute

NOECSU = MNG_NOECSU

NOMANAGE class-attribute instance-attribute

NOMANAGE = MNG_NOMANAGE

NOMODULE class-attribute instance-attribute

NOMODULE = MNG_NOMODULE

NOPOSTFC class-attribute instance-attribute

NOPOSTFC = MNG_NOPOSTFC

NOPTRTYP class-attribute instance-attribute

NOPTRTYP = MNG_NOPTRTYP

NOPTRTYP16 class-attribute instance-attribute

NOPTRTYP16 = MNG_NOPTRTYP16

NORETTYPE class-attribute instance-attribute

NORETTYPE = MNG_NORETTYPE

NOSCTYP class-attribute instance-attribute

NOSCTYP = MNG_NOSCTYP

NOSTVIR class-attribute instance-attribute

NOSTVIR = MNG_NOSTVIR

NOTHROW class-attribute instance-attribute

NOTHROW = MNG_NOTHROW

NOTYPE class-attribute instance-attribute

NOTYPE = MNG_NOTYPE

NOUNALG class-attribute instance-attribute

NOUNALG = MNG_NOUNALG

NOUNDERSCORE class-attribute instance-attribute

NOUNDERSCORE = MNG_NOUNDERSCORE

PTRMSK class-attribute instance-attribute

PTRMSK = MNG_PTRMSK

SHORT_FORM class-attribute instance-attribute

SHORT_FORM = MNG_SHORT_FORM

SHORT_S class-attribute instance-attribute

SHORT_S = MNG_SHORT_S

SHORT_U class-attribute instance-attribute

SHORT_U = MNG_SHORT_U

ZPT_SPACE class-attribute instance-attribute

ZPT_SPACE = MNG_ZPT_SPACE

Names

Names(database: Database)

Bases: DatabaseEntity

Provides access to symbol and label management in the IDA database.

Can be used to iterate over all names in the opened database.

Parameters:

  • database (Database) –

    Reference to the active IDA database.

Methods:

Attributes:

database property

database: Database

Get the database reference, guaranteed to be non-None when called from methods decorated with @check_db_open.

Returns:

  • Database

    The active database instance.

Note

This property should only be used in methods decorated with @check_db_open, which ensures m_database is not None.

m_database instance-attribute

m_database = database

delete

delete(ea: ea_t) -> bool

Delete name at the specified address.

Parameters:

  • ea (ea_t) –

    Linear address.

Returns:

  • bool

    True if successful, False otherwise.

Raises:

  • InvalidEAError

    If the effective address is invalid.

demangle_name

demangle_name(
    name: str, disable_mask: Union[int, DemangleFlags] = 0
) -> str

Demangle a mangled name.

Parameters:

  • name (str) –

    Mangled name to demangle.

  • disable_mask (Union[int, DemangleFlags], default: 0 ) –

    Bits to inhibit parts of demangled name (DemangleFlags enum or raw int).

Returns:

  • str

    Demangled name or original name if demangling failed.

force_name

force_name(
    ea: ea_t,
    name: str,
    flags: Union[int, SetNameFlags] = NOCHECK,
) -> bool

Force set a name, trying variations if the name already exists.

Parameters:

  • ea (ea_t) –

    Linear address.

  • name (str) –

    New name.

  • flags (Union[int, SetNameFlags], default: NOCHECK ) –

    Set name flags (SetNameFlags enum or raw int).

Returns:

  • bool

    True if successful, False otherwise.

Raises:

  • InvalidEAError

    If the effective address is invalid.

get_all

get_all() -> Iterator[Tuple[ea_t, str]]

Returns an iterator over all named elements in the database.

Returns:

  • Iterator[Tuple[ea_t, str]]

    An iterator over (address, name) tuples.

get_at

get_at(ea: ea_t) -> Optional[str]

Retrieves the name at the specified address.

Parameters:

  • ea (ea_t) –

    The effective address.

Returns:

  • Optional[str]

    The name string if it exists, None otherwise.

Raises:

  • InvalidEAError

    If the effective address is invalid.

get_at_index

get_at_index(index: int) -> Tuple[ea_t, str] | None

Retrieves the named element at the specified index.

Parameters:

  • index (int) –

    Index of the named element to retrieve.

Returns:

  • Tuple[ea_t, str] | None

    A tuple (effective address, name) at the given index.

  • Tuple[ea_t, str] | None

    In case of error, returns None.

get_count

get_count() -> int

Retrieves the total number of named elements in the database.

Returns:

  • int

    The number of named elements.

get_demangled_name

get_demangled_name(
    ea: ea_t,
    inhibitor: Union[int, DemangleFlags] = 0,
    demform: int = 0,
) -> Optional[str]

Get demangled name at address.

Parameters:

  • ea (ea_t) –

    Linear address.

  • inhibitor (Union[int, DemangleFlags], default: 0 ) –

    Demangling inhibitor flags (DemangleFlags enum or raw int).

  • demform (int, default: 0 ) –

    Demangling form flags.

Returns:

  • Optional[str]

    Demangled name or None if not available.

Raises:

  • InvalidEAError

    If the effective address is invalid.

is_public_name

is_public_name(ea: ea_t) -> bool

Check if name at address is public.

Parameters:

  • ea (ea_t) –

    Linear address.

Returns:

  • bool

    True if public, False otherwise.

Raises:

  • InvalidEAError

    If the effective address is invalid.

is_valid_name

is_valid_name(name: str) -> bool

Check if a name is a valid user defined name.

Parameters:

  • name (str) –

    Name to validate.

Returns:

  • bool

    True if valid, False otherwise.

is_weak_name

is_weak_name(ea: ea_t) -> bool

Check if name at address is weak.

Parameters:

  • ea (ea_t) –

    Linear address.

Returns:

  • bool

    True if weak, False otherwise.

Raises:

  • InvalidEAError

    If the effective address is invalid.

make_name_non_public

make_name_non_public(ea: ea_t) -> None

Make name at address non-public.

Parameters:

  • ea (ea_t) –

    Linear address.

Raises:

  • InvalidEAError

    If the effective address is invalid.

make_name_non_weak

make_name_non_weak(ea: ea_t) -> None

Make name at address non-weak.

Parameters:

  • ea (ea_t) –

    Linear address.

Raises:

  • InvalidEAError

    If the effective address is invalid.

make_name_public

make_name_public(ea: ea_t) -> None

Make name at address public.

Parameters:

  • ea (ea_t) –

    Linear address.

Raises:

  • InvalidEAError

    If the effective address is invalid.

make_name_weak

make_name_weak(ea: ea_t) -> None

Make name at address weak.

Parameters:

  • ea (ea_t) –

    Linear address.

Raises:

  • InvalidEAError

    If the effective address is invalid.

set_name

set_name(
    ea: ea_t,
    name: str,
    flags: Union[int, SetNameFlags] = NOCHECK,
) -> bool

Set or delete name of an item at the specified address.

Parameters:

  • ea (ea_t) –

    Linear address.

  • name (str) –

    New name. Empty string to delete name.

  • flags (Union[int, SetNameFlags], default: NOCHECK ) –

    Set name flags (SetNameFlags enum or raw int).

Returns:

  • bool

    True if successful, False otherwise.

Raises:

  • InvalidEAError

    If the effective address is invalid.

SetNameFlags

Bases: IntFlag

Flags for set_name() function.

Attributes:

AUTO class-attribute instance-attribute

AUTO = SN_AUTO

CHECK class-attribute instance-attribute

CHECK = SN_CHECK

DELTAIL class-attribute instance-attribute

DELTAIL = SN_DELTAIL

FORCE class-attribute instance-attribute

FORCE = SN_FORCE

IDBENC class-attribute instance-attribute

IDBENC = SN_IDBENC

LOCAL class-attribute instance-attribute

LOCAL = SN_LOCAL

NOCHECK class-attribute instance-attribute

NOCHECK = SN_NOCHECK

NODUMMY class-attribute instance-attribute

NODUMMY = SN_NODUMMY

NOLIST class-attribute instance-attribute

NOLIST = SN_NOLIST

NON_AUTO class-attribute instance-attribute

NON_AUTO = SN_NON_AUTO

NON_PUBLIC class-attribute instance-attribute

NON_PUBLIC = SN_NON_PUBLIC

NON_WEAK class-attribute instance-attribute

NON_WEAK = SN_NON_WEAK

NOWARN class-attribute instance-attribute

NOWARN = SN_NOWARN

PUBLIC class-attribute instance-attribute

PUBLIC = SN_PUBLIC

WEAK class-attribute instance-attribute

WEAK = SN_WEAK