Module index

# Module `ida_search`

Middle-level search functions.

They all are controlled by Search flags

## Global variables

`var SEARCH_BRK`

  return BADADDR if the search was cancelled.

`var SEARCH_CASE`

  case-sensitive search (case-insensitive otherwise)

`var SEARCH_DEF`

  find_reg_access: search for a definition (write access)

`var SEARCH_DOWN`

  search towards higher addresses

`var SEARCH_IDENT`

  search for an identifier (text search). it means that the characters before and after the match cannot be is_visible_char().

`var SEARCH_NEXT`

  skip the starting address when searching. this bit is useful only for search(), bin_search(), find_reg_access(). find_.. functions skip the starting address automatically.

`var SEARCH_NOBRK`

  do not test if the user clicked cancel to interrupt the search

`var SEARCH_NOSHOW`

  do not display the search progress/refresh screen

`var SEARCH_REGEX`

  regular expressions in search string (supported only for the text search)

`var SEARCH_UP`

  search towards lower addresses

`var SEARCH_USE`

  find_reg_access: search for a use (read access)

`var SEARCH_USESEL`

  query the UI for a possible current selection to limit the search to

## Functions

`def find_code(ea: ea_t, sflag: int)`

  find_code(ea, sflag) -> ea_t Find next code address.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_data(ea: ea_t, sflag: int)`

  find_data(ea, sflag) -> ea_t Find next data address.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_defined(ea: ea_t, sflag: int)`

  find_defined(ea, sflag) -> ea_t Find next ea that is the start of an instruction or data.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_error(ea: ea_t, sflag: int)`

  find_error(ea, sflag) -> ea_t Find next error or problem.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_imm(ea: ea_t, sflag: int, search_value: uval_t)`

  find_imm(ea, sflag, search_value) -> ea_t Find next immediate operand with the given value.

  @param ea: (C++: ea_t) @param sflag: (C++: int) @param search_value: (C++: uval_t)

`def find_not_func(ea: ea_t, sflag: int)`

  find_not_func(ea, sflag) -> ea_t Find next code address that does not belong to a function.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_notype(ea: ea_t, sflag: int)`

  find_notype(ea, sflag) -> ea_t Find next operand without any type info.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_reg_access(out: reg_access_t, start_ea: ea_t, end_ea: ea_t, regname: char const *, sflag: int)`

  find_reg_access(out, start_ea, end_ea, regname, sflag) -> ea_t Find access to a register.

  @param out: (C++: struct reg_access_t ) pointer to the output buffer. must be non-null. upon success contains info about the found register. upon failed search for a read access out->range contains the info about the non-redefined parts of the register. @param start_ea: (C++: ea_t) starting address @param end_ea: (C++: ea_t) ending address. BADADDR means that the end limit is missing. otherwise, if the search direction is SEARCH_UP, END_EA must be lower than START_EA. @param regname: (C++: const char ) the register to search for. @param sflag: (C++: int) combination of Search flags bits. @note: This function does not care about the control flow and probes all instructions in the specified range, starting from START_EA. Only direct references to registers are detected. Function calls and system traps are ignored. @return: the found address. BADADDR if not found or error.

`def find_suspop(ea: ea_t, sflag: int)`

  find_suspop(ea, sflag) -> ea_t Find next suspicious operand.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def find_text(start_ea: ea_t, y: int, x: int, ustr: char const *, sflag: int)`

  find_text(start_ea, y, x, ustr, sflag) -> ea_t See search()

  @param start_ea: (C++: ea_t) @param y: (C++: int) @param x: (C++: int) @param ustr: (C++: const char *) char const * @param sflag: (C++: int)

`def find_unknown(ea: ea_t, sflag: int)`

  find_unknown(ea, sflag) -> ea_t Find next unexplored address.

  @param ea: (C++: ea_t) @param sflag: (C++: int)

`def search_down(sflag: int) ‑> bool`

  search_down(sflag) -> bool Is the SEARCH_DOWN bit set?

  @param sflag: (C++: int)