Skip to content

Heads

heads

Classes:

  • Heads

    Provides access to heads (instructions or data items) in the IDA database.

Heads

Heads(database: Database)

Bases: DatabaseEntity

Provides access to heads (instructions or data items) in the IDA database.

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

Args: database: Reference to the active IDA database.

Methods:

  • get_all

    Retrieves an iterator over all heads in the database.

  • get_between

    Retrieves all basic heads between two addresses.

  • get_next

    Retrieves the next head.

  • get_prev

    Retrieves the prev head.

Attributes:

database property

database: Database

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

Returns: 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

get_all

get_all() -> Iterator[ea_t]

Retrieves an iterator over all heads in the database.

Returns: An iterator over the heads.

get_between

get_between(start_ea: ea_t, end_ea: ea_t) -> Iterator[ea_t]

Retrieves all basic heads between two addresses.

Args: start_ea: Start address of the range. end_ea: End address of the range.

Returns: An iterator over the heads.

Raises: InvalidEAError: If the effective address is not in the database range.

get_next

get_next(ea: ea_t) -> ea_t | None

Retrieves the next head.

Args: ea: Current head address.

Returns: Next head, on error returns None.

Raises: InvalidEAError: If the effective address is not in the database range.

get_prev

get_prev(ea: ea_t) -> ea_t | None

Retrieves the prev head.

Args: ea: Current head address.

Returns: Prev head, on error returns None.

Raises: InvalidEAError: If the effective address is not in the database range.