Classes | Functions | Macros | Typedefs | Enumerations | Variables
typeinf.hpp File Reference

Detailed Description

Describes the type information records in IDA.

The recommended way of using type info is to use the tinfo_t class. The type information is internally kept as an array of bytes terminated by 0.

Items in brackets [] are optional and sometimes are omitted. type_t... means a sequence of type_t bytes which defines a type.

to work with the types of instructions or data in the database, use get_tinfo()/set_tinfo() and similar functions.


struct  type_attr_t
 Extended type attributes. More...
struct  til_t
 Type Information Library. More...
struct  rrel_t
 Register-relative argument location. More...
struct  custloc_desc_t
 Description of a custom argloc. More...
class  argloc_t
 Describes an argument location. More...
struct  argpart_t
 Subsection of an argument location. More...
class  scattered_aloc_t
 Used to manage arguments that are described by multiple locations (also see ALOC_DIST) More...
struct  aloc_visitor_t
 Visit all argument locations. More...
struct  const_aloc_visitor_t
 Same as aloc_visitor_t, but may not modify the argloc. More...
class  callregs_t
 Register allocation calling convention. More...
class  tinfo_t
 Primary mechanism for managing type information. More...
struct  simd_info_t
 SIMD type info. More...
struct  ptr_type_data_t
 Pointer type information (see tinfo_t::get_ptr_details()) More...
struct  array_type_data_t
 Array type information (see tinfo_t::get_array_details()) More...
struct  funcarg_t
 Information about a single function argument. More...
struct  func_type_data_t
 Function type information (see tinfo_t::get_func_details()) More...
struct  enum_member_t
 Describes an enum value. More...
struct  enum_type_data_t
 Enum type information (see tinfo_t::get_enum_details()) More...
struct  typedef_type_data_t
 Type information for typedefs. More...
struct  udt_member_t
 An object to represent struct or union members. More...
struct  udt_type_data_t
 An object to represent struct or union types (see tinfo_t::get_udt_details()) More...
struct  bitfield_type_data_t
 Bitfield type information (see tinfo_t::get_bitfield_details()) More...
struct  type_mods_t
 Information about how to modify the current type, used by tinfo_visitor_t. More...
struct  tinfo_visitor_t
 Visit all subtypes of a type. Derive your visitor from this class and use apply_to() More...
struct  regobj_t
 Object that represents a register. More...
struct  regobjs_t
 Collection of register objects. More...
class  lowertype_helper_t
 Interface class - see ida_lowertype_helper_t. More...
class  ida_lowertype_helper_t
 An implementation of lowertype_helper_t that has access to the IDB, and thus can help spot holes in the stack arguments. More...
struct  format_data_info_t
 See format_cdata() More...
struct  valinfo_t
 Additional information about the output lines. More...
class  valstr_t
 Text representation of a data value (value string). More...
struct  valstrs_t
 Collection of value strings. More...
struct  text_sink_t
 Flush formatted text. More...
struct  til_symbol_t
 A symbol in a type library. More...
struct  predicate_t
 Helper class for choose_named_type(). More...


bool is_type_const (type_t t)
bool is_type_volatile (type_t t)
type_t get_base_type (type_t t)
 Get get basic type bits (TYPE_BASE_MASK)
type_t get_type_flags (type_t t)
 Get type flags (TYPE_FLAGS_MASK)
type_t get_full_type (type_t t)
 Get basic type bits + type flags (TYPE_FULL_MASK)
bool is_typeid_last (type_t t)
 Is the type_t the last byte of type declaration? (there are no additional bytes after a basic type, see _BT_LAST_BASIC)
bool is_type_partial (type_t t)
 Identifies an unknown or void type with a known size (see Basic type: unknown & void)
bool is_type_void (type_t t)
bool is_type_unknown (type_t t)
bool is_type_ptr (type_t t)
 See BT_PTR.
bool is_type_complex (type_t t)
bool is_type_func (type_t t)
bool is_type_array (type_t t)
bool is_type_typedef (type_t t)
bool is_type_sue (type_t t)
 Is the type a struct/union/enum?
bool is_type_struct (type_t t)
bool is_type_union (type_t t)
bool is_type_struni (type_t t)
 Is the type a struct or union?
bool is_type_enum (type_t t)
bool is_type_bitfld (type_t t)
bool is_type_int (type_t bt)
 Does the type_t specify one of the basic types in Basic type: integer?
bool is_type_int128 (type_t t)
 Does the type specify a 128-bit value? (signed or unsigned, see Basic type: integer)
bool is_type_int64 (type_t t)
 Does the type specify a 64-bit value? (signed or unsigned, see Basic type: integer)
bool is_type_int32 (type_t t)
 Does the type specify a 32-bit value? (signed or unsigned, see Basic type: integer)
bool is_type_int16 (type_t t)
 Does the type specify a 16-bit value? (signed or unsigned, see Basic type: integer)
bool is_type_char (type_t t)
 Does the type specify a char value? (signed or unsigned, see Basic type: integer)
bool is_type_paf (type_t t)
 Is the type a pointer, array, or function type?
bool is_type_ptr_or_array (type_t t)
 Is the type a pointer or array type?
bool is_type_floating (type_t t)
 Is the type a floating point type?
bool is_type_integral (type_t t)
 Is the type an integral type (char/short/int/long/bool)?
bool is_type_ext_integral (type_t t)
 Is the type an extended integral type? (integral or enum)
bool is_type_arithmetic (type_t t)
 Is the type an arithmetic type? (floating or integral)
bool is_type_ext_arithmetic (type_t t)
 Is the type an extended arithmetic type? (arithmetic or enum)
bool is_type_uint (type_t t)
bool is_type_uchar (type_t t)
bool is_type_uint16 (type_t t)
 See BTF_UINT16.
bool is_type_uint32 (type_t t)
 See BTF_UINT32.
bool is_type_uint64 (type_t t)
 See BTF_UINT64.
bool is_type_uint128 (type_t t)
 See BTF_UINT128.
bool is_type_ldouble (type_t t)
bool is_type_double (type_t t)
bool is_type_float (type_t t)
bool is_type_bool (type_t t)
bool is_tah_byte (type_t t)
 The TAH byte (type attribute header byte) denotes the start of type attributes. More...
bool is_sdacl_byte (type_t t)
 Identify an sdacl byte. More...
bool operator< (const bytevec_t &v1, const bytevec_t &v2)
 Compare two bytevecs with '<'. More...
idaman bool ida_export append_argloc (qtype *out, const argloc_t &vloc)
 Serialize argument location.
idaman bool ida_export extract_argloc (argloc_t *vloc, const type_t **ptype, bool is_retval)
 Deserialize argument location.
idaman const type_t *ida_export resolve_typedef (const til_t *til, const type_t *type)
bool is_restype_void (const til_t *til, const type_t *type)
bool is_restype_enum (const til_t *til, const type_t *type)
bool is_restype_struni (const til_t *til, const type_t *type)
bool is_restype_struct (const til_t *til, const type_t *type)
idaman type_t ida_export get_scalar_bt (int size)
idaman til_t *ida_export new_til (const char *name, const char *desc)
 Initialize a til.
int add_base_tils (til_t *ti, const char *tildir, const char *bases, qstring *errbuf)
 Add multiple base tils. More...
idaman til_t *ida_export load_til (const char *name, qstring *errbuf, const char *tildir=NULL)
 Load til from a file. More...
idaman bool ida_export sort_til (til_t *ti)
 Sort til (use after modifying it). More...
idaman bool ida_export compact_til (til_t *ti)
 Collect garbage in til. More...
idaman bool ida_export store_til (til_t *ti, const char *tildir, const char *name)
 Store til to a file. More...
idaman void ida_export free_til (til_t *ti)
 Free memory allocated by til.
idaman til_t *ida_export load_til_header (const char *tildir, const char *name, qstring *errbuf)
 Get human-readable til description.
bool is_code_far (cm_t cm)
 Does the given model specify far code?.
bool is_data_far (cm_t cm)
 Does the given model specify far data?.
idaman int ida_export install_custom_argloc (const custloc_desc_t *custloc)
 Save a custom argloc.
idaman bool ida_export remove_custom_argloc (int idx)
 Delete the custom argloc at the given index.
idaman const custloc_desc_t *ida_export retrieve_custom_argloc (int idx)
 Retrieve the custom argloc at the given index.
idaman int ida_export verify_argloc (const argloc_t &vloc, int size, const rangeset_t *gaps)
 Verify argloc_t. More...
idaman bool ida_export optimize_argloc (argloc_t *vloc, int size, const rangeset_t *gaps)
 Verify and optimize scattered argloc into simple form. More...
idaman size_t ida_export print_argloc (char *buf, size_t bufsize, const argloc_t &vloc, int size=0, int vflags=0)
 Convert an argloc to human readable form.
