Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon
entry.hpp File Reference

Functions that deal with entry points. More...

Macros

#define AEF_UTF8   0x0
 the name is given in UTF-8 (default)
 
#define AEF_IDBENC   0x1
 the name is given in the IDB encoding; non-ASCII bytes will be decoded accordingly. More...
 
#define AEF_NODUMMY   0x2
 automatically prepend the name with '_' if it begins with a dummy suffix. More...
 

Functions

idaman size_t ida_export get_entry_qty (void)
 Get number of entry points.
 
idaman bool ida_export add_entry (uval_t ord, ea_t ea, const char *name, bool makecode, int flags=AEF_UTF8)
 Add an entry point to the list of entry points. More...
 
idaman uval_t ida_export get_entry_ordinal (size_t idx)
 Get ordinal number of an entry point. More...
 
idaman ea_t ida_export get_entry (uval_t ord)
 Get entry point address by its ordinal. More...
 
idaman ssize_t ida_export get_entry_name (qstring *buf, uval_t ord)
 Get name of the entry point by its ordinal. More...
 
idaman bool ida_export rename_entry (uval_t ord, const char *name, int flags=AEF_UTF8)
 Rename entry point. More...
 
idaman bool ida_export set_entry_forwarder (uval_t ord, const char *name, int flags=AEF_UTF8)
 Set forwarder name for ordinal. More...
 
idaman ssize_t ida_export get_entry_forwarder (qstring *buf, uval_t ord)
 Get forwarder name for the entry point by its ordinal. More...
 

Detailed Description

Functions that deal with entry points.

Exported functions are considered as entry points as well.

IDA maintains list of entry points to the program. Each entry point:

  • has an address
  • has a name
  • may have an ordinal number

Function Documentation

◆ add_entry()

idaman bool ida_export add_entry ( uval_t  ord,
ea_t  ea,
const char *  name,
bool  makecode,
int  flags = AEF_UTF8 
)

Add an entry point to the list of entry points.

Parameters
ordordinal number if ordinal number is equal to 'ea' then ordinal is not used
ealinear address
namename of entry point. If the specified location already has a name, the old name will be appended to the regular comment. If name == nullptr, then the old name will be retained.
makecodeshould the kernel convert bytes at the entry point to instruction(s)
flagsSee AEF_*
Returns
success (currently always true)

◆ get_entry_ordinal()

idaman uval_t ida_export get_entry_ordinal ( size_t  idx)

Get ordinal number of an entry point.

Parameters
idxinternal number of entry point. Should be in the range 0..get_entry_qty()-1
Returns
ordinal number or 0.

◆ get_entry()

idaman ea_t ida_export get_entry ( uval_t  ord)

Get entry point address by its ordinal.

Parameters
ordordinal number of entry point
Returns
address or BADADDR

◆ get_entry_name()

idaman ssize_t ida_export get_entry_name ( qstring buf,
uval_t  ord 
)

Get name of the entry point by its ordinal.

Parameters
bufoutput buffer, may be nullptr
ordordinal number of entry point
Returns
size of entry name or -1

◆ rename_entry()

idaman bool ida_export rename_entry ( uval_t  ord,
const char *  name,
int  flags = AEF_UTF8 
)

Rename entry point.

Parameters
ordordinal number of the entry point
namename of entry point. If the specified location already has a name, the old name will be appended to a repeatable comment.
flagsSee AEF_*
Returns
success

◆ set_entry_forwarder()

idaman bool ida_export set_entry_forwarder ( uval_t  ord,
const char *  name,
int  flags = AEF_UTF8 
)

Set forwarder name for ordinal.

Parameters
ordordinal number of the entry point
nameforwarder name for entry point.
flagsSee AEF_*
Returns
success

◆ get_entry_forwarder()

idaman ssize_t ida_export get_entry_forwarder ( qstring buf,
uval_t  ord 
)

Get forwarder name for the entry point by its ordinal.

Parameters
bufoutput buffer, may be nullptr
ordordinal number of entry point
Returns
size of entry forwarder name or -1