IDA C++ SDK 9.2
Loading...
Searching...
No Matches
ea-based function API

These functions use ea_t instead of func_t pointers, avoiding pointer-lifetime issues. More...

Topics

 Flags for get_func_entry_info()
 Specify which optional string fields to populate.

Classes

class  lock_func_ea
 RAII helper to lock a function by address. More...
class  lock_func
 Helper class to lock a function pointer so it stays valid. More...
class  lock_func_with_tails_t
class  func_tail_iterator_t
 Class to enumerate all function tails sorted by addresses. More...
class  func_item_iterator_t
 Class to enumerate all function instructions and data sorted by addresses. More...
class  func_parent_iterator_t
 Class to enumerate all function parents sorted by addresses. More...
class  fchunk_info_t
 Describes a function chunk (entry or tail). More...
class  func_entry_info_t
 Describes a function entry chunk. More...
class  func_tail_info_t
 Describes a function tail chunk. More...
class  function_tail_iterator_t
 Class to enumerate all function tails sorted by addresses. More...
class  function_parent_iterator_t
 Class to enumerate all function parents sorted by addresses. More...
class  function_item_iterator_t
 Class to enumerate all function instructions and data sorted by addresses. More...

Functions

 DECLARE_FUNC_ITERATORS (idaman) inline THREAD_SAFE bool idaapi f_any(flags64_t
 Helper function to accept any address.
idaman DEPRECATED void ida_export iterate_func_chunks (func_t *pfn, void(idaapi *func)(ea_t ea1, ea_t ea2, void *ud), void *ud=nullptr, bool include_parents=false)
 Function to iterate function chunks (all of them including the entry chunk)
idaman bool ida_export get_fchunk_info (fchunk_info_t *out, ea_t ea)
 Get the range of the function chunk (entry or tail) containing 'ea'.
idaman bool ida_export get_prev_fchunk_info (fchunk_info_t *out, ea_t ea)
 Get the previous function chunk before the one containing 'ea'.
idaman bool ida_export get_next_fchunk_info (fchunk_info_t *out, ea_t ea)
 Get the next function chunk after the one containing 'ea'.
idaman bool ida_export get_func_entry_info (func_entry_info_t *out, ea_t ea, int flags=0)
 Get function entry info by address.
idaman bool ida_export get_func_entry_info_by_num (func_entry_info_t *out, size_t n, int flags=0)
 Get function entry info by ordinal number.
idaman bool ida_export set_func_entry_info (const func_entry_info_t *fi)
 Update function entry info in the database.
idaman bool ida_export add_function_ex (func_entry_info_t *fi)
 Add a new function using func_entry_info_t.
bool add_func (ea_t ea1, ea_t ea2=BADADDR)
 Add a new function.
idaman int ida_export find_function_bounds (func_entry_info_t *fi, int flags)
 Determine the boundaries of a new function.
idaman ea_t ida_export calc_thunk_function_target (func_entry_info_t *fi, ea_t *fptr)
 Calculate thunk function target.
idaman bool ida_export get_func_tail_info (func_tail_info_t *out, ea_t ea)
 Get function tail info by address.
idaman size_t ida_export get_tail_referer_qty (ea_t tail_ea)
 Get the number of referers (parent functions) for a tail chunk.
idaman ea_t ida_export get_tail_referer (ea_t tail_ea, size_t n)
 Get a tail chunk referer by index.
idaman bool ida_export get_tail_referers (eavec_t *out, ea_t tail_ea)
 Get all referers (parent functions) for a tail chunk.

ea-based chunk manipulation

Manipulate function tail chunks using addresses instead of pointers.

typedef std::function< void(ea_t chunk_start, ea_t chunk_end)> func_chunk_visitor_t
 Callback type for iterate_func_chunks_ea().
idaman bool ida_export append_func_tail_ea (ea_t func_ea, ea_t ea1, ea_t ea2)
 Append a new tail chunk to the function at func_ea.
idaman bool ida_export remove_func_tail_ea (ea_t func_ea, ea_t tail_ea)
 Remove a function tail.
idaman bool ida_export set_tail_owner_ea (ea_t tail_ea, ea_t new_owner)
 Set a new owner of a function tail.
idaman int ida_export get_func_chunknum_ea (ea_t func_ea, ea_t ea)
 Get the containing chunk number.
idaman size_t ida_export get_func_tail_qty (ea_t func_ea)
 Get the number of function tail chunks.
idaman bool ida_export get_func_tails (rangevec_t *out, ea_t func_ea)
 Get all function tail ranges.
bool function_contains (ea_t func_ea, ea_t ea)
 Does the function at func_ea contain ea?
bool is_same_func (ea_t ea1, ea_t ea2)
 Do two addresses belong to the same function?
idaman bool ida_export is_same_fchunk (ea_t ea1, ea_t ea2)
 Do two addresses belong to the same function chunk?
DEPRECATED bool func_contains (func_t *pfn, ea_t ea)
 Does the given function contain the given address?
idaman void ida_export iterate_func_chunks_ea (ea_t fchunk_ea, const func_chunk_visitor_t &visitor, bool include_parents=false)
 Function to iterate function chunks (all of them including the entry chunk)
idaman ea_t ida_export get_prev_function_addr (ea_t func_ea, ea_t ea)
 Get previous address belonging to the function, respecting linear ordering.
idaman ea_t ida_export get_next_function_addr (ea_t func_ea, ea_t ea)
 Get next address belonging to the function, respecting linear ordering.

ea-based navigation

Get function/chunk addresses without using pointers.

idaman ea_t ida_export get_func_start (ea_t ea)
 Get start address of the function containing 'ea'.
idaman ea_t ida_export get_prev_func_ea (ea_t ea)
 Get start address of the previous function.
idaman ea_t ida_export get_next_func_ea (ea_t ea)
 Get start address of the next function.
idaman ea_t ida_export get_fchunk_start (ea_t ea)
 Get start address of the function chunk containing 'ea'.
idaman ea_t ida_export get_prev_fchunk_ea (ea_t ea)
 Get start address of the previous function chunk.
idaman ea_t ida_export get_next_fchunk_ea (ea_t ea)
 Get start address of the next function chunk.
idaman ea_t ida_export get_func_ea_by_num (size_t n)
 Get function start address by ordinal number.
idaman ea_t ida_export get_fchunk_ea_by_num (int n)
 Get function chunk start address by ordinal number.

ea-based property accessors

Read/write function properties by address.

idaman uint64 ida_export get_func_flags (ea_t ea)
 Get function chunk flags.
bool is_visible_func (ea_t ea)
 Is the function visible (not hidden)?
bool is_finally_visible_func (ea_t ea)
 Is the function visible (event after considering #SCF_SHHID_FUNC)?
DEPRECATED bool is_visible_func (func_t *pfn)
 Is the function visible (not hidden)?
DEPRECATED bool is_finally_visible_func (func_t *pfn)
 Is the function visible (event after considering #SCF_SHHID_FUNC)?
idaman bool ida_export set_func_flags (ea_t ea, uint64 flags)
 Set function chunk flags.
idaman bool ida_export set_func_flag (ea_t ea, uint64 flag, bool on_off=true)
 Set or clear a single function chunk flag.
idaman bool ida_export is_function_entry (ea_t ea)
 Is there a function entry chunk at 'ea'?
idaman bool ida_export is_function_tail (ea_t ea)
 Is there a function tail chunk at 'ea'?
idaman ea_t ida_export get_tail_owner (ea_t tail_ea)
 Get the owner function of a tail chunk.

ea-based wrappers

ea_t versions of functions that previously required func_t pointers.

idaman ssize_t ida_export get_func_cmt_ea (qstring *buf, ea_t ea, bool repeatable)
 Get function comment by address.
idaman bool ida_export set_func_cmt_ea (ea_t ea, const char *cmt, bool repeatable)
 Set function comment by address.
idaman int ida_export get_func_bitness_ea (ea_t ea)
 Get function bitness by address.
int idaapi get_func_bits_ea (ea_t ea)
 Get number of bits in the function addressing.
int idaapi get_func_bytes_ea (ea_t ea)
 Get number of bytes in the function addressing.
DEPRECATED int idaapi get_func_bits (const func_t *pfn)
 Get number of bits in the function addressing.
DEPRECATED int idaapi get_func_bytes (const func_t *pfn)
 Get number of bytes in the function addressing.
idaman asize_t ida_export calc_func_size_ea (ea_t ea)
 Calculate function size by address.
idaman ea_t ida_export get_func_ranges_ea (rangeset_t *ranges, ea_t ea)
 Get function ranges by address.
idaman void ida_export set_visible_func_ea (ea_t ea, bool visible)
 Set function visibility by address.
idaman bool ida_export set_function_name_if_jumpfunc (ea_t func_ea, const char *oldname)
 Give a meaningful name to function if it consists of only 'jump' instruction.
idaman void ida_export reanalyze_function_ea (ea_t func_ea, ea_t ea1=0, ea_t ea2=BADADDR, bool analyze_parents=false)
 Reanalyze function by address.
idaman void ida_export add_func_regarg (ea_t func_ea, int reg, const tinfo_t &tif, const char *name)
 Add a temporary register argument definition.
idaman size_t ida_export get_func_regarg_qty (ea_t func_ea)
 Get the number of register arguments for a function.
idaman bool ida_export get_func_regarg (regarg_t *out, ea_t func_ea, size_t n)
 Get a register argument by index.
idaman bool ida_export get_func_regargs (regargs_t *out, ea_t func_ea)
 Get all register arguments for a function.

ea-based locking

Lock function ranges by address to prevent invalidation.

idaman void ida_export lock_func_range_ea (ea_t ea, bool lock)
 Lock function range by address.
idaman bool ida_export is_func_locked_ea (ea_t ea)
 Is the function at ea locked?

Get prev/next address in function

Unlike func_item_iterator_t which always enumerates the main function chunk first, these functions respect linear address ordering.

idaman DEPRECATED ea_t ida_export get_prev_func_addr (func_t *pfn, ea_t ea)
idaman DEPRECATED ea_t ida_export get_next_func_addr (func_t *pfn, ea_t ea)

Detailed Description

These functions use ea_t instead of func_t pointers, avoiding pointer-lifetime issues.

The pointer can be invalidated by del_func(), add_func(), set_func_start/end(), undo operations, and recursive IDB event callbacks.

Typedef Documentation

◆ func_chunk_visitor_t

typedef std::function<void(ea_t chunk_start, ea_t chunk_end)> func_chunk_visitor_t

Callback type for iterate_func_chunks_ea().

Parameters
chunk_startstart address of the chunk
chunk_endend address of the chunk (exclusive)

Function Documentation

◆ get_func_start()

idaman ea_t ida_export get_func_start ( ea_t ea)

Get start address of the function containing 'ea'.

If ea is in a tail chunk, returns the owning function's start address.

Parameters
eaany address in a function
Returns
function start_ea, or BADADDR if no function at ea

◆ get_prev_func_ea()

idaman ea_t ida_export get_prev_func_ea ( ea_t ea)

Get start address of the previous function.

Parameters
eaany address in the program
Returns
previous function start_ea, or BADADDR if none

◆ get_next_func_ea()

idaman ea_t ida_export get_next_func_ea ( ea_t ea)

Get start address of the next function.

Parameters
eaany address in the program
Returns
next function start_ea, or BADADDR if none

◆ get_fchunk_start()

idaman ea_t ida_export get_fchunk_start ( ea_t ea)

Get start address of the function chunk containing 'ea'.

Unlike get_func_start(), does not follow tail owners.

Parameters
eaany address in a function chunk
Returns
chunk start_ea, or BADADDR if no chunk at ea

◆ get_prev_fchunk_ea()

idaman ea_t ida_export get_prev_fchunk_ea ( ea_t ea)

Get start address of the previous function chunk.

Parameters
eaany address in the program
Returns
previous chunk start_ea, or BADADDR if none

◆ get_next_fchunk_ea()

idaman ea_t ida_export get_next_fchunk_ea ( ea_t ea)

Get start address of the next function chunk.

Parameters
eaany address in the program
Returns
next chunk start_ea, or BADADDR if none

◆ get_func_ea_by_num()

idaman ea_t ida_export get_func_ea_by_num ( size_t n)

Get function start address by ordinal number.

Parameters
nnumber of function, is in range 0..get_func_qty()-1
Returns
function start_ea, or BADADDR if n is out of range

◆ get_fchunk_ea_by_num()

idaman ea_t ida_export get_fchunk_ea_by_num ( int n)

Get function chunk start address by ordinal number.

Parameters
nnumber of function chunk, is in range 0..get_fchunk_qty()-1
Returns
chunk start_ea, or BADADDR if n is out of range

◆ get_func_flags()

idaman uint64 ida_export get_func_flags ( ea_t ea)

Get function chunk flags.

Parameters
eaany address in a function chunk
Returns
flags, or 0 if no chunk at ea

◆ is_visible_func() [1/2]

bool is_visible_func ( ea_t ea)
inline

Is the function visible (not hidden)?

◆ is_finally_visible_func() [1/2]

bool is_finally_visible_func ( ea_t ea)
inline

Is the function visible (event after considering #SCF_SHHID_FUNC)?

◆ is_visible_func() [2/2]

DEPRECATED bool is_visible_func ( func_t * pfn)
inline

Is the function visible (not hidden)?

Deprecated

◆ is_finally_visible_func() [2/2]

DEPRECATED bool is_finally_visible_func ( func_t * pfn)
inline

Is the function visible (event after considering #SCF_SHHID_FUNC)?

Deprecated

◆ set_func_flags()

idaman bool ida_export set_func_flags ( ea_t ea,
uint64 flags )

Set function chunk flags.

Parameters
eastart address of the function chunk
flagsnew flags value
Returns
success

◆ set_func_flag()

idaman bool ida_export set_func_flag ( ea_t ea,
uint64 flag,
bool on_off = true )

Set or clear a single function chunk flag.

Parameters
eastart address of the function chunk
flagflag bit(s) to modify (e.g. #FUNC_NORET)
on_offtrue to set, false to clear
Returns
success

◆ is_function_entry()

idaman bool ida_export is_function_entry ( ea_t ea)

Is there a function entry chunk at 'ea'?

◆ is_function_tail()

idaman bool ida_export is_function_tail ( ea_t ea)

Is there a function tail chunk at 'ea'?

◆ get_tail_owner()

idaman ea_t ida_export get_tail_owner ( ea_t tail_ea)

Get the owner function of a tail chunk.

Parameters
tail_eaany address inside the tail chunk
Returns
owner function start_ea, or BADADDR if not a tail

◆ get_func_cmt_ea()

idaman ssize_t ida_export get_func_cmt_ea ( qstring * buf,
ea_t ea,
bool repeatable )

Get function comment by address.

Parameters
bufbuffer for the comment
eaany address in a function chunk
repeatableget repeatable comment?
Returns
size of comment or -1

◆ set_func_cmt_ea()

idaman bool ida_export set_func_cmt_ea ( ea_t ea,
const char * cmt,
bool repeatable )

Set function comment by address.

Parameters
eaany address in a function chunk
cmtcomment string, may be multiline (with '\n'). Use empty str ("") to delete comment
repeatableset repeatable comment?
Returns
success

◆ get_func_bitness_ea()

idaman int ida_export get_func_bitness_ea ( ea_t ea)

Get function bitness by address.

Parameters
eaany address in a function
Return values
016bit or if no function at ea
132bit
264bit

◆ get_func_bits_ea()

int idaapi get_func_bits_ea ( ea_t ea)
inline

Get number of bits in the function addressing.

◆ get_func_bytes_ea()

int idaapi get_func_bytes_ea ( ea_t ea)
inline

Get number of bytes in the function addressing.

◆ get_func_bits()

DEPRECATED int idaapi get_func_bits ( const func_t * pfn)
inline

Get number of bits in the function addressing.

Deprecated

◆ get_func_bytes()

DEPRECATED int idaapi get_func_bytes ( const func_t * pfn)
inline

Get number of bytes in the function addressing.

Deprecated

◆ calc_func_size_ea()

idaman asize_t ida_export calc_func_size_ea ( ea_t ea)

Calculate function size by address.

This function takes into account all fragments of the function.

Parameters
eaany address in a function
Returns
total function size, or 0 if no function at ea

◆ get_func_ranges_ea()

idaman ea_t ida_export get_func_ranges_ea ( rangeset_t * ranges,
ea_t ea )

Get function ranges by address.

Parameters
rangesbuffer to receive the range info
eaany address in a function
Returns
end address of the last function range (BADADDR-error)

◆ set_visible_func_ea()

idaman void ida_export set_visible_func_ea ( ea_t ea,
bool visible )

Set function visibility by address.

Parameters
eaany address in a function
visiblenew visibility state

◆ set_function_name_if_jumpfunc()

idaman bool ida_export set_function_name_if_jumpfunc ( ea_t func_ea,
const char * oldname )

Give a meaningful name to function if it consists of only 'jump' instruction.

Parameters
func_eastart address of the function (may be BADADDR)
oldnameold name of function. if old name was in "j_..." form, then we may discard it and set a new name. if oldname is not known, you may pass nullptr.
Returns
success

◆ reanalyze_function_ea()

idaman void ida_export reanalyze_function_ea ( ea_t func_ea,
ea_t ea1 = 0,
ea_t ea2 = BADADDR,
bool analyze_parents = false )

Reanalyze function by address.

This function plans to analyze all chunks of the given function. Optional parameters (ea1, ea2) may be used to narrow the analyzed range.

Parameters
func_eastart address of the function
ea1start of the range to analyze
ea2end of range to analyze
analyze_parentsmeaningful only if func_ea points to a function tail. if true, all tail parents will be reanalyzed. if false, only the given tail will be reanalyzed.

◆ add_func_regarg()

idaman void ida_export add_func_regarg ( ea_t func_ea,
int reg,
const tinfo_t & tif,
const char * name )

Add a temporary register argument definition.

Parameters
func_eastart address of the function
regregister number
tiftype of the register argument
namename of the register argument

◆ get_func_regarg_qty()

idaman size_t ida_export get_func_regarg_qty ( ea_t func_ea)

Get the number of register arguments for a function.

Register arguments are transient: they are destroyed when the full function type is determined. This function ensures they are loaded before returning.

Parameters
func_eafunction start address
Returns
number of register arguments, or 0

◆ get_func_regarg()

idaman bool ida_export get_func_regarg ( regarg_t * out,
ea_t func_ea,
size_t n )

Get a register argument by index.

Register arguments are transient: they are destroyed when the full function type is determined. This function ensures they are loaded before returning.

Parameters
outoutput regarg_t (caller owns memory, use free_regarg to clean up)
func_eafunction start address
n0-based index
Returns
success

◆ get_func_regargs()

idaman bool ida_export get_func_regargs ( regargs_t * out,
ea_t func_ea )

Get all register arguments for a function.

Register arguments are transient: they are destroyed when the full function type is determined. This function ensures they are loaded before returning.

Parameters
outoutput vector of regarg_t
func_eafunction start address
Returns
success

◆ append_func_tail_ea()

idaman bool ida_export append_func_tail_ea ( ea_t func_ea,
ea_t ea1,
ea_t ea2 )

Append a new tail chunk to the function at func_ea.

If the tail already exists, then it will simply be added to the function tail list. Otherwise a new tail will be created and its owner will be set to the function. If a new tail cannot be created, then this function will fail.

Parameters
func_eastart address of the function
ea1start of the tail
ea2end of the tail

◆ remove_func_tail_ea()

idaman bool ida_export remove_func_tail_ea ( ea_t func_ea,
ea_t tail_ea )

Remove a function tail.

If the tail belongs only to one function, it will be completely removed. Otherwise if the function was the tail owner, the first function using this tail becomes the owner of the tail.

Parameters
func_eastart address of the function
tail_eaany address inside the tail to remove

◆ set_tail_owner_ea()

idaman bool ida_export set_tail_owner_ea ( ea_t tail_ea,
ea_t new_owner )

Set a new owner of a function tail.

The new owner function must be already referring to the tail (after append_func_tail).

Parameters
tail_eaany address inside the tail
new_ownerthe entry point of the new owner function

◆ get_func_chunknum_ea()

idaman int ida_export get_func_chunknum_ea ( ea_t func_ea,
ea_t ea )

Get the containing chunk number.

Parameters
func_eastart address of the function
eaaddress to check
Return values
-1does not contain ea
0the entry chunk contains ea
>0the number of the containing function tail chunk

◆ get_func_tail_qty()

idaman size_t ida_export get_func_tail_qty ( ea_t func_ea)

Get the number of function tail chunks.

Parameters
func_eafunction start address
Returns
number of tail chunks, or 0

◆ get_func_tails()

idaman bool ida_export get_func_tails ( rangevec_t * out,
ea_t func_ea )

Get all function tail ranges.

Parameters
outoutput vector of ranges
func_eafunction start address
Returns
success

◆ function_contains()

bool function_contains ( ea_t func_ea,
ea_t ea )
inline

Does the function at func_ea contain ea?

◆ is_same_func()

bool is_same_func ( ea_t ea1,
ea_t ea2 )
inline

Do two addresses belong to the same function?

◆ is_same_fchunk()

idaman bool ida_export is_same_fchunk ( ea_t ea1,
ea_t ea2 )

Do two addresses belong to the same function chunk?

Parameters
ea1first address
ea2second address
Returns
true if both addresses are in the same chunk

◆ func_contains()

DEPRECATED bool func_contains ( func_t * pfn,
ea_t ea )
inline

Does the given function contain the given address?

Deprecated
Use function_contains() for safer access.

◆ iterate_func_chunks_ea()

idaman void ida_export iterate_func_chunks_ea ( ea_t fchunk_ea,
const func_chunk_visitor_t & visitor,
bool include_parents = false )

Function to iterate function chunks (all of them including the entry chunk)

Parameters
fchunk_eaaddress inside of the function chunk
visitorcallback to invoke for each chunk
include_parentsmeaningful only if FCHUNK_EA points to a function tail. if true, all tail parents will be iterated. if false, only the given tail will be iterated.

◆ get_prev_function_addr()

idaman ea_t ida_export get_prev_function_addr ( ea_t func_ea,
ea_t ea )

Get previous address belonging to the function, respecting linear ordering.

Unlike function_item_iterator_t which always enumerates the main function chunk first, this function respects linear address ordering.

Parameters
func_eaany address of the function
eacurrent address
Returns
previous address in the function, or BADADDR if none

◆ get_next_function_addr()

idaman ea_t ida_export get_next_function_addr ( ea_t func_ea,
ea_t ea )

Get next address belonging to the function, respecting linear ordering.

Unlike function_item_iterator_t which always enumerates the main function chunk first, this function respects linear address ordering.

Parameters
func_eaany address of the function
eacurrent address
Returns
next address in the function, or BADADDR if none

◆ lock_func_range_ea()

idaman void ida_export lock_func_range_ea ( ea_t ea,
bool lock )

Lock function range by address.

Locked ranges are guaranteed to remain valid until they are unlocked. Ranges with locked pointers cannot be deleted or moved.

Parameters
eaany address in a function chunk
locktrue to lock, false to unlock

◆ is_func_locked_ea()

idaman bool ida_export is_func_locked_ea ( ea_t ea)

Is the function at ea locked?

Parameters
eaany address in a function chunk

◆ DECLARE_FUNC_ITERATORS()

DECLARE_FUNC_ITERATORS ( idaman )

Helper function to accept any address.

◆ iterate_func_chunks()

idaman DEPRECATED void ida_export iterate_func_chunks ( func_t * pfn,
void(idaapi *func)(ea_t ea1, ea_t ea2, void *ud) ,
void * ud = nullptr,
bool include_parents = false )

Function to iterate function chunks (all of them including the entry chunk)

Parameters
pfnpointer to the function
funcfunction to call for each chunk
uduser data for 'func'
include_parentsmeaningful only if pfn points to a function tail. if true, all tail parents will be iterated. if false, only the given tail will be iterated.
Deprecated
Use iterate_func_chunks_ea() for safer access.

◆ get_prev_func_addr()

idaman DEPRECATED ea_t ida_export get_prev_func_addr ( func_t * pfn,
ea_t ea )
Deprecated
Use get_prev_function_addr() for safer access.

◆ get_next_func_addr()

idaman DEPRECATED ea_t ida_export get_next_func_addr ( func_t * pfn,
ea_t ea )
Deprecated
Use get_next_function_addr() for safer access.

◆ get_fchunk_info()

idaman bool ida_export get_fchunk_info ( fchunk_info_t * out,
ea_t ea )

Get the range of the function chunk (entry or tail) containing 'ea'.

Parameters
outpointer to output buffer, may be nullptr
eaany address in a function chunk
Returns
true if a chunk was found at ea

◆ get_prev_fchunk_info()

idaman bool ida_export get_prev_fchunk_info ( fchunk_info_t * out,
ea_t ea )

Get the previous function chunk before the one containing 'ea'.

Parameters
outpointer to output buffer, may be nullptr
eaany address in the program
Returns
true if a previous chunk was found

◆ get_next_fchunk_info()

idaman bool ida_export get_next_fchunk_info ( fchunk_info_t * out,
ea_t ea )

Get the next function chunk after the one containing 'ea'.

Parameters
outpointer to output buffer, may be nullptr
eaany address in the program
Returns
true if a next chunk was found

◆ get_func_entry_info()

idaman bool ida_export get_func_entry_info ( func_entry_info_t * out,
ea_t ea,
int flags = 0 )

Get function entry info by address.

Parameters
outpointer to output buffer, may be nullptr
eaany address in a function
flagscombination of Flags for get_func_entry_info() flags to control which optional string fields to populate
Returns
true if a function entry was found at the given address

◆ get_func_entry_info_by_num()

idaman bool ida_export get_func_entry_info_by_num ( func_entry_info_t * out,
size_t n,
int flags = 0 )

Get function entry info by ordinal number.

Parameters
outpointer to output buffer, may be nullptr
nnumber of function, is in range 0..get_func_qty()-1
flagscombination of Flags for get_func_entry_info() flags
Returns
true if a function with the given number exists

◆ set_func_entry_info()

idaman bool ida_export set_func_entry_info ( const func_entry_info_t * fi)

Update function entry info in the database.

You cannot use this function to change the range boundaries. Uses start_ea to identify the function, applies only modified fields.

Parameters
fientry info to update
Returns
success

◆ add_function_ex()

idaman bool ida_export add_function_ex ( func_entry_info_t * fi)

Add a new function using func_entry_info_t.

If fi->end_ea is #BADADDR, then IDA will try to determine the function bounds by calling find_func_bounds(..., #FIND_FUNC_DEFINE). Uses fi->start_ea, fi->end_ea, and fi->get_flags(). On success, fi is updated with the resulting function properties.

Parameters
fientry info describing the function to create
Returns
success

◆ add_func()

bool add_func ( ea_t ea1,
ea_t ea2 = BADADDR )
inline

Add a new function.

If the function end address is #BADADDR, then IDA will try to determine the function bounds by calling find_func_bounds(..., #FIND_FUNC_DEFINE).

Parameters
ea1start address
ea2end address
Returns
success

◆ find_function_bounds()

idaman int ida_export find_function_bounds ( func_entry_info_t * fi,
int flags )

Determine the boundaries of a new function.

This function tries to find the start and end addresses of a new function. It calls the module with processor_t::func_bounds in order to fine tune the function boundaries.

Parameters
fientry info to fill with information. \ fi->start_ea points to the start address of the new function.
flagsFind function bounds flags
Returns
Find function bounds result codes. On success, fi is updated with the resulting function properties.

◆ calc_thunk_function_target()

idaman ea_t ida_export calc_thunk_function_target ( func_entry_info_t * fi,
ea_t * fptr )

Calculate thunk function target.

Parameters
fifunction entry info
fptrout: will hold address of a function pointer (if indirect jump)
Returns
the target function or BADADDR

◆ get_func_tail_info()

idaman bool ida_export get_func_tail_info ( func_tail_info_t * out,
ea_t ea )

Get function tail info by address.

Parameters
outpointer to output buffer, may be nullptr
eaany address in a function tail chunk
Returns
true if a tail chunk was found at the given address

◆ get_tail_referer_qty()

idaman size_t ida_export get_tail_referer_qty ( ea_t tail_ea)

Get the number of referers (parent functions) for a tail chunk.

Parameters
tail_eaany address in a function tail chunk
Returns
number of referers, or 0

◆ get_tail_referer()

idaman ea_t ida_export get_tail_referer ( ea_t tail_ea,
size_t n )

Get a tail chunk referer by index.

Parameters
tail_eaany address in a function tail chunk
n0-based index
Returns
referer (function start address), or BADADDR

◆ get_tail_referers()

idaman bool ida_export get_tail_referers ( eavec_t * out,
ea_t tail_ea )

Get all referers (parent functions) for a tail chunk.

Parameters
outoutput vector of ea_t (function start addresses)
tail_eaany address in a function tail chunk
Returns
success