idaman int ida_export for_all_arglocs (aloc_visitor_t &vv, argloc_t &vloc, int size, int off=0)
 Compress larger argloc types and initiate the aloc visitor.
int idaapi for_all_const_arglocs (const_aloc_visitor_t &vv, const argloc_t &vloc, int size, int off=0)
 See for_all_arglocs()
cm_t get_cc (cm_t cm)
 Get the calling convention.
bool is_user_cc (cm_t cm)
 Does the calling convention specify argument locations explicitly?
bool is_vararg_cc (cm_t cm)
 Does the calling convention use ellipsis?
bool is_purging_cc (cm_t cm)
 Does the calling convention clean the stack arguments upon return?. More...
comp_t get_comp (comp_t comp)
 Get compiler bits.
idaman const char *ida_export get_compiler_name (comp_t id)
 Get full compiler name.
idaman const char *ida_export get_compiler_abbr (comp_t id)
 Get abbreviated compiler name.
idaman void ida_export get_compilers (compvec_t *ids, qstrvec_t *names, qstrvec_t *abbrs)
 Get names of all built-in compilers.
comp_t is_comp_unsure (comp_t comp)
comp_t default_compiler (void)
 Get compiler specified by
bool is_gcc (void)
 Is the target compiler COMP_GNU?
bool is_gcc32 (void)
 Is the target compiler 32 bit gcc?
bool is_gcc64 (void)
 Is the target compiler 64 bit gcc?
bool gcc_layout (void)
 Should use the struct/union layout as done by gcc?
idaman bool ida_export set_compiler (const compiler_info_t &cc, int flags, const char *abiname=NULL)
 Change current compiler. More...
bool idaapi set_compiler_id (comp_t id, const char *abiname=NULL)
 Set the compiler id (see Compiler IDs)
bool idaapi set_abi_name (const char *abiname, bool user_level=false)
 Set abi name (see Compiler IDs)
idaman bool ida_export append_abi_opts (const char *abi_opts, bool user_level=false)
 Add/remove/check ABI option General form of full abi name: abiname-opt1-opt2-... More...
idaman bool ida_export remove_abi_opts (const char *abi_opts, bool user_level=false)
idaman bool ida_export set_compiler_string (const char *compstr, bool user_level)
idaman int ida_export h2ti (til_t *ti, lexer_t *lx, const char *input, int flags=HTI_HIGH, h2ti_type_cb *type_cb=NULL, h2ti_type_cb *var_cb=NULL, printer_t *print_cb=NULL, void *_cb_data=NULL, abs_t _isabs=abs_unk)
 Convert declarations to type_t*. More...
idaman bool ida_export parse_decl (tinfo_t *tif, qstring *out, til_t *til, const char *decl, int flags)
 Parse ONE declaration. More...
int convert_pt_flags_to_hti (int pt_flags)
 Convert Type parsing flags to Type formatting flags. More...
idaman int ida_export parse_decls (til_t *til, const char *input, printer_t *printer, int hti_flags)
 Parse many declarations and store them in a til. More...
idaman bool ida_export print_type (qstring *out, ea_t ea, int prtype_flags)
 Get type declaration for the specified address. More...
idaman int ida_export get_named_type (const til_t *ti, const char *name, int ntf_flags, const type_t **type=NULL, const p_list **fields=NULL, const char **cmt=NULL, const p_list **fieldcmts=NULL, sclass_t *sclass=NULL, uint32 *value=NULL)
 Get named typeinfo. More...
int idaapi get_named_type64 (const til_t *ti, const char *name, int ntf_flags, const type_t **type=NULL, const p_list **fields=NULL, const char **cmt=NULL, const p_list **fieldcmts=NULL, sclass_t *sclass=NULL, uint64 *value=NULL)
 See get_named_type() above. More...
idaman bool ida_export del_named_type (til_t *ti, const char *name, int ntf_flags)
 Delete information about a symbol. More...
idaman const char *ida_export first_named_type (const til_t *ti, int ntf_flags)
 Enumerate types. More...
idaman const char *ida_export next_named_type (const til_t *ti, const char *name, int ntf_flags)
 Enumerate types. More...
idaman bool ida_export decorate_name (qstring *out, const char *name, bool mangle, cm_t cc=CM_CC_UNKNOWN, const tinfo_t *type=NULL)
 Decorate/undecorate a C symbol name. More...
idaman bool ida_export gen_decorate_name (qstring *out, const char *name, bool mangle, cm_t cc, const tinfo_t *type)
 Generic function for decorate_name() (may be used in IDP modules)
idaman ssize_t ida_export calc_c_cpp_name (qstring *out, const char *name, const tinfo_t *type, int ccn_flags)
 Get C or C++ form of the name. More...
idaman bool ida_export enable_numbered_types (til_t *ti, bool enable)
 Enable the use of numbered types in til. More...
idaman bool ida_export get_numbered_type (const til_t *ti, uint32 ordinal, const type_t **type=NULL, const p_list **fields=NULL, const char **cmt=NULL, const p_list **fieldcmts=NULL, sclass_t *sclass=NULL)
 Retrieve a type by its ordinal number.
idaman uint32 ida_export alloc_type_ordinals (til_t *ti, int qty)
 Allocate a range of ordinal numbers for new types. More...
uint32 alloc_type_ordinal (til_t *ti)
 alloc_type_ordinals(ti, 1)
idaman uint32 ida_export get_ordinal_qty (const til_t *ti)
 Get number of allocated ordinals. More...
idaman tinfo_code_t ida_export set_numbered_type (til_t *ti, uint32 ordinal, int ntf_flags, const char *name, const type_t *type, const p_list *fields=NULL, const char *cmt=NULL, const p_list *fldcmts=NULL, const sclass_t *sclass=NULL)
 Store a type in the til. More...
idaman bool ida_export del_numbered_type (til_t *ti, uint32 ordinal)
 Delete a numbered type.
idaman bool ida_export set_type_alias (til_t *ti, uint32 src_ordinal, uint32 dst_ordinal)
 Create a type alias. More...
idaman uint32 ida_export get_alias_target (const til_t *ti, uint32 ordinal)
 Find the final alias destination. More...
int32 get_type_ordinal (const til_t *ti, const char *name)
 Get type ordinal by its name.
idaman const char *ida_export get_numbered_type_name (const til_t *ti, uint32 ordinal)
 Get type name (if exists) by its ordinal. More...
idaman ssize_t ida_export create_numbered_type_name (qstring *buf, int32 ord)
 Create anonymous name for numbered type. More...
idaman bool ida_export is_ordinal_name (const char *name, uint32 *ord=NULL)
 Check if the name is an ordinal name. More...
idaman int ida_export get_ordinal_from_idb_type (const char *name, const type_t *type)
 Get ordinal number of an idb type (struct/enum). More...
bool idaapi is_autosync (const char *name, const type_t *type)
 Is the specified idb type automatically synchronized?
bool idaapi is_autosync (const char *name, const tinfo_t &tif)
 copydoc is_autosync(const char*, const type_t *)
idaman void ida_export build_anon_type_name (qstring *buf, const type_t *type, const p_list *fields)
 Generate a name like $hex_numbers based on the field types and names.
idaman int ida_export compact_numbered_types (til_t *ti, uint32 min_ord=0, intvec_t *p_ordmap=NULL, int flags=0)
 Compact numbered types to get rid of empty slots. More...
size_t get_default_align (void)
 Get default alignment for structure fields. More...
void align_size (size_t &cur_tot_size, size_t elem_size, size_t algn)
 Get alignment delta for the a structure field. More...
idaman bool ida_export deref_ptr (ea_t *ptr_ea, const tinfo_t &tif, ea_t *closure_obj=NULL)
 Dereference a pointer. More...
idaman bool ida_export remove_tinfo_pointer (tinfo_t *tif, const char **pname, const til_t *til=NULL)
 Remove pointer of a type. More...
idaman tid_t ida_export import_type (const til_t *til, int idx, const char *name, int flags=0)
 Copy a named type from til to idb. More...
idaman int ida_export add_til (const char *name, int flags)
 Load a til file. More...
idaman bool ida_export del_til (const char *name)
 Unload a til file.
idaman bool ida_export apply_named_type (ea_t ea, const char *name)
 Apply the specified named type to the address. More...
idaman bool ida_export apply_tinfo (ea_t ea, const tinfo_t &tif, uint32 flags)
 Apply the specified type to the specified address. More...
idaman bool ida_export apply_cdecl (til_t *til, ea_t ea, const char *decl, int flags=0)
 Apply the specified type to the address. More...
idaman bool ida_export apply_callee_tinfo (ea_t caller, const tinfo_t &tif)
 Apply the type of the called function to the calling instruction. More...
idaman bool ida_export get_arg_addrs (eavec_t *out, ea_t caller)
 Retrieve argument initialization addresses. More...
