IDA C++ SDK 9.2
Loading...
Searching...
No Matches
search.hpp File Reference

Middle-level search functions. More...

Go to the source code of this file.

Functions

THREAD_SAFE bool search_down (int sflag)
 Is the #SEARCH_DOWN bit set?
idaman int ida_export search (void *ud, place_t *start, const place_t *end, int *startx, const char *str, int sflag)
 Search for a text substring (low level function).
find_... functions
Parameters
eastart ea
sflagcombination of Search flags
[out]opnumfilled with operand number whenever relevant
Returns
first ea at which the search criteria is met
idaman ea_t ida_export find_error (ea_t ea, int sflag, int *opnum=nullptr)
 Find next error or problem.
idaman ea_t ida_export find_notype (ea_t ea, int sflag, int *opnum=nullptr)
 Find next operand without any type info.
idaman ea_t ida_export find_unknown (ea_t ea, int sflag)
 Find next unexplored address.
idaman ea_t ida_export find_defined (ea_t ea, int sflag)
 Find next ea that is the start of an instruction or data.
idaman ea_t ida_export find_suspop (ea_t ea, int sflag, int *opnum=nullptr)
 Find next suspicious operand.
idaman ea_t ida_export find_data (ea_t ea, int sflag)
 Find next data address.
idaman ea_t ida_export find_code (ea_t ea, int sflag)
 Find next code address.
idaman ea_t ida_export find_not_func (ea_t ea, int sflag)
 Find next code address that does not belong to a function.
idaman ea_t ida_export find_imm (ea_t ea, int sflag, uval_t search_value, int *opnum=nullptr)
 Find next immediate operand with the given value.
idaman ea_t ida_export find_text (ea_t start_ea, int y, int x, const char *ustr, int sflag)
 See search()
idaman ea_t ida_export find_reg_access (struct reg_access_t *out, ea_t start_ea, ea_t end_ea, const char *regname, int sflag)
 Find access to a register.

Detailed Description

Middle-level search functions.

They all are controlled by Search flags

Function Documentation

◆ search_down()

THREAD_SAFE bool search_down ( int sflag)
inline

Is the #SEARCH_DOWN bit set?

◆ find_error()

idaman ea_t ida_export find_error ( ea_t ea,
int sflag,
int * opnum = nullptr )

Find next error or problem.

◆ find_notype()

idaman ea_t ida_export find_notype ( ea_t ea,
int sflag,
int * opnum = nullptr )

Find next operand without any type info.

◆ find_unknown()

idaman ea_t ida_export find_unknown ( ea_t ea,
int sflag )

Find next unexplored address.

◆ find_defined()

idaman ea_t ida_export find_defined ( ea_t ea,
int sflag )

Find next ea that is the start of an instruction or data.

◆ find_suspop()

idaman ea_t ida_export find_suspop ( ea_t ea,
int sflag,
int * opnum = nullptr )

Find next suspicious operand.

◆ find_data()

idaman ea_t ida_export find_data ( ea_t ea,
int sflag )

Find next data address.

◆ find_code()

idaman ea_t ida_export find_code ( ea_t ea,
int sflag )

Find next code address.

◆ find_not_func()

idaman ea_t ida_export find_not_func ( ea_t ea,
int sflag )

Find next code address that does not belong to a function.

◆ find_imm()

idaman ea_t ida_export find_imm ( ea_t ea,
int sflag,
uval_t search_value,
int * opnum = nullptr )

Find next immediate operand with the given value.

◆ find_text()

idaman ea_t ida_export find_text ( ea_t start_ea,
int y,
int x,
const char * ustr,
int sflag )

See search()

◆ find_reg_access()

idaman ea_t ida_export find_reg_access ( struct reg_access_t * out,
ea_t start_ea,
ea_t end_ea,
const char * regname,
int sflag )

Find access to a register.

Parameters
outpointer 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.
start_eastarting address
end_eaending 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.
regnamethe register to search for.
sflagcombination 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.
Returns
the found address. BADADDR if not found or error.

◆ search()

idaman int ida_export search ( void * ud,
place_t * start,
const place_t * end,
int * startx,
const char * str,
int sflag )

Search for a text substring (low level function).

Parameters
udline array parameter
[in,out]startpointer to starting place:
  • start->ea: starting address
  • start->lnnum: starting Y coordinate
endpointer to ending place:
  • end->ea: ending address
  • end->lnnum: ending Y coordinate
[in,out]startxpointer to starting X coordinate
strsubstring to search for.
sflagSearch flags
Return values
0substring not found
1substring found. The matching position is returned in:
  • start->ea: address
  • start->lnnum: Y coordinate
  • *startx: X coordinate
2search was cancelled by ctrl-break. The farthest searched address is returned in the same manner as in the successful return (1).
3the input regular expression is bad. The error message was displayed.