IDA C++ SDK 9.2
|
Definitions of various information kept in netnodes. More...
Go to the source code of this file.
Classes | |
struct | xrefpos_t |
struct | array_parameters_t |
struct | switch_info_t |
Information about a switch statement. More... | |
struct | custom_data_type_ids_t |
struct | refinfo_t |
Information about a reference. More... | |
struct | custom_refinfo_handler_t |
Manage a custom refinfo type Custom refinfos are usually used to handle custom fixups, but can also be used to display non-standard references. More... | |
struct | refinfo_desc_t |
Get descriptions of all standard and custom refinfo types. More... | |
struct | strpath_t |
Information for structure offsets. More... | |
struct | enum_const_t |
See opinfo_t::ec. More... | |
union | opinfo_t |
Additional information about an operand type. More... | |
struct | printop_t |
Typedefs | |
typedef uchar | reftype_t |
see Types of references | |
typedef qvector< refinfo_desc_t > | refinfo_desc_vec_t |
typedef uchar | type_t |
In serialized form, a type is represented by a byte sequence. | |
typedef uchar | p_list |
several p_string's |
Functions | |
idaman nodeidx_t ida_export | ea2node (ea_t ea) |
Get netnode for the specified address. | |
idaman ea_t ida_export | node2ea (nodeidx_t ndx) |
idaman nodeidx_t ida_export | end_ea2node (ea_t ea) |
netnode | getnode (ea_t ea) |
idaman void ida_export | set_notcode (ea_t ea) |
Mark address so that it cannot be converted to instruction. | |
void | clr_notcode (ea_t ea) |
Clear not-code mark. | |
bool | is_notcode (ea_t ea) |
Is the address marked as not-code? | |
void | set_visible_item (ea_t ea, bool visible) |
Change visibility of item at given ea. | |
bool | is_visible_item (ea_t ea) |
Test visibility of item at given ea. | |
bool | is_finally_visible_item (ea_t ea) |
Is instruction visible? | |
bool | is_reftype_target_optional (reftype_t type) |
Can the target be calculated using operand value? | |
idaman reftype_t ida_export | get_reftype_by_size (size_t size) |
Get REF_... constant from size Supported sizes: 1,2,4,8,16 For other sizes returns reftype_t(-1) | |
idaman int ida_export | register_custom_refinfo (const custom_refinfo_handler_t *crh) |
Register a new custom refinfo type. | |
idaman bool ida_export | unregister_custom_refinfo (int crid) |
Unregister a new custom refinfo type. | |
idaman int ida_export | find_custom_refinfo (const char *name) |
Get id of a custom refinfo type. | |
idaman const custom_refinfo_handler_t *ida_export | get_custom_refinfo (int crid) |
Get definition of a registered custom refinfo type. | |
const custom_refinfo_handler_t *idaapi | get_custom_refinfo_handler (const refinfo_t &ri) |
Get refinfo handler. | |
DECLARE_TYPE_AS_MOVABLE (refinfo_desc_t) | |
idaman void ida_export | get_refinfo_descs (refinfo_desc_vec_t *descs) |
idaman ssize_t ida_export | get_root_filename (char *buf, size_t bufsize) |
Get file name only of the input file. | |
idaman ssize_t ida_export | dbg_get_input_path (char *buf, size_t bufsize) |
Get debugger input file name/path (see #LFLG_DBG_NOPATH) | |
ssize_t idaapi | get_input_file_path (char *buf, size_t bufsize) |
Get full path of the input file. | |
void | set_root_filename (const char *file) |
Set full path of the input file. | |
size_t idaapi | retrieve_input_file_size (void) |
Get size of input file in bytes. | |
uint32 idaapi | retrieve_input_file_crc32 (void) |
Get input file crc32 stored in the database. | |
bool idaapi | retrieve_input_file_md5 (uchar hash[16]) |
Get input file md5. | |
bool idaapi | retrieve_input_file_sha256 (uchar hash[32]) |
Get input file sha256. | |
ssize_t idaapi | get_asm_inc_file (qstring *buf) |
Get name of the include file. | |
bool idaapi | set_asm_inc_file (const char *file) |
Set name of the include file. | |
ea_t idaapi | get_imagebase (void) |
Get image base address. | |
void idaapi | set_imagebase (ea_t base) |
Set image base address. | |
netnode idaapi | get_ids_modnode (void) |
Get ids modnode. | |
void idaapi | set_ids_modnode (netnode id) |
Set ids modnode. | |
ssize_t idaapi | get_archive_path (qstring *out) |
Get archive file path from which input file was extracted. | |
bool | set_archive_path (const char *file) |
Set archive file path from which input file was extracted. | |
ssize_t idaapi | get_loader_format_name (qstring *out) |
Get file format name for loader modules. | |
void | set_loader_format_name (const char *name) |
Set file format name for loader modules. | |
ssize_t idaapi | get_initial_ida_version (qstring *out) |
Get version of ida which created the database (string format like "7.5") | |
ssize_t idaapi | get_ida_notepad_text (qstring *out) |
Get notepad text. | |
void idaapi | set_ida_notepad_text (const char *text, size_t size=0) |
Set notepad text. | |
ssize_t idaapi | get_srcdbg_paths (qstring *out) |
Get source debug paths. | |
void idaapi | set_srcdbg_paths (const char *paths) |
Set source debug paths. | |
ssize_t idaapi | get_srcdbg_undesired_paths (qstring *out) |
Get user-closed source files. | |
void idaapi | set_srcdbg_undesired_paths (const char *paths) |
Set user-closed source files. | |
ushort idaapi | get_initial_idb_version () |
Get initial version of the database (numeric format like 700) | |
time_t idaapi | get_idb_ctime () |
Get database creation timestamp. | |
size_t idaapi | get_elapsed_secs () |
Get seconds database stayed open. | |
size_t idaapi | get_idb_nopens () |
Get number of times the database is opened. | |
idaman int ida_export | validate_idb_names (bool do_repair) |
Check consistency of name records, return number of bad ones. | |
void | set_gotea (ea_t gotea) |
ea_t | get_gotea (void) |
Get structure ID | |
Returns the struct id of the struct type at the specified address. Use this function when is_struct()==true | |
idaman tid_t ida_export | get_strid (ea_t ea) |
xrefpos | |
idaman ssize_t ida_export | get_xrefpos (xrefpos_t *out, ea_t ea) |
idaman void ida_export | set_xrefpos (ea_t ea, const xrefpos_t *in) |
void idaapi | del_xrefpos (ea_t ea) |
Source line numbers | |
They are sometimes present in object files. | |
idaman void ida_export | set_source_linnum (ea_t ea, uval_t lnnum) |
idaman uval_t ida_export | get_source_linnum (ea_t ea) |
idaman void ida_export | del_source_linnum (ea_t ea) |
Absolute segment base address | |
These functions may be used if necessary (despite of the AFLNOTE above). | |
ea_t | get_absbase (ea_t ea) |
void | set_absbase (ea_t ea, ea_t x) |
void | del_absbase (ea_t ea) |
Purged bytes | |
Number of bytes purged from the stack when a function is called indirectly get_ind_purged() may be used if necessary (despite of the AFLNOTE above). Use set_purged() to modify this value (do not use set_ind_purged()) | |
idaman ea_t ida_export | get_ind_purged (ea_t ea) |
void | set_ind_purged (ea_t ea, ea_t x) |
void | del_ind_purged (ea_t ea) |
Get type of string | |
Use higher level function get_opinfo(). | |
idaman uint32 ida_export | get_str_type (ea_t ea) |
idaman void ida_export | set_str_type (ea_t ea, uint32 x) |
idaman void ida_export | del_str_type (ea_t ea) |
Work with string type codes | |
THREAD_SAFE uchar idaapi | get_str_type_code (int32 strtype) |
THREAD_SAFE char | get_str_term1 (int32 strtype) |
THREAD_SAFE char | get_str_term2 (int32 strtype) |
THREAD_SAFE uchar idaapi | get_str_encoding_idx (int32 strtype) |
Get index of the string encoding for this string. | |
THREAD_SAFE int32 | set_str_encoding_idx (int32 strtype, int encoding_idx) |
Set index of the string encoding in the string type. | |
THREAD_SAFE int32 | make_str_type (uchar type_code, int encoding_idx, uchar term1=0, uchar term2=0) |
Get string type for a string in the given encoding. | |
THREAD_SAFE bool | is_pascal (int32 strtype) |
THREAD_SAFE size_t | get_str_type_prefix_length (int32 strtype) |
Alignment value | |
(should be power of 2) These functions may be used if necessary (despite of the AFLNOTE above). | |
uint32 | get_alignment (ea_t ea) |
void | set_alignment (ea_t ea, uint32 x) |
void | del_alignment (ea_t ea) |
Instruction/Data background color | |
idaman void ida_export | set_item_color (ea_t ea, bgcolor_t color) |
idaman bgcolor_t ida_export | get_item_color (ea_t ea) |
idaman bool ida_export | del_item_color (ea_t ea) |
Array representation | |
idaman ssize_t ida_export | get_array_parameters (array_parameters_t *out, ea_t ea) |
idaman void ida_export | set_array_parameters (ea_t ea, const array_parameters_t *in) |
void idaapi | del_array_parameters (ea_t ea) |
Switch info | |
See switch_info_t, xref.hpp for related functions | |
idaman ssize_t ida_export | get_switch_info (switch_info_t *out, ea_t ea) |
idaman void ida_export | set_switch_info (ea_t ea, const switch_info_t &in) |
idaman void ida_export | del_switch_info (ea_t ea) |
Switch parent | |
Address which holds the switch info (switch_info_t). Used at the jump targets. | |
ea_t | get_switch_parent (ea_t ea) |
void | set_switch_parent (ea_t ea, ea_t x) |
void | del_switch_parent (ea_t ea) |
Custom data types | |
idaman int ida_export | get_custom_data_type_ids (custom_data_type_ids_t *cdis, ea_t ea) |
idaman void ida_export | set_custom_data_type_ids (ea_t ea, const custom_data_type_ids_t *cdis) |
void idaapi | del_custom_data_type_ids (ea_t ea) |
Get/Set refinfo | |
n may be 0, 1, 2, #OPND_MASK. #OPND_OUTER may be used too. Don't use these functions, see get_opinfo(), set_opinfo() | |
idaman bool ida_export | set_refinfo_ex (ea_t ea, int n, const refinfo_t *ri) |
idaman bool ida_export | set_refinfo (ea_t ea, int n, reftype_t type, ea_t target=BADADDR, ea_t base=0, adiff_t tdelta=0) |
idaman bool ida_export | get_refinfo (refinfo_t *ri, ea_t ea, int n) |
idaman bool ida_export | del_refinfo (ea_t ea, int n) |
Structure paths | |
Structure paths for unions and structures with unions (strpath) a structure path is an array of id's. the first id is the id of the structure itself. additional id's (if any) specify which member of a union we should select the maximal size of array is #MAXSTRUCPATH. strpaths are used to determine how to display structure offsets. | |
idaman void ida_export | write_struc_path (ea_t ea, int idx, const tid_t *path, int plen, adiff_t delta) |
idaman int ida_export | read_struc_path (tid_t *path, adiff_t *delta, ea_t ea, int idx) |
Types | |
Work with function/data types These functions may be used if necessary (despite of the AFLNOTE above). | |
idaman bool ida_export | get_tinfo (tinfo_t *tif, ea_t ea) |
idaman bool ida_export | set_tinfo (ea_t ea, const tinfo_t *tif) |
void idaapi | del_tinfo (ea_t ea) |
Operand types | |
These functions may be used if necessary (despite of the AFLNOTE above). | |
idaman bool ida_export | get_op_tinfo (tinfo_t *tif, ea_t ea, int n) |
idaman bool ida_export | set_op_tinfo (ea_t ea, int n, const tinfo_t *tif) |
void idaapi | del_op_tinfo (ea_t ea, int n) |
String encodings | |
Encoding names can be a codepage names (CP1251, windows-1251), charset name (Shift-JIS, UTF-8), or just codepage number (866, 932). user-accessible encodings are counted from 1 (index 0 is reserved) | |
idaman int ida_export | get_encoding_qty () |
Get total number of encodings (counted from 0) | |
idaman const char *ida_export | get_encoding_name (int idx) |
Get encoding name for specific index (1-based). | |
idaman int ida_export | add_encoding (const char *encname) |
Add a new encoding (e.g. | |
idaman bool ida_export | del_encoding (int idx) |
Delete an encoding The encoding is not actually removed because its index may be used in strtype. | |
idaman bool ida_export | rename_encoding (int idx, const char *encname) |
Change name for an encoding The number of bytes per unit (BPU) of the new encoding must match this number of the existing default encoding. | |
idaman int ida_export | get_encoding_bpu (int idx) |
Get the amount of bytes per unit (e.g., 2 for UTF-16, 4 for UTF-32) for the encoding with the given index. | |
idaman int ida_export | get_encoding_bpu_by_name (const char *encname) |
Get the amount of bytes per unit for the given encoding. | |
int | get_strtype_bpu (int32 strtype) |
idaman int ida_export | get_default_encoding_idx (int bpu) |
Get default encoding index for a specific string type. | |
idaman bool ida_export | set_default_encoding_idx (int bpu, int idx) |
Set default encoding for a string type. | |
const char *idaapi | encoding_from_strtype (int32 strtype) |
Get encoding name for this strtype. | |
idaman int ida_export | get_outfile_encoding_idx () |
Get the index of the encoding used when producing files. | |
idaman bool ida_export | set_outfile_encoding_idx (int idx) |
set encoding to be used when producing files |
Variables | |
const reftype_t | V695_REF_OFF8 = 0 |
reserved | |
const reftype_t | REF_OFF16 = 1 |
16bit full offset | |
const reftype_t | REF_OFF32 = 2 |
32bit full offset | |
const reftype_t | REF_LOW8 = 3 |
low 8bits of 16bit offset | |
const reftype_t | REF_LOW16 = 4 |
low 16bits of 32bit offset | |
const reftype_t | REF_HIGH8 = 5 |
high 8bits of 16bit offset | |
const reftype_t | REF_HIGH16 = 6 |
high 16bits of 32bit offset | |
const reftype_t | V695_REF_VHIGH = 7 |
obsolete | |
const reftype_t | V695_REF_VLOW = 8 |
obsolete | |
const reftype_t | REF_OFF64 = 9 |
64bit full offset | |
const reftype_t | REF_OFF8 = 10 |
8bit full offset | |
const reftype_t | REF_LAST = REF_OFF8 |
Functions to work with imports | |
typedef int idaapi | import_enum_cb_t(ea_t ea, const char *name, uval_t ord, void *param) |
Callback for enumerating imports. | |
idaman uint ida_export | get_import_module_qty () |
Get number of import modules. | |
idaman bool ida_export | get_import_module_name (qstring *buf, int mod_index) |
Get import module name. | |
idaman int ida_export | enum_import_names (int mod_index, import_enum_cb_t *callback, void *param=nullptr) |
Enumerate imports from specific module. | |
idaman void ida_export | delete_imports (void) |
Delete all imported modules information. |
Definitions of various information kept in netnodes.
Each address in the program has a corresponding netnode: netnode(ea).
If we have no information about an address, the corresponding netnode is not created. Otherwise we will create a netnode and save information in it. All variable length information (names, comments, offset information, etc) is stored in the netnode.
Don't forget that some information is already stored in the flags (bytes.hpp)
You can create your own nodes in IDP module and store information in them. See netnode.
typedef qvector<refinfo_desc_t> refinfo_desc_vec_t |
In serialized form, a type is represented by a byte sequence.
(see Type flags) We call it a type string.
Callback for enumerating imports.
ea | import address |
name | import name (nullptr if imported by ordinal) |
ord | import ordinal (0 for imports by name) |
param | user parameter passed to enum_import_names() |
1 | ok |
0 | stop enumeration |
Mark address so that it cannot be converted to instruction.
|
inline |
|
inline |
Get index of the string encoding for this string.
Set index of the string encoding in the string type.
|
inline |
Get string type for a string in the given encoding.
|
inline |
idaman ssize_t ida_export get_array_parameters | ( | array_parameters_t * | out, |
ea_t | ea ) |
idaman void ida_export set_array_parameters | ( | ea_t | ea, |
const array_parameters_t * | in ) |
idaman ssize_t ida_export get_switch_info | ( | switch_info_t * | out, |
ea_t | ea ) |
idaman void ida_export set_switch_info | ( | ea_t | ea, |
const switch_info_t & | in ) |
idaman int ida_export get_custom_data_type_ids | ( | custom_data_type_ids_t * | cdis, |
ea_t | ea ) |
idaman void ida_export set_custom_data_type_ids | ( | ea_t | ea, |
const custom_data_type_ids_t * | cdis ) |
Can the target be calculated using operand value?
idaman reftype_t ida_export get_reftype_by_size | ( | size_t | size | ) |
Get REF_... constant from size Supported sizes: 1,2,4,8,16 For other sizes returns reftype_t(-1)
idaman int ida_export register_custom_refinfo | ( | const custom_refinfo_handler_t * | crh | ) |
Register a new custom refinfo type.
idaman bool ida_export unregister_custom_refinfo | ( | int | crid | ) |
Unregister a new custom refinfo type.
idaman int ida_export find_custom_refinfo | ( | const char * | name | ) |
Get id of a custom refinfo type.
idaman const custom_refinfo_handler_t *ida_export get_custom_refinfo | ( | int | crid | ) |
Get definition of a registered custom refinfo type.
|
inline |
Get refinfo handler.
DECLARE_TYPE_AS_MOVABLE | ( | refinfo_desc_t | ) |
idaman void ida_export get_refinfo_descs | ( | refinfo_desc_vec_t * | descs | ) |
idaman bool ida_export set_refinfo | ( | ea_t | ea, |
int | n, | ||
reftype_t | type, | ||
ea_t | target = BADADDR, | ||
ea_t | base = 0, | ||
adiff_t | tdelta = 0 ) |
idaman void ida_export write_struc_path | ( | ea_t | ea, |
int | idx, | ||
const tid_t * | path, | ||
int | plen, | ||
adiff_t | delta ) |
idaman ssize_t ida_export get_root_filename | ( | char * | buf, |
size_t | bufsize ) |
Get file name only of the input file.
idaman ssize_t ida_export dbg_get_input_path | ( | char * | buf, |
size_t | bufsize ) |
Get debugger input file name/path (see #LFLG_DBG_NOPATH)
|
inline |
Get full path of the input file.
|
inline |
Set full path of the input file.
|
inline |
Get size of input file in bytes.
Get input file crc32 stored in the database.
it can be used to check that the input file has not been changed.
|
inline |
Set name of the include file.
Get archive file path from which input file was extracted.
|
inline |
Set archive file path from which input file was extracted.
Get file format name for loader modules.
|
inline |
Set file format name for loader modules.
Get version of ida which created the database (string format like "7.5")
|
inline |
Set notepad text.
|
inline |
Set source debug paths.
|
inline |
Set user-closed source files.
|
inline |
Get initial version of the database (numeric format like 700)
|
inline |
Get database creation timestamp.
|
inline |
Get seconds database stayed open.
|
inline |
Get number of times the database is opened.
idaman int ida_export get_encoding_qty | ( | ) |
Get total number of encodings (counted from 0)
idaman const char *ida_export get_encoding_name | ( | int | idx | ) |
Get encoding name for specific index (1-based).
idx | the encoding index (1-based) |
nullptr | if IDX is out of bounds |
empty | string if the encoding was deleted |
idaman int ida_export add_encoding | ( | const char * | encname | ) |
Add a new encoding (e.g.
"UTF-8"). If it's already in the list, return its index.
encname | the encoding name |
idaman bool ida_export del_encoding | ( | int | idx | ) |
Delete an encoding The encoding is not actually removed because its index may be used in strtype.
So the deletion just clears the encoding name. The default encoding cannot be deleted.
idx | the encoding index (1-based) |
idaman bool ida_export rename_encoding | ( | int | idx, |
const char * | encname ) |
Change name for an encoding The number of bytes per unit (BPU) of the new encoding must match this number of the existing default encoding.
Specifying the empty name simply deletes this encoding.
idx | the encoding index (1-based) |
encname | the new encoding name |
idaman int ida_export get_encoding_bpu | ( | int | idx | ) |
Get the amount of bytes per unit (e.g., 2 for UTF-16, 4 for UTF-32) for the encoding with the given index.
idx | the encoding index (1-based) |
idaman int ida_export get_encoding_bpu_by_name | ( | const char * | encname | ) |
Get the amount of bytes per unit for the given encoding.
encname | the encoding name |
|
inline |
idaman int ida_export get_default_encoding_idx | ( | int | bpu | ) |
Get default encoding index for a specific string type.
bpu | the amount of bytes per unit (e.g., 1 for ASCII, CP1252, UTF-8..., 2 for UTF-16, 4 for UTF-32) |
0 | bad BPU argument |
idaman bool ida_export set_default_encoding_idx | ( | int | bpu, |
int | idx ) |
Set default encoding for a string type.
bpu | the amount of bytes per unit |
idx | the encoding index. It cannot be 0 |
|
inline |
Get encoding name for this strtype.
nullptr | if STRTYPE has an incorrect encoding index |
empty | string if the encoding was deleted |
idaman int ida_export get_outfile_encoding_idx | ( | ) |
Get the index of the encoding used when producing files.
0 | the IDB's default 1 byte-per-unit encoding is used |
idaman bool ida_export set_outfile_encoding_idx | ( | int | idx | ) |
set encoding to be used when producing files
idx | the encoding index IDX can be 0 to use the IDB's default 1-byte-per-unit encoding |
idaman uint ida_export get_import_module_qty | ( | ) |
Get number of import modules.
Get import module name.
true | ok |
false | bad index |
idaman int ida_export enum_import_names | ( | int | mod_index, |
import_enum_cb_t * | callback, | ||
void * | param = nullptr ) |
Enumerate imports from specific module.
1 | finished ok |
-1 | error |
other | callback return value (<=0) |
idaman int ida_export validate_idb_names | ( | bool | do_repair | ) |
Check consistency of name records, return number of bad ones.