idaman bool ida_export apply_once_tinfo_and_name (ea_t dea, const tinfo_t &tif, const char *name)
 Apply the specified type and name to the address. More...
idaman int ida_export guess_tinfo (tinfo_t *tif, tid_t id)
 Generate a type information about the id from the disassembly. More...
void set_c_header_path (const char *incdir)
 Set include directory path the target compiler.
ssize_t get_c_header_path (qstring *buf)
 Get the include directory path of the target compiler.
void set_c_macros (const char *macros)
 Set predefined macros for the target compiler.
ssize_t get_c_macros (qstring *buf)
 Get predefined macros for the target compiler.
idaman const til_t *ida_export get_idati (void)
 Pointer to the local type library - this til is private for each IDB file Function that accepts til_t* uses local type library instead of NULL. More...
idaman bool ida_export get_idainfo_by_type (size_t *psize, flags_t *pflags, opinfo_t *mt, const tinfo_t &tif, size_t *alsize=NULL)
 Extract information from a tinfo_t. More...
idaman cm_t ida_export guess_func_cc (const func_type_data_t &fti, int npurged, int cc_flags)
 Use func_type_data_t::guess_cc()
idaman bool ida_export dump_func_type_data (qstring *out, const func_type_data_t &fti, int praloc_bits)
 Use func_type_data_t::dump()
int get_arg_align (int type_align, int slotsize)
int get_arg_align (const tinfo_t &tif, int slotsize)
sval_t align_stkarg_up (sval_t spoff, int type_align, int slotsize)
sval_t align_stkarg_up (sval_t spoff, const tinfo_t &tif, int slotsize)
tinfo_t remove_pointer (const tinfo_t &tif)
 BT_PTR: If the current type is a pointer, return the pointed object. More...
idaman error_t ida_export unpack_idcobj_from_idb (idc_value_t *obj, const tinfo_t &tif, ea_t ea, const bytevec_t *off0, int pio_flags=0)
 Read a typed idc object from the database.
idaman error_t ida_export unpack_idcobj_from_bv (idc_value_t *obj, const tinfo_t &tif, const bytevec_t &bytes, int pio_flags=0)
 Read a typed idc object from the byte vector.
idaman error_t ida_export pack_idcobj_to_idb (const idc_value_t *obj, const tinfo_t &tif, ea_t ea, int pio_flags=0)
 Write a typed idc object to the database.
idaman error_t ida_export pack_idcobj_to_bv (const idc_value_t *obj, const tinfo_t &tif, relobj_t *bytes, void *objoff, int pio_flags=0)
 Write a typed idc object to the byte vector. More...
idaman bool ida_export apply_tinfo_to_stkarg (const insn_t &insn, const op_t &x, uval_t v, const tinfo_t &tif, const char *name)
 Helper function for the processor modules. More...
idaman void ida_export gen_use_arg_tinfos (ea_t caller, func_type_data_t *fti, funcargvec_t *rargs, set_op_tinfo_t *set_optype, is_stkarg_load_t *is_stkarg_load, has_delay_slot_t *has_delay_slot)
 The main function using these callbacks:
idaman bool ida_export func_has_stkframe_hole (ea_t ea, const func_type_data_t &fti)
 Looks for a hole at the beginning of the stack arguments. More...
idaman int ida_export lower_type (til_t *til, tinfo_t *tif, const char *name=NULL, lowertype_helper_t *_helper=NULL)
 Lower type. More...
idaman void ida_export begin_type_updating (update_type_t utp)
 Mark the beginning of a large update operation on the types. More...
idaman void ida_export end_type_updating (update_type_t utp)
 Mark the end of a large update operation on the types (see begin_type_updating())
idaman bool ida_export format_cdata (qstrvec_t *outvec, const idc_value_t &idc_value, const tinfo_t *tif, valstr_t *vtree=NULL, const format_data_info_t *fdi=NULL)
 Format a data value as a C initializer. More...
idaman int ida_export print_cdata (text_sink_t &printer, const idc_value_t &idc_value, const tinfo_t *tif, const format_data_info_t *fdi=NULL)
 The same as format_cdata(), but instead of returning the answer in a vector, print it. More...
idaman int ida_export print_decls (text_sink_t &printer, til_t *til, const ordvec_t *ordinals, uint32 flags)
 Print types (and possibly their dependencies) in a format suitable for use in a header file. More...
idaman int ida_export calc_number_of_children (const argloc_t &loc, const tinfo_t &tif, bool dont_deref_ptr=false)
 Calculate max number of lines of a formatted c data, when expanded (PTV_EXPAND). More...
idaman size_t ida_export format_c_number (char *buf, size_t bufsize, uint128 value, int size, int pcn=0)
 Format a C number. More...
idaman bool ida_export get_enum_member_expr (qstring *buf, const tinfo_t &tif, int serial, uint64 value)
 Return a C expression that can be used to represent an enum member. More...
idaman bool ida_export choose_named_type (til_symbol_t *out_sym, const til_t *root_til, const char *title, int ntf_flags, predicate_t *predicate=NULL)
 Choose a type from a type library. More...
idaman uint32 ida_export choose_local_tinfo (const til_t *ti, const char *title, local_tinfo_predicate_t *func=NULL, uint32 def_ord=0, void *ud=NULL)
 Choose a type from the local type library. More...


#define RESERVED_BYTE   0xFF
 multifunctional purpose
#define TAH_BYTE   0xFE
 type attribute header byte
#define FAH_BYTE   0xFF
 function argument attribute header byte
#define MAX_DECL_ALIGN   0x000F
#define TAH_HASATTRS   0x0010
 has extended attributes
#define TAUDT_UNALIGNED   0x0040
 struct: unaligned struct
#define TAUDT_MSSTRUCT   0x0020
 struct: gcc msstruct attribute
#define TAUDT_CPPOBJ   0x0080
 struct: a c++ object, not simple pod type
#define TAFLD_BASECLASS   0x0020
 field: do not include but inherit from the current field
#define TAFLD_UNALIGNED   0x0040
 field: unaligned field
#define TAFLD_VIRTBASE   0x0080
 field: virtual base (not supported yet)
#define TAPTR_PTR32   0x0020
 ptr: __ptr32
#define TAPTR_PTR64   0x0040
 ptr: __ptr64
#define TAPTR_RESTRICT   0x0060
 ptr: __restrict
#define TAENUM_64BIT   0x0020
 enum: store 64-bit values
#define TAH_ALL   0x00F0
 all defined bits
#define TIL_ZIP   0x0001
 pack buckets using zip
#define TIL_MAC   0x0002
 til has macro table
#define TIL_ESI   0x0004
 extended sizeof info (short, long, longlong)
#define TIL_UNI   0x0008
 universal til for any compiler
#define TIL_ORD   0x0010
 type ordinal numbers are present
#define TIL_ALI   0x0020
 type aliases are present (this bit is used only on the disk)
#define TIL_MOD   0x0040
 til has been modified, should be saved
#define TIL_STM   0x0080
 til has extra streams
#define TIL_SLD   0x0100
 sizeof(long double)
#define TIL_ADD_FAILED   0
 see errbuf
#define TIL_ADD_OK   1
 some tils were added
#define TIL_ADD_ALREADY   2
 the base til was already added
 Helper to declare common argloc_t related functions. More...
#define PRALOC_VERIFY   0x01
 interr if illegal argloc
#define PRALOC_STKOFF   0x02
 print stack offsets
#define SETCOMP_OVERRIDE   0x0001
 may override old compiler info
#define SETCOMP_ONLY_ID   0x0002
 cc has only 'id' field More...
#define SETCOMP_ONLY_ABI   0x0004
 ignore cc field complete, use only abiname
#define SETCOMP_BY_USER   0x0008
 invoked by user, can not be replaced by module/loader
#define MAX_FUNC_ARGS   256
 max number of function arguments
#define HTI_CPP   0x00000001
 C++ mode (not implemented)
#define HTI_INT   0x00000002
 debug: print internal representation of types
#define HTI_EXT   0x00000004
 debug: print external representation of types
#define HTI_LEX   0x00000008
 debug: print tokens
#define HTI_UNP   0x00000010
 debug: check the result by unpacking it
#define HTI_TST   0x00000020
 test mode: discard the result
#define HTI_FIL   0x00000040
 "input" is file name, More...
#define HTI_MAC   0x00000080
 define macros from the base tils
#define HTI_NWR   0x00000100
 no warning messages
#define HTI_NER   0x00000200
 ignore all errors but display them
#define HTI_DCL   0x00000400
 don't complain about redeclarations
#define HTI_NDC   0x00000800
 don't decorate names
