ida_indexer

Indexer API: search functions, names, local types, segments and function comments.

The indexer maintains a data structure optimized for substring matching, allowing queries to be answered quickly regardless of database size. Substring matching is further accelerated using multiple threads.

Attributes

INVALID_SUBIDX_ID

Invalid / unset value.

SUBIDX_FUNCTIONS

Functions (mangled and demangled names).

SUBIDX_LTYPES

Local types defined in the IDB.

SUBIDX_NAMES

Names in the name list (both mangled and demangled).

SUBIDX_SEGMENTS

Segment names.

SUBIDX_FUNCTION_COMMENTS

Non-repeatable function comments.

SUBIDX_REPEATABLE_FUNCTION_COMMENTS

Repeatable function comments.

STR_MATCH

Substring match (default). Fast and exact.

FUZZY

Fuzzy match. Tolerates typos and abbreviations.

Classes

match_range_t

match_config_t

search_result_data_t

Functions

indexer_is_enabled(→ bool)

Returns true if the indexer is enabled for the current database. The indexer is controlled by the ENABLE_INDEXER configuration option and requires the database to have been opened with indexing support.

indexer_match_all(→ search_result_data_t *)

Search all sub-indexes for query using config.

indexer_match(→ search_result_data_t *)

Search a single sub-index identified by subindex_id for query.

Module Contents

ida_indexer.INVALID_SUBIDX_ID

Invalid / unset value.

ida_indexer.SUBIDX_FUNCTIONS

Functions (mangled and demangled names).

ida_indexer.SUBIDX_LTYPES

Local types defined in the IDB.

ida_indexer.SUBIDX_NAMES

Names in the name list (both mangled and demangled).

ida_indexer.SUBIDX_SEGMENTS

Segment names.

ida_indexer.SUBIDX_FUNCTION_COMMENTS

Non-repeatable function comments.

ida_indexer.SUBIDX_REPEATABLE_FUNCTION_COMMENTS

Repeatable function comments.

class ida_indexer.match_range_t

Bases: object

thisown
start: int

Index of the first matched character.

end: int

One past the last matched character.

ida_indexer.STR_MATCH

Substring match (default). Fast and exact.

ida_indexer.FUZZY

Fuzzy match. Tolerates typos and abbreviations.

class ida_indexer.match_config_t

Bases: object

thisown
cb: int

Size of this structure. Used for forward compatibility.

mode: match_mode_t

Matching algorithm to use.

score_cutoff: int

Minimum score, in percent (fuzzy mode only). Results below this threshold are discarded.

max_results: int

Maximum number of results to return.

class ida_indexer.search_result_data_t

Bases: object

thisown
size() int

Number of results.

get_name(index: int) std::string_view

Name of result at index.

get_score(index: int) int

Match score of result at index, in percent [0, 100].

get_ea(index: int) ida_idaapi.ea_t

Effective address of result at index, or BADADDR for local types.

get_netnode_idx(index: int) nodeidx_t

Netnode index of result at index.

get_ltype_ordinal(index: int) int

Local type ordinal of result at index, or 0 if not a local type.

get_ltype_type(index: int) type_t

BT_* type code of the local type at index (valid when get_ltype_ordinal() != 0).

get_subindex(index: int) subindex_typeid_t

Sub-index that produced result at index (e.g. SUBIDX_FUNCTIONS).

get_match_ranges_count(index: int) int

Number of matched character ranges for result at index.

get_match_range(index: int, range_idx: int) match_range_t

Returns the range_idx’th matched range for result at index.

get_match_line_range(index: int) match_range_t

For function-comment results, the range within get_name_str() that holds the matched comment line. Returns {0, 0} for all other result types.

empty() bool
ida_indexer.indexer_is_enabled() bool

Returns true if the indexer is enabled for the current database. The indexer is controlled by the ENABLE_INDEXER configuration option and requires the database to have been opened with indexing support.

ida_indexer.indexer_match_all(query: str, config: match_config_t) search_result_data_t *

Search all sub-indexes for query using config.

Returns:

a heap-allocated result set; the caller must delete it. Returns nullptr if the indexer is not enabled.

ida_indexer.indexer_match(subindex_id: subindex_typeid_t, query: str, config: match_config_t) search_result_data_t *

Search a single sub-index identified by subindex_id for query.

Returns:

a heap-allocated result set; the caller must delete it. Returns nullptr if the indexer is not enabled or subindex_id is invalid.