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
– -
COMPILER_MSK
– -
DEFFAR
– -
DEFHUGE
– -
DEFNEAR
– -
DEFNEARANY
– -
DEFNONE
– -
DEFPTR64
– -
DROP_IMP
– -
IGN_ANYWAY
– -
IGN_JMP
– -
LONG_FORM
– -
MOVE_JMP
– -
NOBASEDT
– -
NOCALLC
– -
NOCLOSUR
– -
NOCSVOL
– -
NODEFINIT
– -
NOECSU
– -
NOMANAGE
– -
NOMODULE
– -
NOPOSTFC
– -
NOPTRTYP
– -
NOPTRTYP16
– -
NORETTYPE
– -
NOSCTYP
– -
NOSTVIR
– -
NOTHROW
– -
NOTYPE
– -
NOUNALG
– -
NOUNDERSCORE
– -
PTRMSK
– -
SHORT_FORM
– -
SHORT_S
– -
SHORT_U
– -
ZPT_SPACE
–
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')
Provides access to symbol and label management in the IDA database.
Constructs a names handler for the given database.
Args: database: Reference to the active IDA database.
Methods:
-
delete
–Delete name at the specified address.
-
demangle_name
–Demangle a mangled name.
-
force_name
–Force set a name, trying variations if the name already exists.
-
get_all
–Returns an iterator over all named elements in the database.
-
get_at
–Retrieves the name at the specified address.
-
get_at_index
–Retrieves the named element at the specified index.
-
get_count
–Retrieves the total number of named elements in the database.
-
get_demangled_name
–Get demangled name at address.
-
is_public_name
–Check if name at address is public.
-
is_valid_name
–Check if a name is a valid user defined name.
-
is_weak_name
–Check if name at address is weak.
-
make_name_non_public
–Make name at address non-public.
-
make_name_non_weak
–Make name at address non-weak.
-
make_name_public
–Make name at address public.
-
make_name_weak
–Make name at address weak.
-
set_name
–Set or delete name of an item at the specified address.
Attributes:
m_database
instance-attribute
m_database = database
delete
delete(ea: ea_t) -> bool
Delete name at the specified address.
Args: ea: Linear address.
Returns: True if successful, False otherwise.
demangle_name
demangle_name(
name: str, disable_mask: Union[int, DemangleFlags] = 0
) -> str
Demangle a mangled name.
Args: name: Mangled name to demangle. disable_mask: Bits to inhibit parts of demangled name (DemangleFlags enum or raw int).
Returns: 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.
Args: ea: Linear address. name: New name. flags: Set name flags (SetNameFlags enum or raw int).
Returns: True if successful, False otherwise.
get_all
get_all() -> Iterator[Tuple[ea_t, str]]
Returns an iterator over all named elements in the database.
Returns: An iterator over (address, name) tuples.
get_at
get_at(ea: ea_t) -> str | None
Retrieves the name at the specified address.
Args: ea: The effective address.
Returns: The name string if it exists, None otherwise.
get_at_index
get_at_index(index: int) -> Tuple[ea_t, str] | None
Retrieves the named element at the specified index.
Args: index: Index of the named element to retrieve.
Returns: A tuple (effective address, name) at the given index. In case of error, returns None.
get_count
get_count() -> int
Retrieves the total number of named elements in the database.
Returns: The number of named elements.
get_demangled_name
get_demangled_name(
ea: ea_t,
inhibitor: Union[int, DemangleFlags] = 0,
demform: int = 0,
) -> str | None
Get demangled name at address.
Args: ea: Linear address. inhibitor: Demangling inhibitor flags (DemangleFlags enum or raw int). demform: Demangling form flags.
Returns: Demangled name or None if not available.
is_public_name
is_public_name(ea: ea_t) -> bool
Check if name at address is public.
Args: ea: Linear address.
Returns: True if public, False otherwise.
is_valid_name
is_valid_name(name: str) -> bool
Check if a name is a valid user defined name.
Args: name: Name to validate.
Returns: True if valid, False otherwise.
is_weak_name
is_weak_name(ea: ea_t) -> bool
Check if name at address is weak.
Args: ea: Linear address.
Returns: True if weak, False otherwise.
make_name_non_public
make_name_non_public(ea: ea_t) -> None
Make name at address non-public.
Args: ea: Linear address.
make_name_non_weak
make_name_non_weak(ea: ea_t) -> None
Make name at address non-weak.
Args: ea: Linear address.
make_name_public
make_name_public(ea: ea_t) -> None
Make name at address public.
Args: ea: Linear address.
make_name_weak
make_name_weak(ea: ea_t) -> None
Make name at address weak.
Args: ea: Linear address.
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.
Args: ea: Linear address. name: New name. Empty string to delete name. flags: Set name flags (SetNameFlags enum or raw int).
Returns: True if successful, False otherwise.
SetNameFlags
Bases: IntFlag
Flags for set_name() function.
Attributes:
-
AUTO
– -
CHECK
– -
DELTAIL
– -
FORCE
– -
IDBENC
– -
LOCAL
– -
NOCHECK
– -
NODUMMY
– -
NOLIST
– -
NON_AUTO
– -
NON_PUBLIC
– -
NON_WEAK
– -
NOWARN
– -
PUBLIC
– -
WEAK
–
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