#define HTI_PAK   0x00007000
 explicit structure pack value (#pragma pack)
#define HTI_PAK_SHIFT   12
 shift for HTI_PAK. More...
#define HTI_PAKDEF   0x00000000
 default pack value
#define HTI_PAK1   0x00001000
 #pragma pack(1)
#define HTI_PAK2   0x00002000
 #pragma pack(2)
#define HTI_PAK4   0x00003000
 #pragma pack(4)
#define HTI_PAK8   0x00004000
 #pragma pack(8)
#define HTI_PAK16   0x00005000
 #pragma pack(16)
#define HTI_HIGH   0x00008000
 assume high level prototypes More...
#define HTI_LOWER   0x00010000
 lower the function prototypes
#define HTI_RAWARGS   0x00020000
 leave argument names unchanged (do not remove underscores)
#define PT_SIL   0x0001
 silent, no messages
#define PT_NDC   0x0002
 don't decorate names
#define PT_TYP   0x0004
 return declared type information
#define PT_VAR   0x0008
 return declared object information
#define PT_PACKMASK   0x0070
 mask for pack alignment values
#define PT_HIGH   0x0080
 assume high level prototypes More...
#define PT_LOWER   0x0100
 lower the function prototypes
#define PT_REPLACE   0x0200
 replace the old type (used in idc)
#define PT_RAWARGS   0x0400
 leave argument names unchanged (do not remove underscores)
#define PRTYPE_1LINE   0x0000
 print to one line
#define PRTYPE_MULTI   0x0001
 print to many lines
#define PRTYPE_TYPE   0x0002
 print type declaration (not variable declaration)
#define PRTYPE_PRAGMA   0x0004
 print pragmas for alignment
#define PRTYPE_SEMI   0x0008
 append ; to the end
#define PRTYPE_CPP   0x0010
 use c++ name (only for print_type())
#define PRTYPE_DEF   0x0020
 tinfo_t: print definition, if available
#define PRTYPE_NOARGS   0x0040
 tinfo_t: do not print function argument names
#define PRTYPE_NOARRS   0x0080
 tinfo_t: print arguments with FAI_ARRAY as pointers
#define PRTYPE_NORES   0x0100
 tinfo_t: never resolve types (meaningful with PRTYPE_DEF)
#define PRTYPE_RESTORE   0x0200
 tinfo_t: print restored types for FAI_ARRAY and FAI_STRUCT
#define NTF_TYPE   0x0001
 type name
#define NTF_SYMU   0x0008
 symbol, name is unmangled ('func')
#define NTF_SYMM   0x0000
 symbol, name is mangled ('_func') More...
#define NTF_NOBASE   0x0002
 don't inspect base tils (for get_named_type)
#define NTF_REPLACE   0x0004
 replace original type (for set_named_type)
#define NTF_UMANGLED   0x0008
 name is unmangled (don't use this flag)
#define NTF_NOCUR   0x0020
 don't inspect current til file (for get_named_type)
#define NTF_64BIT   0x0040
 value is 64bit
#define NTF_FIXNAME   0x0080
 force-validate the name of the type when setting More...
#define NTF_IDBENC   0x0100
 the name is given in the IDB encoding; More...
#define CCN_C   0x00
#define CCN_CPP   0x01
#define IMPTYPE_VERBOSE   0x0001
 more verbose output (dialog boxes may appear)
#define IMPTYPE_OVERRIDE   0x0002
 override existing type
#define IMPTYPE_LOCAL   0x0004
 the type is local, the struct/enum won't be marked as til type. More...
#define ADDTIL_DEFAULT   0x0000
 default behavior
#define ADDTIL_INCOMP   0x0001
 load incompatible tils
#define ADDTIL_SILENT   0x0002
 do not ask any questions
#define ADDTIL_FAILED   0
 something bad, the warning is displayed
#define ADDTIL_OK   1
 ok, til is loaded
#define ADDTIL_COMP   2
 ok, but til is not compatible with the current compiler
#define TINFO_GUESSED   0x0000
 this is a guessed type
#define TINFO_DEFINITE   0x0001
 this is a definite type
#define TINFO_DELAYFUNC   0x0002
 if type is a function and no function exists at ea, More...
#define TINFO_STRICT   0x0004
 never convert given type to another one before applying
 couldn't guess the function type
 the function type doesn't have interesting info
#define GUESS_FUNC_OK   2
 ok, some non-trivial information is gathered
#define SUDT_SORT   0x0001
 fields are not sorted by offset, sort them first
#define SUDT_ALIGN   0x0002
 recalculate field alignments, struct packing, etc More...
#define SUDT_GAPS   0x0004
 allow to fill gaps with additional members (_BYTE[])
#define SUDT_UNEX   0x0008
 references to nonexistent member types are acceptable More...
#define SUDT_FAST   0x0010
 serialize without verifying offsets and alignments
#define SUDT_CONST   0x0040
 only for serialize_udt: make type const
#define SUDT_VOLATILE   0x0080
 only for serialize_udt: make type volatile
#define SUDT_TRUNC   0x0100
 serialize: truncate useless strings from fields, fldcmts
 Macro to declare common tinfo_t related functions. More...
#define STRMEM_MASK   0x0007
#define STRMEM_OFFSET   0x0000
 get member by offset More...
#define STRMEM_INDEX   0x0001
 get member by number More...
#define STRMEM_AUTO   0x0002
 get member by offset if struct, or get member by index if union More...
#define STRMEM_NAME   0x0003
 get member by name More...
#define STRMEM_TYPE   0x0004
 get member by type. More...
#define STRMEM_SIZE   0x0005
 get member by size. More...
#define STRMEM_MINS   0x0006
 get smallest member by size.
#define STRMEM_MAXS   0x0007
 get biggest member by size.
#define STRMEM_SKIP_EMPTY   0x20000000
 can be combined with STRMEM_OFFSET, STRMEM_AUTO skip empty members (i.e. More...
#define STRMEM_CASTABLE_TO   0x40000000
 can be combined with STRMEM_TYPE: member type must be castable to the specified type
#define STRMEM_ANON   0x80000000
 can be combined with STRMEM_NAME: look inside anonymous members too. More...
#define TCMP_EQUAL   0x0000
 are types equal?
#define TCMP_IGNMODS   0x0001
 ignore const/volatile modifiers
#define TCMP_AUTOCAST   0x0002
 can t1 be cast into t2 automatically?
#define TCMP_MANCAST   0x0004
 can t1 be cast into t2 manually?
#define TCMP_CALL   0x0008
 can t1 be called with t2 type?
#define TCMP_DELPTR   0x0010
 remove pointer from types before comparing
#define TCMP_DECL   0x0020
 compare declarations without resolving them
#define FAI_HIDDEN   0x0001
 hidden argument
#define FAI_RETPTR   0x0002
 pointer to return value. implies hidden
#define FAI_STRUCT   0x0004
 was initially a structure
#define FAI_ARRAY   0x0008
 was initially an array More...
#define TA_ORG_TYPEDEF   "__org_typedef"
 the original typedef name (simple string)
#define TA_ORG_ARRDIM   "__org_arrdim"
 the original array dimension (append_dd)
#define FTI_SPOILED   0x0001
 information about spoiled registers is present
#define FTI_NORET   0x0002
#define FTI_PURE   0x0004
#define FTI_HIGH   0x0008
 high level prototype (with possibly hidden args)
#define FTI_STATIC   0x0010
#define FTI_VIRTUAL   0x0020
#define FTI_CALLTYPE   0x00C0
 mask for FTI_*CALL
#define FTI_DEFCALL   0x0000
 default call
#define FTI_NEARCALL   0x0040
 near call
#define FTI_FARCALL   0x0080
 far call
#define FTI_INTCALL   0x00C0
 interrupt call
#define FTI_ARGLOCS   0x0100
 info about argument locations has been calculated More...
#define FTI_ALL   0x01FF
 all defined bits
#define CC_CDECL_OK   0x01
 can use __cdecl calling convention?
#define CC_ALLOW_ARGPERM   0x02
 disregard argument order?
#define CC_ALLOW_REGHOLES   0x04
 allow holes in register argument list?
#define CC_HAS_ELLIPSIS   0x08
 function has a variable list of arguments?
#define TVIS_TYPE   0x0001
 new type info is present
#define TVIS_NAME   0x0002
 new name is present
#define TVIS_CMT   0x0004
 new comment is present
#define TVST_PRUNE   0x01
 don't visit children of current type
#define TVST_DEF   0x02
 visit type definition (meaningful for typerefs)
#define PIO_NOATTR_FAIL   0x0004
 missing attributes are not ok
#define PIO_IGNORE_PTRS   0x0008
 do not follow pointers
#define PTV_DEREF   0x0001
 take value to print from the debugged process. More...
#define PTV_QUEST   0x0002
 print '?' for uninited data
#define PTV_EMPTY   0x0004
 return empty string for uninited data More...
#define PTV_CSTR   0x0008
 print constant strings inline
#define PTV_EXPAND   0x0010
 print only top level on separate lines More...
#define PTV_LZHEX   0x0020
 print hex numbers with leading zeroes
#define PTV_STPFLT   0x0040
 fail on bad floating point numbers More...
#define PTV_SPACE   0x0080
 add spaces after commas and around braces
#define PTV_DEBUG   0x0100
 format output for debugger
#define PTV_NOPTR   0x0200
 prevent pointer values from appearing in the output
#define PTV_NTOP   0x40000000
 internal flag, do not use
#define PTV_KEEP   0x80000000
 internal flag, do not use
#define VALSTR_OPEN   0x01
 printed opening curly brace '{'
#define PDF_INCL_DEPS   0x1
 Include all type dependencies.
#define PDF_DEF_FWD   0x2
 Allow forward declarations.
#define PDF_DEF_BASE   0x4
 Include base types: __int8, __int16, etc..
#define PDF_HEADER_CMT   0x8
 Prepend output with a descriptive comment.
#define PCN_RADIX   0x07
 number base to use
#define PCN_DEC   0x00
#define PCN_HEX   0x01
#define PCN_OCT   0x02
#define PCN_CHR   0x03
#define PCN_UNSIGNED   0x08
 add 'u' suffix
#define PCN_LZHEX   0x10
 print leading zeroes for hexdecimal number
#define PCN_NEGSIGN   0x20
 print negated value (-N) for negative numbers


typedef uchar type_t
 byte sequence used to describe a type in IDA (see Type flags)
typedef uchar p_string
 pascal-like string: dt length, characters
typedef uchar p_list
 several p_string's
typedef uchar bte_t
 Enum type flags.
typedef qvector< type_attr_ttype_attrs_t
 this vector must be sorted by keys
typedef int type_sign_t
 type signedness
typedef int argloc_type_t
 Specifies the location type of a function argument - see Argument location types.
typedef qvector< argloc_targlocs_t
 vector of argument locations
typedef qvector< comp_tcompvec_t
 Collection of compiler descriptions.
typedef int idaapi h2ti_type_cb(const char *name, const tinfo_t &tif, const char *cmt, const uint64 *value, void *cb_data)
 This callback will be called for each type/variable declaration. More...
typedef int printer_t(const char *format,...)
 Specify a printing callback when parsing types. More...
typedef qvector< tinfo_ttinfovec_t
 vector of tinfo objects
typedef qvector< simd_info_tsimd_info_vec_t
typedef qvector< funcarg_tfuncargvec_t
 vector of function argument objects
typedef qvector< udt_member_tudtmembervec_t
 vector of udt member objects
typedef bool idaapi set_op_tinfo_t(const insn_t &insn, const op_t &x, const tinfo_t &type, const char *name)
 Set the operand type as specified.
typedef bool idaapi is_stkarg_load_t(const insn_t &insn, int *src, int *dst)
 Is the current insn a stkarg load?. More...
typedef bool idaapi has_delay_slot_t(ea_t caller)
 The call instruction with a delay slot?.
typedef qvector< uint32ordvec_t
typedef int idaapi local_tinfo_predicate_t(uint32 ord, const tinfo_t &type, void *ud)
 Controls which types are displayed/selected when choosing local types. More...
typedef bool input_exe_reader_t(uint64 fileOffset, uint32 count, void *buffer, uint32 *read, void *user_data)
typedef bool input_mem_reader_t(ea_t ea, uint32 count, void *buffer, uint32 *read, void *user_data)


enum  argreg_policy_t {
 Function argument passing: how GP & FP registers cooperate with each other. More...
enum  abs_t { abs_unk, abs_no, abs_yes }
 abstractness of declaration (see h2ti())
enum  sclass_t {
  sc_unk, sc_type, sc_ext, sc_stat,
  sc_reg, sc_auto, sc_friend, sc_virt
 < storage class More...
enum  tinfo_code_t { TERR_OK = 0, TERR_SAVE = -1, TERR_SERIALIZE = -2, TERR_WRONGNAME = -3 }
 Error codes for save_tinfo functions: More...
enum  stock_type_id_t {
 IDs for common types. More...
 Constants to be used with get_udt_details() More...
 Constants to be used with get_func_details() More...
enum  gts_code_t { GTS_NESTED = 0x01, GTS_BASECLASS = 0x02 }
 Constants to be used with get_size() More...
enum  update_type_t { UTP_ENUM, UTP_STRUCT }
 See begin_type_updating()


const type_t TYPE_BASE_MASK = 0x0F
 the low 4 bits define the basic type
const type_t TYPE_FLAGS_MASK = 0x30
 type flags - they have different meaning depending on the basic type
const type_t TYPE_MODIF_MASK = 0xC0
 modifiers. More...
 basic type with type flags
const type_t BT_UNK = 0x00
const type_t BT_VOID = 0x01
const type_t BTMT_SIZE0 = 0x00
 BT_VOID - normal void; BT_UNK - don't use
const type_t BTMT_SIZE12 = 0x10
 size = 1 byte if BT_VOID; 2 if BT_UNK
const type_t BTMT_SIZE48 = 0x20
 size = 4 bytes if BT_VOID; 8 if BT_UNK
const type_t BTMT_SIZE128 = 0x30
 size = 16 bytes if BT_VOID; unknown if BT_UNK (IN struct alignment - see below)
const type_t BT_INT8 = 0x02
const type_t BT_INT16 = 0x03
const type_t BT_INT32 = 0x04
const type_t BT_INT64 = 0x05
const type_t BT_INT128 = 0x06
 __int128 (for alpha & future use)
const type_t BT_INT = 0x07
 natural int. (size provided by idp module)
const type_t BTMT_UNKSIGN = 0x00
 unknown signedness
const type_t BTMT_SIGNED = 0x10
const type_t BTMT_USIGNED = 0x20
const type_t BTMT_CHAR = 0x30
 specify char or segment register More...
const type_t BT_BOOL = 0x08
const type_t BTMT_DEFBOOL = 0x00
 size is model specific or unknown(?)
const type_t BTMT_BOOL1 = 0x10
 size 1byte
const type_t BTMT_BOOL2 = 0x20
 size 2bytes - !inf.is_64bit()
const type_t BTMT_BOOL8 = 0x20
 size 8bytes - inf.is_64bit()
const type_t BTMT_BOOL4 = 0x30
 size 4bytes
const type_t BT_FLOAT = 0x09
const type_t BTMT_FLOAT = 0x00
 float (4 bytes)
const type_t BTMT_DOUBLE = 0x10
 double (8 bytes)
const type_t BTMT_LNGDBL = 0x20
 long double (compiler specific)
const type_t BTMT_SPECFLT = 0x30
 float (variable size). More...
const type_t _BT_LAST_BASIC = BT_FLOAT
 the last basic type, all basic types may be followed by [tah-typeattrs]
const type_t BT_PTR = 0x0A
 pointer. More...
const type_t BTMT_DEFPTR = 0x00
 default for model
const type_t BTMT_NEAR = 0x10
const type_t BTMT_FAR = 0x20
const type_t BTMT_CLOSURE = 0x30
 closure. More...
const type_t BT_ARRAY = 0x0B
const type_t BTMT_NONBASED = 0x10
const type_t BTMT_ARRESERV = 0x20
 reserved bit
const type_t BT_FUNC = 0x0C
 function. More...
const type_t BTMT_DEFCALL = 0x00
 call method - default for model or unknown
const type_t BTMT_NEARCALL = 0x10
 function returns by retn
const type_t BTMT_FARCALL = 0x20
 function returns by retf
const type_t BTMT_INTCALL = 0x30
 function returns by iret in this case cc MUST be 'unknown'
const type_t BT_COMPLEX = 0x0D
 struct/union/enum/typedef. More...
const type_t BTMT_STRUCT = 0x00
 struct: MCNT records: type_t; [sdacl-typeattrs];
const type_t BTMT_UNION = 0x10
 union: MCNT records: type_t... More...
const type_t BTMT_ENUM = 0x20
 enum: next byte bte_t (see below) N records: de delta(s) OR blocks (see below)
const type_t BTMT_TYPEDEF = 0x30
 named reference always p_string name
const type_t BT_BITFIELD = 0x0E
 bitfield (only in struct) ['bitmasked' enum see below] next byte is dt ((size in bits << 1) | (unsigned ? 1 : 0))
const type_t BTMT_BFLDI8 = 0x00
const type_t BTMT_BFLDI16 = 0x10
const type_t BTMT_BFLDI32 = 0x20
const type_t BTMT_BFLDI64 = 0x30
const type_t BT_RESERVED = 0x0F
const type_t BTM_CONST = 0x40
const type_t BTM_VOLATILE = 0x80
const bte_t BTE_SIZE_MASK = 0x07
 storage size. More...
const bte_t BTE_RESERVED = 0x08
 must be 0, in order to distinguish from a tah-byte
const bte_t BTE_BITFIELD = 0x10
 'subarrays'. More...
const bte_t BTE_OUT_MASK = 0x60
 output style mask
const bte_t BTE_HEX = 0x00
const bte_t BTE_CHAR = 0x20
 char or hex
const bte_t BTE_SDEC = 0x40
 signed decimal
const bte_t BTE_UDEC = 0x60
 unsigned decimal
const bte_t BTE_ALWAYS = 0x80
 this bit MUST be present
const type_t BT_SEGREG = (BT_INT | BTMT_CHAR)
 segment register
const type_t BT_UNK_BYTE = (BT_VOID | BTMT_SIZE12)
 1 byte
const type_t BT_UNK_WORD = (BT_UNK | BTMT_SIZE12)
 2 bytes
const type_t BT_UNK_DWORD = (BT_VOID | BTMT_SIZE48)
 4 bytes
const type_t BT_UNK_QWORD = (BT_UNK | BTMT_SIZE48)
 8 bytes
const type_t BT_UNK_OWORD = (BT_VOID | BTMT_SIZE128)
 16 bytes
const type_t BT_UNKNOWN = (BT_UNK | BTMT_SIZE128)
 unknown size - for parameters
const type_t BTF_BYTE = BT_UNK_BYTE
const type_t BTF_UNK = BT_UNKNOWN
const type_t BTF_VOID = BT_VOID | BTMT_SIZE0
const type_t BTF_INT8 = BT_INT8 | BTMT_SIGNED
 signed byte
const type_t BTF_CHAR = BT_INT8 | BTMT_CHAR
 signed char
 unsigned char
const type_t BTF_UINT8 = BT_INT8 | BTMT_USIGNED
 unsigned byte
const type_t BTF_INT16 = BT_INT16 | BTMT_SIGNED
 signed short
const type_t BTF_UINT16 = BT_INT16 | BTMT_USIGNED
 unsigned short
const type_t BTF_INT32 = BT_INT32 | BTMT_SIGNED
 signed int
const type_t BTF_UINT32 = BT_INT32 | BTMT_USIGNED
 unsigned int
const type_t BTF_INT64 = BT_INT64 | BTMT_SIGNED
 signed long
const type_t BTF_UINT64 = BT_INT64 | BTMT_USIGNED
 unsigned long
const type_t BTF_INT128 = BT_INT128 | BTMT_SIGNED
 signed 128-bit value
const type_t BTF_UINT128 = BT_INT128 | BTMT_USIGNED
 unsigned 128-bit value
const type_t BTF_INT = BT_INT | BTMT_UNKSIGN
 int, unknown signedness
 unsigned int
const type_t BTF_SINT = BT_INT | BTMT_SIGNED
 singed int
const type_t BTF_BOOL = BT_BOOL
 long double
const type_sign_t no_sign = 0
 no sign, or unknown
const type_sign_t type_signed = 1
 signed type
const type_sign_t type_unsigned = 2
 unsigned type
const cm_t CM_MASK = 0x03
const cm_t CM_UNKNOWN = 0x00
const cm_t CM_N8_F16 = 0x01
 1: near 1byte, far 2bytes
const cm_t CM_N64 = 0x01
 if sizeof(int)>2 then ptr size is 8bytes
const cm_t CM_N16_F32 = 0x02
 2: near 2bytes, far 4bytes
const cm_t CM_N32_F48 = 0x03
 4: near 4bytes, far 6bytes
const cm_t CM_M_MASK = 0x0C
const cm_t CM_M_NN = 0x00
 small: code=near, data=near (or unknown if CM_UNKNOWN)
const cm_t CM_M_FF = 0x04
 large: code=far, data=far
const cm_t CM_M_NF = 0x08
 compact: code=near, data=far
const cm_t CM_M_FN = 0x0C
 medium: code=far, data=near
const cm_t CM_CC_MASK = 0xF0
const cm_t CM_CC_INVALID = 0x00
 this value is invalid
const cm_t CM_CC_UNKNOWN = 0x10
 unknown calling convention
const cm_t CM_CC_VOIDARG = 0x20
 function without arguments if has other cc and argnum == 0, represent as f() - unknown list
const cm_t CM_CC_CDECL = 0x30
const cm_t CM_CC_ELLIPSIS = 0x40
 cdecl + ellipsis
const cm_t CM_CC_STDCALL = 0x50
 stack, purged
const cm_t CM_CC_PASCAL = 0x60
 stack, purged, reverse order of args
const cm_t CM_CC_FASTCALL = 0x70
 stack, purged (x86), first args are in regs (compiler-dependent)
const cm_t CM_CC_THISCALL = 0x80
 stack, purged (x86), first arg is in reg (compiler-dependent)
const cm_t CM_CC_MANUAL = 0x90
 special case for compiler specific
const cm_t CM_CC_SPOILED = 0xA0
 This is NOT a cc! Mark of __spoil record the low nibble is count and after n {spoilreg_t} present real cm_t byte. More...
const cm_t CM_CC_RESERVE4 = 0xB0
const cm_t CM_CC_RESERVE3 = 0xC0
const cm_t CM_CC_SPECIALE = 0xD0
 CM_CC_SPECIAL with ellipsis
const cm_t CM_CC_SPECIALP = 0xE0
 Equal to CM_CC_SPECIAL, but with purged stack.
const cm_t CM_CC_SPECIAL = 0xF0
 locations of all arguments and the return value are present in the function declaration. More...
const type_t BFA_NORET = 0x01
const type_t BFA_PURE = 0x02
const type_t BFA_HIGH = 0x04
 high level prototype (with possibly hidden args)
const type_t BFA_STATIC = 0x08
const type_t BFA_VIRTUAL = 0x10
const argloc_type_t ALOC_NONE = 0
const argloc_type_t ALOC_STACK = 1
 stack offset
const argloc_type_t ALOC_DIST = 2
 distributed (scattered)
const argloc_type_t ALOC_REG1 = 3
 one register (and offset within it)
const argloc_type_t ALOC_REG2 = 4
 register pair
const argloc_type_t ALOC_RREL = 5
 register relative
const argloc_type_t ALOC_STATIC = 6
 global address
const argloc_type_t ALOC_CUSTOM = 7
 custom argloc (7 or higher)
const cm_t C_PC_TINY = (CM_N16_F32 | CM_M_NN)
const cm_t C_PC_SMALL = (CM_N16_F32 | CM_M_NN)
const cm_t C_PC_COMPACT = (CM_N16_F32 | CM_M_NF)
const cm_t C_PC_MEDIUM = (CM_N16_F32 | CM_M_FN)
const cm_t C_PC_LARGE = (CM_N16_F32 | CM_M_FF)
const cm_t C_PC_HUGE = (CM_N16_F32 | CM_M_FF)
const cm_t C_PC_FLAT = (CM_N32_F48 | CM_M_NN)
const comp_t COMP_MASK = 0x0F
const comp_t COMP_UNK = 0x00
const comp_t COMP_MS = 0x01
 Visual C++.
const comp_t COMP_BC = 0x02
 Borland C++.
const comp_t COMP_WATCOM = 0x03
 Watcom C++.
const comp_t COMP_GNU = 0x06
 GNU C++.
const comp_t COMP_VISAGE = 0x07
 Visual Age C++.
const comp_t COMP_BP = 0x08
const comp_t COMP_UNSURE = 0x80
 uncertain compiler id
const size_t BADSIZE = size_t(-1)
 bad type size
const uint32 BADORD = uint32(-1)
 invalid type ordinal
const int FIRST_NONTRIVIAL_TYPID = 0x100
 Denotes the first bit describing a nontrivial type.
const int TYPID_ISREF = 0x100
 Identifies that a type that is a typeref.
const int TYPID_SHIFT = 9
 First type detail bit.

Macro Definition Documentation

decl void ida_export copy_argloc(argloc_t *dst, const argloc_t *src); \
decl void ida_export cleanup_argloc(argloc_t *vloc);\
decl int ida_export compare_arglocs(const argloc_t &a, const argloc_t &b);
#define ida_export
functions marked with this keyword are available as part of the IDA SDK
Definition: pro.h:240
Describes an argument location.
Definition: typeinf.hpp:952

Helper to declare common argloc_t related functions.

#define DECLARE_TINFO_HELPERS (   decl)
decl void ida_export copy_tinfo_t(tinfo_t *_this, const tinfo_t &r); \
decl void ida_export clear_tinfo_t(tinfo_t *_this);\
decl bool ida_export create_tinfo(tinfo_t *_this, type_t bt, type_t bt2, void *ptr);\
decl int ida_export verify_tinfo(uint32 typid);\
decl bool ida_export get_tinfo_details(uint32 typid, type_t bt2, void *buf);\
decl size_t ida_export get_tinfo_size(uint32 *p_effalign, uint32 typid, int gts_code);\
decl size_t ida_export get_tinfo_pdata(void *outptr, uint32 typid, int what);\
decl size_t ida_export get_tinfo_property(uint32 typid, int gta_prop);\
decl size_t ida_export set_tinfo_property(tinfo_t *tif, int sta_prop, size_t x);\
decl bool ida_export serialize_tinfo(qtype *type, qtype *fields, qtype *fldcmts, const tinfo_t *tif, int sudt_flags);\
decl bool ida_export deserialize_tinfo(tinfo_t *tif, const til_t *til, const type_t **ptype, const p_list **pfields, const p_list **pfldcmts);\
decl int ida_export find_tinfo_udt_member(struct udt_member_t *udm, uint32 typid, int strmem_flags);\
decl bool ida_export print_tinfo(qstring *result, const char *prefix, int indent, int cmtindent, int flags, const tinfo_t *tif, const char *name, const char *cmt);\
decl const char *ida_export dstr_tinfo(const tinfo_t *tif);\
decl int ida_export visit_subtypes(struct tinfo_visitor_t *visitor, struct type_mods_t *out, const tinfo_t &tif, const char *name, const char *cmt);\
decl bool ida_export compare_tinfo(uint32 t1, uint32 t2, int tcflags);\
decl int ida_export lexcompare_tinfo(uint32 t1, uint32 t2, int);\
decl bool ida_export get_stock_tinfo(tinfo_t *tif, stock_type_id_t id);\
decl uint64 ida_export read_tinfo_bitfield_value(uint32 typid, uint64 v, int bitoff);\
decl uint64 ida_export write_tinfo_bitfield_value(uint32 typid, uint64 dst, uint64 v, int bitoff);\
decl bool ida_export get_tinfo_attr(uint32 typid, const qstring &key, bytevec_t *bv, bool all_attrs);\
decl bool ida_export set_tinfo_attr(tinfo_t *tif, const type_attr_t &ta, bool may_overwrite);\
decl bool ida_export del_tinfo_attr(tinfo_t *tif, const qstring &key, bool make_copy);\
decl bool ida_export get_tinfo_attrs(uint32 typid, type_attrs_t *tav, bool include_ref_attrs);\
decl bool ida_export set_tinfo_attrs(tinfo_t *tif, type_attrs_t *ta);\
decl uint32 ida_export score_tinfo(const tinfo_t *tif);\
decl tinfo_code_t ida_export save_tinfo(tinfo_t *tif, til_t *til, size_t ord, const char *name, int ntf_flags);\
decl bool ida_export append_tinfo_covered(rangeset_t *out, uint32 typid, uint64 offset);\
decl bool ida_export calc_tinfo_gaps(rangeset_t *out, uint32 typid);\
Error codes for save_tinfo functions:
Definition: typeinf.hpp:1793
uchar p_list
several p_string's
Definition: typeinf.hpp:34
Type Information Library.
Definition: typeinf.hpp:603
Vector of bytes (use for dynamic memory)
Definition: pro.h:2816
IDs for common types.
Definition: typeinf.hpp:2278
ulonglong uint64
unsigned 64 bit value
Definition: pro.h:307
unsigned int uint32
unsigned 32 bit value
Definition: pro.h:302
#define ida_export
functions marked with this keyword are available as part of the IDA SDK
Definition: pro.h:240
Visit all subtypes of a type. Derive your visitor from this class and use apply_to() ...
Definition: typeinf.hpp:3542
uchar type_t
byte sequence used to describe a type in IDA (see Type flags)
Definition: typeinf.hpp:30
Information about how to modify the current type, used by tinfo_visitor_t.
Definition: typeinf.hpp:3512
Reimplementation of vector class from STL.
Definition: pro.h:1647
Reimplementation of the string class from STL.
Definition: pro.h:2275
An object to represent struct or union members.
Definition: typeinf.hpp:3285
Primary mechanism for managing type information.
Definition: typeinf.hpp:2403
Extended type attributes.
Definition: typeinf.hpp:540

Macro to declare common tinfo_t related functions.

Typedef Documentation

typedef bool idaapi is_stkarg_load_t(const insn_t &insn, int *src, int *dst)

Is the current insn a stkarg load?.

if yes:

  • src: index of the source operand in {ops}
  • dst: index of the destination operand in {ops} {ops}[dst].addr is expected to have the stack offset
typedef int idaapi local_tinfo_predicate_t(uint32 ord, const tinfo_t &type, void *ud)

Controls which types are displayed/selected when choosing local types.

Return values
0skip type

Enumeration Type Documentation

enum sclass_t

< storage class

















IDs for common types.


char *


uint8 *


const char *


const uint8 *




int *


unsigned int *


void *


void **


const void *






const char[]


const uint8[]


void __userpurge(int)


void __cdecl(void *)


void *(void *, const char *, ...)


int __fastcall(int64 x, int64 y)


int __fastcall(uint64 x, uint64 y)


unused stock type id; should not be used






void __fastcall(void *, const void *, size_t)


void __fastcall(void *, size_t, int)


void __fastcall(void *, size_t)

enum gtd_udt_t

Constants to be used with get_udt_details()


calculate udt layout


don't calculate udt layout please note that udt layout may have been calculated earlier


delete udt bitfields

enum gtd_func_t

Constants to be used with get_func_details()


calculate func arg locations


don't calculate func arg locations please note that the locations may have been calculated earlier

enum gts_code_t

Constants to be used with get_size()


nested type (embedded into a udt)


is baseclass of a udt

Function Documentation

bool is_tah_byte ( type_t  t)

The TAH byte (type attribute header byte) denotes the start of type attributes.

(see "tah-typeattrs" in the type bit definitions)

bool is_sdacl_byte ( type_t  t)

Identify an sdacl byte.

The first sdacl byte has the following format: 11xx000x. The sdacl bytes are appended to udt fields. They indicate the start of type attributes (as the tah-bytes do). The sdacl bytes are used in the udt headers instead of the tah-byte. This is done for compatibility with old databases, they were already using sdacl bytes in udt headers and as udt field postfixes. (see "sdacl-typeattrs" in the type bit definitions)

bool operator< ( const bytevec_t v1,
const bytevec_t v2 

Compare two bytevecs with '<'.

v1 is considered less than v2 if either:

  • v1.size() < v2.size()
  • there is some i such that v1[i] < v2[i]
int add_base_tils ( til_t ti,
const char *  tildir,
const char *  bases,
qstring errbuf 

Add multiple base tils.

titarget til
tildirdirectory where specified tils can be found. NULL means all default til subdirectories.
basescomma separated list of til names
[out]errbuferror message
one of Add TIL result codes
idaman til_t* ida_export load_til ( const char *  name,
qstring errbuf,
const char *  tildir = NULL 

Load til from a file.

Failure to load base tils are reported into 'errbuf'. They do not prevent loading of the main til.

namefilename of the til. If it's an absolute path, tildir is ignored.
  • NB: the file extension is forced to .til
[out]errbuferror message
tildirdirectory where to load the til from. NULL means default til subdirectories.
pointer to resulting til, NULL if failed and error message is in errbuf
idaman bool ida_export sort_til ( til_t ti)

Sort til (use after modifying it).

false if no memory or bad parameter
idaman bool ida_export compact_til ( til_t ti)

Collect garbage in til.

Must be called before storing the til.

true if any memory was freed
idaman bool ida_export store_til ( til_t ti,
const char *  tildir,
const char *  name 

Store til to a file.

If the til contains garbage, it will be collected before storing the til. Your plugin should call compact_til() before calling store_til().

titype library to store
tildirdirectory where to store the til. NULL means current directory.
namefilename of the til. If it's an absolute path, tildir is ignored.
  • NB: the file extension is forced to .til
size_t get_default_align ( void  )

Get default alignment for structure fields.

one of 1,2,4,8,...
void align_size ( size_t &  cur_tot_size,
size_t  elem_size,
size_t  algn 

Get alignment delta for the a structure field.

cur_tot_sizethe structure size calculated so far
elem_sizesize of the current field. the whole structure should be calculated
algnthe structure alignment (0,1,2,4,8...)
idaman bool ida_export deref_ptr ( ea_t ptr_ea,
const tinfo_t tif,
ea_t closure_obj = NULL 

Dereference a pointer.

[out]ptr_eain/out parameter
  • in: address of the pointer
  • out: the pointed address
tiftype of the pointer
[out]closure_objclosure object (not used yet)
idaman bool ida_export remove_tinfo_pointer ( tinfo_t tif,
const char **  pname,
const til_t til = NULL 

Remove pointer of a type.

(i.e. convert "char *" into "char"). Optionally remove the "lp" (or similar) prefix of the input name. If the input type is not a pointer, then fail.

idaman tid_t ida_export import_type ( const til_t til,
int  idx,
const char *  name,
int  flags = 0 

Copy a named type from til to idb.

tiltype library
idxthe position of the new type in the list of types (structures or enums). -1 means at the end of the list
namethe type name
flagscombination of Import type flags
BADNODE on error
idaman int ida_export add_til ( const char *  name,
int  flags 

Load a til file.

nametil name
flagscombination of Load TIL flags
one of Load TIL result codes
idaman bool ida_export apply_named_type ( ea_t  ea,
const char *  name 

Apply the specified named type to the address.

ealinear address
namethe type name, e.g. "FILE"
idaman bool ida_export apply_tinfo ( ea_t  ea,
const tinfo_t tif,
uint32  flags 

Apply the specified type to the specified address.

This function sets the type and tries to convert the item at the specified address to conform the type.

ealinear address
tiftype string in internal format
flagscombination of Apply tinfo flags
idaman bool ida_export apply_cdecl ( til_t til,
ea_t  ea,
const char *  decl,
int  flags = 0 

Apply the specified type to the address.

This function parses the declaration and calls apply_tinfo()

tiltype library
ealinear address
decltype declaration in C form
flagsflags to pass to apply_tinfo (TINFO_DEFINITE is always passed)
idaman bool ida_export apply_callee_tinfo ( ea_t  caller,
const tinfo_t tif 

Apply the type of the called function to the calling instruction.

This function will append parameter comments and rename the local variables of the calling function. It also stores information about the instructions that initialize call arguments in the database. Use get_arg_addrs() to retrieve it if necessary. Alternatively it is possible to hook to processor_t::arg_addrs_ready event.

callerlinear address of the calling instruction. must belong to a function.
tiftype info
idaman bool ida_export get_arg_addrs ( eavec_t out,
ea_t  caller 

Retrieve argument initialization addresses.

This function retrieves information about argument addresses. This information is stored in the database by apply_callee_tinfo().

outlinear addresses of the instructions that load call arguments
calleraddress of the call instruction
idaman bool ida_export apply_once_tinfo_and_name ( ea_t  dea,
const tinfo_t tif,
const char *  name 

Apply the specified type and name to the address.

This function checks if the address already has a type. If the old type
does not exist or the new type is 'better' than the old type, then the
new type will be applied. A type is considered better if it has more
information (e.g. BTMT_STRUCT is better than BT_INT).
The same logic is with the name: if the address already have a meaningful
name, it will be preserved. Only if the old name does not exist or it
is a dummy name like byte_123, it will be replaced by the new name.

dealinear address
tiftype string in the internal format
namenew name for the address
idaman int ida_export guess_tinfo ( tinfo_t tif,
tid_t  id 

Generate a type information about the id from the disassembly.

id can be a structure/union/enum id or an address.

one of Guess tinfo codes
idaman const til_t* ida_export get_idati ( void  )

Pointer to the local type library - this til is private for each IDB file Function that accepts til_t* uses local type library instead of NULL.

idaman bool ida_export get_idainfo_by_type ( size_t *  psize,
flags_t pflags,
opinfo_t mt,
const tinfo_t tif,
size_t *  alsize = NULL 

Extract information from a tinfo_t.

[out]psizesize of tif
[out]pflagsdescription of type using flags_t
[out]mtinfo for non-scalar types
tifthe type to inspect
tinfo_t remove_pointer ( const tinfo_t tif)

BT_PTR: If the current type is a pointer, return the pointed object.

If the current type is not a pointer, return the current type. See also get_ptrarr_object() and get_pointed_object()

idaman error_t ida_export pack_idcobj_to_bv ( const idc_value_t obj,
const tinfo_t tif,
relobj_t bytes,
void *  objoff,
int  pio_flags = 0 

Write a typed idc object to the byte vector.

Byte vector may be non-empty, this function will append data to it

idaman bool ida_export apply_tinfo_to_stkarg ( const insn_t insn,
const op_t x,
uval_t  v,
const tinfo_t tif,
const char *  name 

Helper function for the processor modules.

to be called from processor_t::use_stkarg_type

idaman bool ida_export func_has_stkframe_hole ( ea_t  ea,
const func_type_data_t fti 

Looks for a hole at the beginning of the stack arguments.

Will make use of the IDB's func_t function at that place (if present) to help determine the presence of such a hole.

idaman int ida_export lower_type ( til_t til,
tinfo_t tif,
const char *  name = NULL,
lowertype_helper_t _helper = NULL 

Lower type.

Inspect the type and lower all function subtypes using lower_func_type().
We call the prototypes usually encountered in source files "high level"
They may have implicit arguments, array arguments, big structure retvals, etc
We introduce explicit arguments (i.e. 'this' pointer) and call the result
"low level prototype". See FTI_HIGH.

In order to improve heuristics for recognition of big structure retvals,
it is recommended to pass a helper that will be used to make decisions.
That helper will be used only for lowering 'tif', and not for the children
types walked through by recursion.

Return values
1removed FTI_HIGH,
2made substantial changes
idaman void ida_export begin_type_updating ( update_type_t  utp)

Mark the beginning of a large update operation on the types.

Can be used with add_enum_member(), add_struc_member, etc... Also see end_type_updating()

idaman bool ida_export format_cdata ( qstrvec_t outvec,
const idc_value_t idc_value,
const tinfo_t tif,
valstr_t vtree = NULL,
const format_data_info_t fdi = NULL 

Format a data value as a C initializer.

outvecbuffer for the formatted string(s). may be NULL
idc_valuevalue to format
tiftype of the data to format. if NULL and PTV_DEREF is specified, take tinfo from idb
vtreemore detailed output info
fdiformatting options
success. if failed, see qerrno for more info
idaman int ida_export print_cdata ( text_sink_t printer,
const idc_value_t idc_value,
const tinfo_t tif,
const format_data_info_t fdi = NULL 

The same as format_cdata(), but instead of returning the answer in a vector, print it.

This function can handle very huge data volume without using too much memory. As soon as the output text becomes too long, the function prints it and flushes its internal buffers.

Return values
-1printing failed, check qerrno
elsecode returned by text_sink_t::print()
idaman int ida_export print_decls ( text_sink_t printer,
til_t til,
const ordvec_t ordinals,
uint32  flags 

Print types (and possibly their dependencies) in a format suitable for use in a header file.

This is the reverse parse_decls().

printera handler for printing text
tilthe type library holding the ordinals
ordinalsordinals of types to export. NULL means: all ordinals in til
flagsflags for the algorithm. A combination of PDF_* constants
Return values
>0 the number of types exported
0an error occurred
<0 the negated number of types exported. There were minor errors and the resulting output might not be compilable.
idaman int ida_export calc_number_of_children ( const argloc_t loc,
const tinfo_t tif,
bool  dont_deref_ptr = false 

Calculate max number of lines of a formatted c data, when expanded (PTV_EXPAND).

loclocation of the data (ALOC_STATIC or ALOC_CUSTOM)
tiftype info
dont_deref_ptrconsider 'ea' as the ptr value
Return values
0data is not expandable
-1error, see qerrno
elsethe max number of lines
idaman size_t ida_export format_c_number ( char *  buf,
size_t  bufsize,
uint128  value,
int  size,
int  pcn = 0 

Format a C number.

bufoutput buffer
bufsizesize of the output buffer
valuenumber to format
sizesize of the number in bytes (1,2,4,8,16)
pcncombination of C Number formatting flags
idaman bool ida_export get_enum_member_expr ( qstring buf,
const tinfo_t tif,
int  serial,
uint64  value 

Return a C expression that can be used to represent an enum member.

If the value does not correspond to any single enum member, this function tries to find a bitwise combination of enum members that correspond to it. If more than half of value bits do not match any enum members, it fails.

bufoutput buffer
tifenumeration type
serialwhich enumeration member to use (0 means the first with the given value)
valuevalue to search in the enumeration type. only 32-bit number can be handled yet
idaman bool ida_export choose_named_type ( til_symbol_t out_sym,
const til_t root_til,
const char *  title,
int  ntf_flags,
predicate_t predicate = NULL 

Choose a type from a type library.

out_sympointer to be filled with the chosen type
root_tilpointer to starting til (the function will inspect the base tils if allowed by flags)
titletitle of listbox to display
ntf_flagscombination of Flags for named types
predicatepredicate to select types to display (maybe NULL)
false if nothing is chosen, otherwise true
idaman uint32 ida_export choose_local_tinfo ( const til_t ti,
const char *  title,
local_tinfo_predicate_t func = NULL,
uint32  def_ord = 0,
void *  ud = NULL 

Choose a type from the local type library.

tipointer to til
titletitle of listbox to display
funcpredicate to select types to display (maybe NULL)
def_ordordinal to position cursor before choose
uduser data
== 0 means nothing is chosen, otherwise an ordinal number