Module ida_typeinf
[frames] | no frames]

Module ida_typeinf

IDA Plugin SDK API wrapper: typeinf

Classes
  aloc_visitor_t
Proxy of C++ aloc_visitor_t class.
  argloc_t
Proxy of C++ argloc_t class.
  argpart_t
Proxy of C++ argpart_t class.
  argpartvec_t
Proxy of C++ qvector< argpart_t > class.
  array_type_data_t
Proxy of C++ array_type_data_t class.
  bitfield_type_data_t
Proxy of C++ bitfield_type_data_t class.
  callregs_t
Proxy of C++ callregs_t class.
  const_aloc_visitor_t
Proxy of C++ const_aloc_visitor_t class.
  enum_member_t
Proxy of C++ enum_member_t class.
  enum_member_vec_t
Proxy of C++ qvector< enum_member_t > class.
  enum_type_data_t
Proxy of C++ enum_type_data_t class.
  func_type_data_t
Proxy of C++ func_type_data_t class.
  funcarg_t
Proxy of C++ funcarg_t class.
  funcargvec_t
Proxy of C++ qvector< funcarg_t > class.
  ida_lowertype_helper_t
Proxy of C++ ida_lowertype_helper_t class.
  lowertype_helper_t
Proxy of C++ lowertype_helper_t class.
  predicate_t
Proxy of C++ predicate_t class.
  ptr_type_data_t
Proxy of C++ ptr_type_data_t class.
  reginfovec_t
Proxy of C++ qvector< reg_info_t > class.
  regobj_t
Proxy of C++ regobj_t class.
  regobjs_t
Proxy of C++ regobjs_t class.
  regobjvec_t
Proxy of C++ qvector< regobj_t > class.
  rrel_t
Proxy of C++ rrel_t class.
  scattered_aloc_t
Proxy of C++ scattered_aloc_t class.
  simd_info_t
Proxy of C++ simd_info_t class.
  text_sink_t
Proxy of C++ text_sink_t class.
  til_symbol_t
Proxy of C++ til_symbol_t class.
  til_t
Proxy of C++ til_t class.
  tinfo_t
Proxy of C++ tinfo_t class.
  tinfo_visitor_t
Proxy of C++ tinfo_visitor_t class.
  type_attr_t
Proxy of C++ type_attr_t class.
  type_attrs_t
Proxy of C++ qvector< type_attr_t > class.
  type_mods_t
Proxy of C++ type_mods_t class.
  typedef_type_data_t
Proxy of C++ typedef_type_data_t class.
  udt_member_t
Proxy of C++ udt_member_t class.
  udt_type_data_t
Proxy of C++ udt_type_data_t class.
  udtmembervec_t
Proxy of C++ qvector< udt_member_t > class.
  valstr_t
Proxy of C++ valstr_t class.
  valstrs_t
Proxy of C++ valstrs_t class.
  valstrvec_t
Proxy of C++ qvector< valstr_t > class.
Functions
int
add_til(name, flags)
Load a til file.
uint32
alloc_type_ordinal(ti)
\call2{alloc_type_ordinals,ti,1}
uint32
alloc_type_ordinals(ti, qty)
Allocate a range of ordinal numbers for new types.
bool
append_abi_opts(abi_opts, user_level=False)
Add/remove/check ABI option General form of full abi name: abiname- opt1-opt2-...
bool
append_argloc(out, vloc)
Serialize argument location.
bool
append_tinfo_covered(out, typid, offset)
bool
apply_callee_tinfo(caller, tif)
Apply the type of the called function to the calling instruction.
bool
apply_cdecl(til, ea, decl, flags=0)
Apply the specified type to the address.
bool
apply_named_type(ea, name)
Apply the specified named type to the address.
bool
apply_once_tinfo_and_name(dea, tif, name)
Apply the specified type and name to the address.
bool
apply_tinfo(ea, tif, flags)
Apply the specified type to the specified address.
bool
apply_tinfo_to_stkarg(insn, x, v, tif, name)
Helper function for the processor modules.
bool
apply_type(ti, _type, _fields, ea, flags)
Apply the specified type to the address
 
begin_type_updating(utp)
Mark the beginning of a large update operation on the types.
str
calc_c_cpp_name(name, type, ccn_flags)
Get C or C++ form of the name.
int
calc_number_of_children(loc, tif, dont_deref_ptr=False)
Calculate max number of lines of a formatted c data, when expanded ( 'PTV_EXPAND' ).
bool
calc_tinfo_gaps(out, typid)
PyObject *
calc_type_size(ti, tp)
Returns the size of a type
int
callregs_t_regcount(cc)
uint32
choose_local_tinfo(ti, title, func=None, def_ord=0, ud=None)
Choose a type from the local type library.
uint32
choose_local_tinfo_and_delta(delta, ti, title, func=None, def_ord=0, ud=None)
Choose a type from the local type library and specify the pointer shift value.
bool
choose_named_type(out_sym, root_til, title, ntf_flags, predicate=None)
Choose a type from a type library.
 
clear_tinfo_t(_this)
bool
compact_til(ti)
Collect garbage in til.
bool
compare_tinfo(t1, t2, tcflags)
int
convert_pt_flags_to_hti(pt_flags)
Convert 'Type parsing flags' to 'Type formatting flags' .
uint32
copy_named_type(dsttil, srctil, name)
Copy a named type from one til to another.
 
copy_tinfo_t(_this, r)
str
create_numbered_type_name(ord)
Create anonymous name for numbered type.
bool
create_tinfo(_this, bt, bt2, ptr)
comp_t
default_compiler()
Get compiler specified by \varmem{inf,idainfo,cc}.
bool
del_named_type(ti, name, ntf_flags)
Delete information about a symbol.
bool
del_numbered_type(ti, ordinal)
Delete a numbered type.
bool
del_til(name)
Unload a til file.
bool
del_tinfo_attr(tif, key, make_copy)
bool
deref_ptr(ptr_ea, tif, closure_obj=None)
Dereference a pointer.
bool
deserialize_tinfo(tif, til, ptype, pfields, pfldcmts)
char const *
dstr_tinfo(tif)
str
dump_func_type_data(fti, praloc_bits)
Use 'func_type_data_t::dump()'
 
end_type_updating(utp)
Mark the end of a large update operation on the types (see 'begin_type_updating()' )
bool
extract_argloc(vloc, ptype, is_retval)
Deserialize argument location.
int
find_tinfo_udt_member(udm, typid, strmem_flags)
char const *
first_named_type(ti, ntf_flags)
Enumerate types.
int
for_all_arglocs(vv, vloc, size, off=0)
Compress larger argloc types and initiate the aloc visitor.
int
for_all_const_arglocs(vv, vloc, size, off=0)
See 'for_all_arglocs()'
 
free_til(ti)
Free memory allocated by til.
bool
func_has_stkframe_hole(ea, fti)
Looks for a hole at the beginning of the stack arguments.
bool
gcc_layout()
Should use the struct/union layout as done by gcc?
str
gen_decorate_name(name, mangle, cc, type)
Generic function for 'decorate_name()' (may be used in IDP modules)
 
gen_use_arg_tinfos(caller, fti, rargs, set_optype, is_stkarg_load, has_delay_slot)
The main function using these callbacks:
str
get_abi_name()
Get ABI name.
uint32
get_alias_target(ti, ordinal)
Find the final alias destination.
PyObject *
get_arg_addrs(caller)
Retrieve addresses of argument initialization instructions
type_t
get_base_type(t)
Get get basic type bits ( 'TYPE_BASE_MASK' )
str
get_c_header_path()
Get the include directory path of the target compiler.
str
get_c_macros()
Get predefined macros for the target compiler.
comp_t
get_comp(comp)
Get compiler bits.
char const *
get_compiler_abbr(id)
Get abbreviated compiler name.
char const *
get_compiler_name(id)
Get full compiler name.
 
get_compilers(ids, names, abbrs)
Get names of all built-in compilers.
str
get_enum_member_expr(tif, serial, value)
Return a C expression that can be used to represent an enum member.
type_t
get_full_type(t)
Get basic type bits + type flags ( 'TYPE_FULL_MASK' )
bool
get_idainfo_by_type(tif)
Extract information from a 'tinfo_t' .
til_t
get_idati()
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.
PyObject *
get_named_type(til, name, ntf_flags)
Get a type data by its name.
PyObject *
get_named_type64(til, name, ntf_flags)
See 'get_named_type()' above.If the value in the 'ti' library is 32-bit, it will be sign-extended before being stored in the 'value' pointer.
PyObject *
get_numbered_type(til, ordinal)
Retrieve a type by its ordinal number.
char const *
get_numbered_type_name(ti, ordinal)
Get type name (if exists) by its ordinal.
int
get_ordinal_from_idb_type(name, type)
Get ordinal number of an idb type (struct/enum).
uint32
get_ordinal_qty(ti)
Get number of allocated ordinals.
type_t
get_scalar_bt(size)
bool
get_stock_tinfo(tif, id)
bool
get_tinfo_attr(typid, key, bv, all_attrs)
bool
get_tinfo_attrs(typid, tav, include_ref_attrs)
bool
get_tinfo_details(typid, bt2, buf)
size_t
get_tinfo_pdata(outptr, typid, what)
size_t
get_tinfo_property(typid, gta_prop)
size_t
get_tinfo_size(p_effalign, typid, gts_code)
type_t
get_type_flags(t)
Get type flags ( 'TYPE_FLAGS_MASK' )
int32
get_type_ordinal(ti, name)
Get type ordinal by its name.
cm_t
guess_func_cc(fti, npurged, cc_flags)
Use 'func_type_data_t::guess_cc()'
int
guess_tinfo(tif, id)
Generate a type information about the id from the disassembly.
int
idc_get_local_type(ordinal, flags, buf, maxsize)
str
idc_get_local_type_name(ordinal)
PyObject *
idc_get_local_type_raw(ordinal)
str
idc_get_type(ea)
PyObject *
idc_get_type_raw(ea)
str
idc_guess_type(ea)
PyObject *
idc_parse_decl(ti, decl, flags)
int
idc_parse_types(input, flags)
PyObject *
idc_print_type(_type, _fields, name, flags)
int
idc_set_local_type(ordinal, dcl, flags)
tid_t
import_type(til, idx, name, flags=0)
Copy a named type from til to idb.
bool
is_autosync(name, type)
is_autosync(name, tif) -> bool
bool
is_code_far(cm)
Does the given model specify far code?.
comp_t
is_comp_unsure(comp)
See 'COMP_UNSURE' .
bool
is_data_far(cm)
Does the given model specify far data?.
bool
is_gcc()
Is the target compiler 'COMP_GNU' ?
bool
is_gcc32()
Is the target compiler 32 bit gcc?
bool
is_gcc64()
Is the target compiler 64 bit gcc?
bool
is_ordinal_name(name, ord=None)
Check if the name is an ordinal name.
bool
is_purging_cc(cm)
Does the calling convention clean the stack arguments upon return?.this function is valid only for x86 code
bool
is_restype_enum(til, type)
bool
is_restype_struct(til, type)
bool
is_restype_struni(til, type)
bool
is_restype_void(til, type)
bool
is_sdacl_byte(t)
Identify an sdacl byte.
bool
is_tah_byte(t)
The TAH byte (type attribute header byte) denotes the start of type attributes.
bool
is_type_arithmetic(t)
Is the type an arithmetic type? (floating or integral)
bool
is_type_array(t)
See 'BT_ARRAY' .
bool
is_type_bitfld(t)
See 'BT_BITFIELD' .
bool
is_type_bool(t)
See 'BTF_BOOL' .
bool
is_type_char(t)
Does the type specify a char value? (signed or unsigned, see 'Basic type: integer' )
bool
is_type_complex(t)
See 'BT_COMPLEX' .
bool
is_type_const(t)
See 'BTM_CONST' .
bool
is_type_double(t)
See 'BTF_DOUBLE' .
bool
is_type_enum(t)
See 'BTF_ENUM' .
bool
is_type_ext_arithmetic(t)
Is the type an extended arithmetic type? (arithmetic or enum)
bool
is_type_ext_integral(t)
Is the type an extended integral type? (integral or enum)
bool
is_type_float(t)
See 'BTF_FLOAT' .
bool
is_type_floating(t)
Is the type a floating point type?
bool
is_type_func(t)
See 'BT_FUNC' .
bool
is_type_int(bt)
Does the type_t specify one of the basic types in 'Basic type: integer' ?
bool
is_type_int128(t)
Does the type specify a 128-bit value? (signed or unsigned, see 'Basic type: integer' )
bool
is_type_int16(t)
Does the type specify a 16-bit value? (signed or unsigned, see 'Basic type: integer' )
bool
is_type_int32(t)
Does the type specify a 32-bit value? (signed or unsigned, see 'Basic type: integer' )
bool
is_type_int64(t)
Does the type specify a 64-bit value? (signed or unsigned, see 'Basic type: integer' )
bool
is_type_integral(t)
Is the type an integral type (char/short/int/long/bool)?
bool
is_type_ldouble(t)
See 'BTF_LDOUBLE' .
bool
is_type_paf(t)
Is the type a pointer, array, or function type?
bool
is_type_partial(t)
Identifies an unknown or void type with a known size (see 'Basic type: unknown & void' )
bool
is_type_ptr(t)
See 'BT_PTR' .
bool
is_type_ptr_or_array(t)
Is the type a pointer or array type?
bool
is_type_struct(t)
See 'BTF_STRUCT' .
bool
is_type_struni(t)
Is the type a struct or union?
bool
is_type_sue(t)
Is the type a struct/union/enum?
bool
is_type_tbyte(t)
See 'BTF_FLOAT' .
bool
is_type_typedef(t)
See 'BTF_TYPEDEF' .
bool
is_type_uchar(t)
See 'BTF_UCHAR' .
bool
is_type_uint(t)
See 'BTF_UINT' .
bool
is_type_uint128(t)
See 'BTF_UINT128' .
bool
is_type_uint16(t)
See 'BTF_UINT16' .
bool
is_type_uint32(t)
See 'BTF_UINT32' .
bool
is_type_uint64(t)
See 'BTF_UINT64' .
bool
is_type_union(t)
See 'BTF_UNION' .
bool
is_type_unknown(t)
See 'BT_UNKNOWN' .
bool
is_type_void(t)
See 'BTF_VOID' .
bool
is_type_volatile(t)
See 'BTM_VOLATILE' .
bool
is_typeid_last(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_user_cc(cm)
Does the calling convention specify argument locations explicitly?
bool
is_vararg_cc(cm)
Does the calling convention use ellipsis?
int
lexcompare_tinfo(t1, t2, arg3)
til_t
load_til(name, tildir=None)
Load til from a file.
til_t
load_til_header(tildir, name)
Get human-readable til description.
int
lower_type(til, tif, name=None, _helper=None)
Lower type.
til_t
new_til(name, desc)
Initialize a til.
char const *
next_named_type(ti, name, ntf_flags)
Enumerate types.
bool
optimize_argloc(vloc, size, gaps)
Verify and optimize scattered argloc into simple form.
error_t
pack_idcobj_to_bv(obj, tif, bytes, objoff, pio_flags=0)
Write a typed idc object to the byte vector.
error_t
pack_idcobj_to_idb(obj, tif, ea, pio_flags=0)
Write a typed idc object to the database.
PyObject *
pack_object_to_bv(py_obj, ti, _type, _fields, base_ea, pio_flags=0)
Packs a typed object to a string
PyObject *
pack_object_to_idb(py_obj, ti, _type, _fields, ea, pio_flags=0)
Write a typed object to the database.
str
parse_decl(tif, til, decl, flags)
Parse ONE declaration.
int
parse_decls(til, input, printer, hti_flags)
Parse many declarations and store them in a til.
str
print_argloc(vloc, size=0, vflags=0)
Convert an argloc to human readable form.
PyObject *
print_decls(printer, til, py_ordinals, flags)
Print types (and possibly their dependencies) in a format suitable for use in a header file.
str
print_tinfo(prefix, indent, cmtindent, flags, tif, name, cmt)
str
print_type(ea, prtype_flags)
Get type declaration for the specified address.
uint64
read_tinfo_bitfield_value(typid, v, bitoff)
bool
remove_abi_opts(abi_opts, user_level=False)
tinfo_t
remove_pointer(tif)
'BT_PTR' : If the current type is a pointer, return the pointed object.
PyObject *
remove_tinfo_pointer(tif, name, til)
Remove pointer of a type.
int
replace_ordinal_typerefs(til, tif)
Replace references to ordinal types by name references.
type_t const *
resolve_typedef(til, type)
tinfo_code_t
save_tinfo(tif, til, ord, name, ntf_flags)
uint32
score_tinfo(tif)
bool
serialize_tinfo(type, fields, fldcmts, tif, sudt_flags)
bool
set_abi_name(abiname, user_level=False)
Set abi name (see 'Compiler IDs' )
 
set_c_header_path(incdir)
Set include directory path the target compiler.
 
set_c_macros(macros)
Set predefined macros for the target compiler.
bool
set_compiler(cc, flags, abiname=None)
Change current compiler.
bool
set_compiler_id(id, abiname=None)
Set the compiler id (see 'Compiler IDs' )
bool
set_compiler_string(compstr, user_level)
tinfo_code_t
set_numbered_type(ti, ordinal, ntf_flags, name, type, fields=None, cmt=None, fldcmts=None, sclass=None)
Store a type in the til.
bool
set_tinfo_attr(tif, ta, may_overwrite)
bool
set_tinfo_attrs(tif, ta)
size_t
set_tinfo_property(tif, sta_prop, x)
bool
set_type_alias(ti, src_ordinal, dst_ordinal)
Create a type alias.
bool
store_til(ti, tildir, name)
Store til to a file.
tinfo_t
tinfo_t_get_stock(id)
error_t
unpack_idcobj_from_bv(obj, tif, bytes, pio_flags=0)
Read a typed idc object from the byte vector.
error_t
unpack_idcobj_from_idb(obj, tif, ea, off0, pio_flags=0)
Collection of register objects.
PyObject *
unpack_object_from_bv(ti, _type, _fields, bytes, pio_flags=0)
Unpacks a buffer into an object.
PyObject *
unpack_object_from_idb(ti, _type, _fields, ea, pio_flags=0)
int
verify_argloc(vloc, size, gaps)
Verify 'argloc_t' .
int
verify_tinfo(typid)
int
visit_subtypes(visitor, out, tif, name, cmt)
uint64
write_tinfo_bitfield_value(typid, dst, v, bitoff)
Variables
  ADDTIL_ABORTED = 3
  ADDTIL_COMP = 2
  ADDTIL_DEFAULT = 0
  ADDTIL_FAILED = 0
  ADDTIL_INCOMP = 1
  ADDTIL_OK = 1
  ADDTIL_SILENT = 2
  ALOC_CUSTOM = 7
  ALOC_DIST = 2
  ALOC_NONE = 0
  ALOC_REG1 = 3
  ALOC_REG2 = 4
  ALOC_RREL = 5
  ALOC_STACK = 1
  ALOC_STATIC = 6
  ARGREGS_BY_SLOTS = 3
  ARGREGS_FP_CONSUME_GP = 4
  ARGREGS_GP_ONLY = 1
  ARGREGS_INDEPENDENT = 2
  ARGREGS_POLICY_UNDEFINED = 0
  BADORD = 4294967295
  BADSIZE = 18446744073709551615
  BFA_FUNC_EXT_FORMAT = 128
  BFA_HIGH = 4
  BFA_NORET = 1
  BFA_PURE = 2
  BFA_STATIC = 8
  BFA_VIRTUAL = 16
  BTE_ALWAYS = 128
  BTE_BITFIELD = 16
  BTE_CHAR = 32
  BTE_HEX = 0
  BTE_OUT_MASK = 96
  BTE_RESERVED = 8
  BTE_SDEC = 64
  BTE_SIZE_MASK = 7
  BTE_UDEC = 96
  BTF_BOOL = 8
  BTF_BYTE = 17
  BTF_CHAR = 50
  BTF_DOUBLE = 25
  BTF_ENUM = 45
  BTF_FLOAT = 9
  BTF_INT = 7
  BTF_INT128 = 22
  BTF_INT16 = 19
  BTF_INT32 = 20
  BTF_INT64 = 21
  BTF_INT8 = 18
  BTF_LDOUBLE = 41
  BTF_SINT = 23
  BTF_STRUCT = 13
  BTF_TBYTE = 57
  BTF_TYPEDEF = 61
  BTF_UCHAR = 34
  BTF_UINT = 39
  BTF_UINT128 = 38
  BTF_UINT16 = 35
  BTF_UINT32 = 36
  BTF_UINT64 = 37
  BTF_UINT8 = 34
  BTF_UNION = 29
  BTF_UNK = 48
  BTF_VOID = 1
  BTMT_ARRESERV = 32
  BTMT_BFLDI16 = 16
  BTMT_BFLDI32 = 32
  BTMT_BFLDI64 = 48
  BTMT_BFLDI8 = 0
  BTMT_BOOL1 = 16
  BTMT_BOOL2 = 32
  BTMT_BOOL4 = 48
  BTMT_BOOL8 = 32
  BTMT_CHAR = 48
  BTMT_CLOSURE = 48
  BTMT_DEFBOOL = 0
  BTMT_DEFCALL = 0
  BTMT_DEFPTR = 0
  BTMT_DOUBLE = 16
  BTMT_ENUM = 32
  BTMT_FAR = 32
  BTMT_FARCALL = 32
  BTMT_FLOAT = 0
  BTMT_INTCALL = 48
  BTMT_LNGDBL = 32
  BTMT_NEAR = 16
  BTMT_NEARCALL = 16
  BTMT_NONBASED = 16
  BTMT_SIGNED = 16
  BTMT_SIZE0 = 0
  BTMT_SIZE12 = 16
  BTMT_SIZE128 = 48
  BTMT_SIZE48 = 32
  BTMT_SPECFLT = 48
  BTMT_STRUCT = 0
  BTMT_TYPEDEF = 48
  BTMT_UNION = 16
  BTMT_UNKSIGN = 0
  BTMT_UNSIGNED = 32
  BTMT_USIGNED = 32
  BTM_CONST = 64
  BTM_VOLATILE = 128
  BT_ARRAY = 11
  BT_BITFIELD = 14
  BT_BOOL = 8
  BT_COMPLEX = 13
  BT_FLOAT = 9
  BT_FUNC = 12
  BT_INT = 7
  BT_INT128 = 6
  BT_INT16 = 3
  BT_INT32 = 4
  BT_INT64 = 5
  BT_INT8 = 2
  BT_PTR = 10
  BT_RESERVED = 15
  BT_SEGREG = 55
  BT_UNK = 0
  BT_UNKNOWN = 48
  BT_UNK_BYTE = 17
  BT_UNK_DWORD = 33
  BT_UNK_OWORD = 49
  BT_UNK_QWORD = 32
  BT_UNK_WORD = 16
  BT_VOID = 1
  CCN_C = 0
  CCN_CPP = 1
  CC_ALLOW_ARGPERM = 2
  CC_ALLOW_REGHOLES = 4
  CC_CDECL_OK = 1
  CC_HAS_ELLIPSIS = 8
  CM_CC_CDECL = 48
  CM_CC_ELLIPSIS = 64
  CM_CC_FASTCALL = 112
  CM_CC_INVALID = 0
  CM_CC_MANUAL = 144
  CM_CC_MASK = 240
  CM_CC_PASCAL = 96
  CM_CC_RESERVE3 = 192
  CM_CC_RESERVE4 = 176
  CM_CC_SPECIAL = 240
  CM_CC_SPECIALE = 208
  CM_CC_SPECIALP = 224
  CM_CC_SPOILED = 160
  CM_CC_STDCALL = 80
  CM_CC_THISCALL = 128
  CM_CC_UNKNOWN = 16
  CM_CC_VOIDARG = 32
  CM_MASK = 3
  CM_M_FF = 4
  CM_M_FN = 12
  CM_M_MASK = 12
  CM_M_NF = 8
  CM_M_NN = 0
  CM_N16_F32 = 2
  CM_N32_F48 = 3
  CM_N64 = 1
  CM_N8_F16 = 1
  CM_UNKNOWN = 0
  COMP_BC = 2
  COMP_BP = 8
  COMP_GNU = 6
  COMP_MASK = 15
  COMP_MS = 1
  COMP_UNK = 0
  COMP_UNSURE = 128
  COMP_VISAGE = 7
  COMP_WATCOM = 3
  C_PC_COMPACT = 10
  C_PC_FLAT = 3
  C_PC_HUGE = 6
  C_PC_LARGE = 6
  C_PC_MEDIUM = 14
  C_PC_SMALL = 2
  C_PC_TINY = 2
  FAH_BYTE = 255
  FAI_ARRAY = 8
  FAI_HIDDEN = 1
  FAI_RETPTR = 2
  FAI_STRUCT = 4
  FIRST_NONTRIVIAL_TYPID = 256
  FMTFUNC_PRINTF = 0
  FMTFUNC_SCANF = 1
  FMTFUNC_STRFMON = 3
  FMTFUNC_STRFTIME = 2
  FTI_ALL = 511
  FTI_ARGLOCS = 256
  FTI_CALLTYPE = 192
  FTI_DEFCALL = 0
  FTI_FARCALL = 128
  FTI_HIGH = 8
  FTI_INTCALL = 192
  FTI_NEARCALL = 64
  FTI_NORET = 2
  FTI_PURE = 4
  FTI_SPOILED = 1
  FTI_STATIC = 16
  FTI_VIRTUAL = 32
  GTD_CALC_ARGLOCS = 0
  GTD_CALC_LAYOUT = 0
  GTD_DEL_BITFLDS = 64
  GTD_NO_ARGLOCS = 128
  GTD_NO_LAYOUT = 128
  GTS_BASECLASS = 2
  GTS_NESTED = 1
  GUESS_FUNC_FAILED = 0
  GUESS_FUNC_OK = 2
  GUESS_FUNC_TRIVIAL = 1
  HTI_CPP = 1
  HTI_DCL = 1024
  HTI_EXT = 4
  HTI_FIL = 64
  HTI_HIGH = 32768
  HTI_INT = 2
  HTI_LEX = 8
  HTI_LOWER = 65536
  HTI_MAC = 128
  HTI_NDC = 2048
  HTI_NER = 512
  HTI_NWR = 256
  HTI_PAK = 28672
  HTI_PAK1 = 4096
  HTI_PAK16 = 20480
  HTI_PAK2 = 8192
  HTI_PAK4 = 12288
  HTI_PAK8 = 16384
  HTI_PAKDEF = 0
  HTI_PAK_SHIFT = 12
  HTI_RAWARGS = 131072
  HTI_TST = 32
  HTI_UNP = 16
  IMPTYPE_LOCAL = 4
  IMPTYPE_OVERRIDE = 2
  IMPTYPE_VERBOSE = 1
  MAX_DECL_ALIGN = 15
  MAX_FUNC_ARGS = 256
  NTF_64BIT = 64
  NTF_CHKSYNC = 512
  NTF_FIXNAME = 128
  NTF_IDBENC = 256
  NTF_NOBASE = 2
  NTF_NOCUR = 32
  NTF_REPLACE = 4
  NTF_SYMM = 0
  NTF_SYMU = 8
  NTF_TYPE = 1
  NTF_UMANGLED = 8
  PCN_CHR = 3
  PCN_DEC = 0
  PCN_DECSEXT = 64
  PCN_HEX = 1
  PCN_LZHEX = 16
  PCN_NEGSIGN = 32
  PCN_OCT = 2
  PCN_RADIX = 7
  PCN_UNSIGNED = 8
  PDF_DEF_BASE = 4
  PDF_DEF_FWD = 2
  PDF_HEADER_CMT = 8
  PDF_INCL_DEPS = 1
  PIO_IGNORE_PTRS = 8
  PIO_NOATTR_FAIL = 4
  PRALOC_STKOFF = 2
  PRALOC_VERIFY = 1
  PRTYPE_1LINE = 0
  PRTYPE_COLORED = 2048
  PRTYPE_CPP = 16
  PRTYPE_DEF = 32
  PRTYPE_MULTI = 1
  PRTYPE_NOARGS = 64
  PRTYPE_NOARRS = 128
  PRTYPE_NOREGEX = 1024
  PRTYPE_NORES = 256
  PRTYPE_PRAGMA = 4
  PRTYPE_RESTORE = 512
  PRTYPE_SEMI = 8
  PRTYPE_TYPE = 2
  PT_FILE = 65536
  PT_HIGH = 128
  PT_LOWER = 256
  PT_NDC = 2
  PT_PACKMASK = 112
  PT_RAWARGS = 1024
  PT_REPLACE = 512
  PT_SIL = 1
  PT_TYP = 4
  PT_VAR = 8
  RESERVED_BYTE = 255
  SETCOMP_BY_USER = 8
  SETCOMP_ONLY_ABI = 4
  SETCOMP_ONLY_ID = 2
  SETCOMP_OVERRIDE = 1
  STI_ACCHAR = 12
  STI_ACHAR = 10
  STI_ACUCHAR = 13
  STI_AEABI_LCMP = 17
  STI_AEABI_MEMCLR = 24
  STI_AEABI_MEMCPY = 22
  STI_AEABI_MEMSET = 23
  STI_AEABI_ULCMP = 18
  STI_AUCHAR = 11
  STI_DONT_USE = 19
  STI_FDELOP = 15
  STI_FPURGING = 14
  STI_LAST = 28
  STI_MSGSEND = 16
  STI_PBYTE = 4
  STI_PCCHAR = 2
  STI_PCHAR = 0
  STI_PCUCHAR = 3
  STI_PCVOID = 9
  STI_PINT = 5
  STI_PPVOID = 8
  STI_PUCHAR = 1
  STI_PUINT = 6
  STI_PVOID = 7
  STI_RTC_CHECK_2 = 25
  STI_RTC_CHECK_4 = 26
  STI_RTC_CHECK_8 = 27
  STI_SIZE_T = 20
  STI_SSIZE_T = 21
  STRMEM_ANON = -2147483648
  STRMEM_AUTO = 2
  STRMEM_CASTABLE_TO = 1073741824
  STRMEM_INDEX = 1
  STRMEM_MASK = 7
  STRMEM_MAXS = 7
  STRMEM_MINS = 6
  STRMEM_NAME = 3
  STRMEM_OFFSET = 0
  STRMEM_SIZE = 5
  STRMEM_SKIP_EMPTY = 536870912
  STRMEM_TYPE = 4
  STRMEM_VFTABLE = 268435456
  SUDT_ALIGN = 2
  SUDT_CONST = 64
  SUDT_FAST = 16
  SUDT_GAPS = 4
  SUDT_SORT = 1
  SUDT_TRUNC = 256
  SUDT_UNEX = 8
  SUDT_VOLATILE = 128
  SWIG_PYTHON_LEGACY_BOOL = 1
  TAENUM_64BIT = 32
  TAENUM_SIGNED = 128
  TAENUM_UNSIGNED = 64
  TAFLD_BASECLASS = 32
  TAFLD_UNALIGNED = 64
  TAFLD_VFTABLE = 256
  TAFLD_VIRTBASE = 128
  TAH_ALL = 496
  TAH_BYTE = 254
  TAH_HASATTRS = 16
  TAPTR_PTR32 = 32
  TAPTR_PTR64 = 64
  TAPTR_RESTRICT = 96
  TAPTR_SHIFTED = 128
  TAUDT_CPPOBJ = 128
  TAUDT_MSSTRUCT = 32
  TAUDT_UNALIGNED = 64
  TAUDT_VFTABLE = 256
  TA_FORMAT = 'format'
  TA_ORG_ARRDIM = '__org_arrdim'
  TA_ORG_TYPEDEF = '__org_typedef'
  TCMP_ANYBASE = 64
  TCMP_AUTOCAST = 2
  TCMP_CALL = 8
  TCMP_DECL = 32
  TCMP_DELPTR = 16
  TCMP_EQUAL = 0
  TCMP_IGNMODS = 1
  TCMP_MANCAST = 4
  TCMP_SKIPTHIS = 128
  TERR_BADSYNC = -4
  TERR_OK = 0
  TERR_SAVE = -1
  TERR_SERIALIZE = -2
  TERR_WRONGNAME = -3
  TIL_ADD_ALREADY = 2
  TIL_ADD_FAILED = 0
  TIL_ADD_OK = 1
  TIL_ALI = 32
  TIL_ESI = 4
  TIL_MAC = 2
  TIL_MOD = 64
  TIL_ORD = 16
  TIL_SLD = 256
  TIL_STM = 128
  TIL_UNI = 8
  TIL_ZIP = 1
  TINFO_DEFINITE = 1
  TINFO_DELAYFUNC = 2
  TINFO_GUESSED = 0
  TINFO_STRICT = 4
  TPOS_LNNUM = '\x05'
  TVIS_CMT = 4
  TVIS_NAME = 2
  TVIS_TYPE = 1
  TVST_DEF = 2
  TVST_LEVEL = 4
  TVST_PRUNE = 1
  TYPE_BASE_MASK = 15
  TYPE_FLAGS_MASK = 48
  TYPE_FULL_MASK = 63
  TYPE_MODIF_MASK = 192
  TYPID_ISREF = 256
  TYPID_SHIFT = 9
  UTP_ENUM = 0
  UTP_STRUCT = 1
  VALSTR_OPEN = 1
  VTBL_MEMNAME = '__vftable'
  VTBL_SUFFIX = '_vtbl'
  __package__ = None
  abs_no = 1
  abs_unk = 0
  abs_yes = 2
  cvar = ??
  no_sign = 0
  sc_auto = 5
  sc_ext = 2
  sc_friend = 6
  sc_reg = 4
  sc_stat = 3
  sc_type = 1
  sc_unk = 0
  sc_virt = 7
  type_signed = 1
  type_unsigned = 2
Function Details

add_til(name, flags)

 

Load a til file.

Parameters:
  • name - til name (C++: const char *)
  • flags - combination of Load TIL flags (C++: int)
Returns: int
one of Load TIL result codes

alloc_type_ordinal(ti)

 

\call2{alloc_type_ordinals,ti,1}

Parameters:
  • ti, (C++ - til_t *)
Returns: uint32

alloc_type_ordinals(ti, qty)

 

Allocate a range of ordinal numbers for new types.

Parameters:
  • ti - type library (C++: til_t *)
  • qty - number of ordinals to allocate (C++: int)
Returns: uint32
the first ordinal. 0 means failure.

append_abi_opts(abi_opts, user_level=False)

 

Add/remove/check ABI option General form of full abi name: abiname- opt1-opt2-... or -opt1-opt2-...

Parameters:
  • abi_opts - - ABI options to add/remove in form opt1-opt2-... (C++: const char *)
  • user_level - - initiated by user if TRUE (==SETCOMP_BY_USER) (C++: bool)
Returns: bool
success

append_argloc(out, vloc)

 

Serialize argument location.

Parameters:
  • out, (C++ - qtype *)
  • vloc, (C++ - const argloc_t &)
Returns: bool

apply_callee_tinfo(caller, 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.

Parameters:
  • caller - linear address of the calling instruction. must belong to a function. (C++: ea_t)
  • tif - type info (C++: const tinfo_t &)
Returns: bool
success

apply_cdecl(til, ea, decl, flags=0)

 

Apply the specified type to the address. This function parses the declaration and calls 'apply_tinfo()'

Parameters:
  • til - type library (C++: til_t *)
  • ea - linear address (C++: ea_t)
  • decl - type declaration in C form (C++: const char *)
  • flags - flags to pass to apply_tinfo ( TINFO_DEFINITE is always passed) (C++: int)
Returns: bool
success

apply_named_type(ea, name)

 

Apply the specified named type to the address.

Parameters:
  • ea - linear address (C++: ea_t)
  • name - the type name, e.g. "FILE" (C++: const char *)
Returns: bool
success

apply_once_tinfo_and_name(dea, tif, name)

 

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

Parameters:
  • dea - linear address (C++: ea_t)
  • tif - type string in the internal format (C++: const tinfo_t &)
  • name - new name for the address (C++: const char *)
Returns: bool
success

apply_tinfo(ea, tif, 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.

Parameters:
  • ea - linear address (C++: ea_t)
  • tif - type string in internal format (C++: const tinfo_t &)
  • flags - combination of Apply tinfo flags (C++: uint32)
Returns: bool
success

apply_tinfo_to_stkarg(insn, x, v, tif, name)

 

Helper function for the processor modules. to be called from \ph{use_stkarg_type}

Parameters:
  • insn, (C++ - const insn_t &)
  • x, (C++ - const op_t &)
  • v, (C++ - uval_t)
  • tif, (C++ - const tinfo_t &)
  • name, (C++ - const char *)
Returns: bool

apply_type(ti, _type, _fields, ea, flags)

 

Apply the specified type to the address

Parameters:
  • ti - Type info library. 'None' can be used.
  • py_type - type string
  • py_fields - fields string (may be empty or None)
  • ea - the address of the object
  • flags - combination of TINFO_... constants or 0
Returns: bool
Boolean

begin_type_updating(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()'

Parameters:
  • utp, (C++ - update_type_t)

calc_c_cpp_name(name, type, ccn_flags)

 

Get C or C++ form of the name.

Parameters:
  • name - original (mangled or decorated) name (C++: const char *)
  • type - name type if known, otherwise NULL (C++: const tinfo_t *)
  • ccn_flags - one of C/C++ naming flags (C++: int)
Returns: str

calc_number_of_children(loc, tif, dont_deref_ptr=False)

 

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

Parameters:
  • loc - location of the data ( ALOC_STATIC or ALOC_CUSTOM ) (C++: const argloc_t &)
  • tif - type info (C++: const tinfo_t &)
  • dont_deref_ptr - consider 'ea' as the ptr value (C++: bool)
Returns: int

calc_type_size(ti, tp)

 

Returns the size of a type

Parameters:
  • ti - Type info. 'None' can be passed.
  • tp - type string
Returns: PyObject *
  • None on failure
  • The size of the type

choose_local_tinfo(ti, title, func=None, def_ord=0, ud=None)

 

Choose a type from the local type library.

Parameters:
  • ti - pointer to til (C++: const til_t *)
  • title - title of listbox to display (C++: const char *)
  • func - predicate to select types to display (maybe NULL) (C++: local_tinfo_predicate_t *)
  • def_ord - ordinal to position cursor before choose (C++: uint32)
  • ud - user data (C++: void *)
Returns: uint32
== 0 means nothing is chosen, otherwise an ordinal number

choose_local_tinfo_and_delta(delta, ti, title, func=None, def_ord=0, ud=None)

 

Choose a type from the local type library and specify the pointer shift value.

Parameters:
  • delta - pointer shift value (C++: int32 *)
  • ti - pointer to til (C++: const til_t *)
  • title - title of listbox to display (C++: const char *)
  • func - predicate to select types to display (maybe NULL) (C++: local_tinfo_predicate_t *)
  • def_ord - ordinal to position cursor before choose (C++: uint32)
  • ud - user data (C++: void *)
Returns: uint32
== 0 means nothing is chosen, otherwise an ordinal number

choose_named_type(out_sym, root_til, title, ntf_flags, predicate=None)

 

Choose a type from a type library.

Parameters:
  • out_sym - pointer to be filled with the chosen type (C++: til_symbol_t *)
  • root_til - pointer to starting til (the function will inspect the base tils if allowed by flags) (C++: const til_t *)
  • title - title of listbox to display (C++: const char *)
  • ntf_flags - combination of Flags for named types (C++: int)
  • predicate - predicate to select types to display (maybe NULL) (C++: predicate_t *)
Returns: bool
false if nothing is chosen, otherwise true

compact_til(ti)

 

Collect garbage in til. Must be called before storing the til.

Parameters:
  • ti, (C++ - til_t *)
Returns: bool
true if any memory was freed

convert_pt_flags_to_hti(pt_flags)

 

Convert 'Type parsing flags' to 'Type formatting flags' . Type parsing flags lesser than 0x10 don't have stable meaning and will be ignored (more on these flags can be seen in idc.idc)

Parameters:
  • pt_flags, (C++ - int)
Returns: int

copy_named_type(dsttil, srctil, name)

 

Copy a named type from one til to another. This function will copy the specified type and all dependent types from the source type library to the destination library.

Parameters:
  • dsttil - Destination til. It must have orginal types enabled (C++: til_t *)
  • srctil - Source til. (C++: const til_t *)
  • name - name of the type to copy (C++: const char *)
Returns: uint32
ordinal number of the copied type. 0 means error

create_numbered_type_name(ord)

 

Create anonymous name for numbered type. This name can be used to reference a numbered type by its ordinal Ordinal names have the following format: '#' + set_de(ord) Returns: -1 if error, otherwise the name length

Parameters:
  • ord, (C++ - int32)
Returns: str

del_named_type(ti, name, ntf_flags)

 

Delete information about a symbol.

Parameters:
  • ti - type library (C++: til_t *)
  • name - name of symbol (C++: const char *)
  • ntf_flags - combination of Flags for named types (C++: int)
Returns: bool
success

del_numbered_type(ti, ordinal)

 

Delete a numbered type.

Parameters:
  • ti, (C++ - til_t *)
  • ordinal, (C++ - uint32)
Returns: bool

del_til(name)

 

Unload a til file.

Parameters:
  • name, (C++ - const char *)
Returns: bool

deref_ptr(ptr_ea, tif, closure_obj=None)

 

Dereference a pointer.

Parameters:
  • ptr_ea - in/out parameter in: address of the pointer out: the pointed address (C++: ea_t *)
  • tif - type of the pointer (C++: const tinfo_t &)
  • closure_obj - closure object (not used yet) (C++: ea_t *)
Returns: bool
success

dump_func_type_data(fti, praloc_bits)

 

Use 'func_type_data_t::dump()'

Parameters:
  • fti, (C++ - const func_type_data_t &)
  • praloc_bits, (C++ - int)
Returns: str

end_type_updating(utp)

 

Mark the end of a large update operation on the types (see 'begin_type_updating()' )

Parameters:
  • utp, (C++ - update_type_t)

extract_argloc(vloc, ptype, is_retval)

 

Deserialize argument location.

Parameters:
  • vloc, (C++ - argloc_t *)
  • ptype, (C++ - const type_t **)
  • is_retval, (C++ - bool)
Returns: bool

first_named_type(ti, ntf_flags)

 

Enumerate types. Returns mangled names. Never returns anonymous types. To include it, enumerate types by ordinals.

Parameters:
  • ti, (C++ - const til_t *)
  • ntf_flags, (C++ - int)
Returns: char const *

for_all_arglocs(vv, vloc, size, off=0)

 

Compress larger argloc types and initiate the aloc visitor.

Parameters:
  • vv, (C++ - aloc_visitor_t &)
  • vloc, (C++ - argloc_t &)
  • size, (C++ - int)
  • off, (C++ - int)
Returns: int

for_all_const_arglocs(vv, vloc, size, off=0)

 

See 'for_all_arglocs()'

Parameters:
  • vv, (C++ - const_aloc_visitor_t &)
  • vloc, (C++ - const argloc_t &)
  • size, (C++ - int)
  • off, (C++ - int)
Returns: int

free_til(ti)

 

Free memory allocated by til.

Parameters:
  • ti, (C++ - til_t *)

func_has_stkframe_hole(ea, 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.

Parameters:
  • ea, (C++ - ea_t)
  • fti, (C++ - const func_type_data_t &)
Returns: bool

gen_decorate_name(name, mangle, cc, type)

 

Generic function for 'decorate_name()' (may be used in IDP modules)

Parameters:
  • name, (C++ - const char *)
  • mangle, (C++ - bool)
  • cc, (C++ - cm_t)
  • type, (C++ - const tinfo_t *)
Returns: str

gen_use_arg_tinfos(caller, fti, rargs, set_optype, is_stkarg_load, has_delay_slot)

 

The main function using these callbacks:

Parameters:
  • caller, (C++ - ea_t)
  • fti, (C++ - func_type_data_t *)
  • rargs, (C++ - funcargvec_t *)
  • set_optype, (C++ - set_op_tinfo_t *)
  • is_stkarg_load, (C++ - is_stkarg_load_t *)
  • has_delay_slot, (C++ - has_delay_slot_t *)

get_abi_name()

 

Get ABI name.

Returns: str
length of the name (>=0)

get_alias_target(ti, ordinal)

 

Find the final alias destination. If the ordinal has not been aliased, return the specified ordinal itself If failed, returns 0.

Parameters:
  • ti, (C++ - const til_t *)
  • ordinal, (C++ - uint32)
Returns: uint32

get_arg_addrs(caller)

 

Retrieve addresses of argument initialization instructions

Parameters:
  • caller - the address of the call instruction
Returns: PyObject *
list of instruction addresses

get_base_type(t)

 

Get get basic type bits ( 'TYPE_BASE_MASK' )

Parameters:
  • t, (C++ - type_t)
Returns: type_t

get_comp(comp)

 

Get compiler bits.

Parameters:
  • comp, (C++ - comp_t)
Returns: comp_t

get_compiler_abbr(id)

 

Get abbreviated compiler name.

Parameters:
  • id, (C++ - comp_t)
Returns: char const *

get_compiler_name(id)

 

Get full compiler name.

Parameters:
  • id, (C++ - comp_t)
Returns: char const *

get_compilers(ids, names, abbrs)

 

Get names of all built-in compilers.

Parameters:
  • ids, (C++ - compvec_t *)
  • names, (C++ - qstrvec_t *)
  • abbrs, (C++ - qstrvec_t *)

get_enum_member_expr(tif, serial, 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.

Parameters:
  • tif - enumeration type (C++: const tinfo_t &)
  • serial - which enumeration member to use (0 means the first with the given value) (C++: int)
  • value - value to search in the enumeration type. only 32-bit number can be handled yet (C++: uint64)
Returns: str
success

get_full_type(t)

 

Get basic type bits + type flags ( 'TYPE_FULL_MASK' )

Parameters:
  • t, (C++ - type_t)
Returns: type_t

get_idainfo_by_type(tif)

 

Extract information from a 'tinfo_t' .

Parameters:
  • tif - the type to inspect (C++: const tinfo_t &)
Returns: bool

get_named_type(til, name, ntf_flags)

 

Get a type data by its name.

Parameters:
  • til - the type library
  • name - the type name
  • ntf_flags - a combination of NTF_* constants
Returns: PyObject *
None on failure tuple(code, type_str, fields_str, cmt, field_cmts, sclass, value) on success

get_named_type64(til, name, ntf_flags)

 

See 'get_named_type()' above.If the value in the 'ti' library is 32-bit, it will be sign-extended before being stored in the 'value' pointer.

Parameters:
  • name, (C++ - const char *)
  • ntf_flags, (C++ - int)
Returns: PyObject *

get_numbered_type(til, ordinal)

 

Retrieve a type by its ordinal number.

Parameters:
  • ordinal, (C++ - uint32)
Returns: PyObject *

get_numbered_type_name(ti, ordinal)

 

Get type name (if exists) by its ordinal. If the type is anonymous, returns "". If failed, returns NULL

Parameters:
  • ti, (C++ - const til_t *)
  • ordinal, (C++ - uint32)
Returns: char const *

get_ordinal_from_idb_type(name, type)

 

Get ordinal number of an idb type (struct/enum). The 'type' parameter is used only to determine the kind of the type (struct or enum) Use this function to find out the correspondence between idb types and til types

Parameters:
  • name, (C++ - const char *)
  • type, (C++ - const type_t *)
Returns: int

get_ordinal_qty(ti)

 

Get number of allocated ordinals.

Parameters:
  • ti, (C++ - const til_t *)
Returns: uint32
uint32(-1) if failed

get_type_flags(t)

 

Get type flags ( 'TYPE_FLAGS_MASK' )

Parameters:
  • t, (C++ - type_t)
Returns: type_t

get_type_ordinal(ti, name)

 

Get type ordinal by its name.

Parameters:
  • ti, (C++ - const til_t *)
  • name, (C++ - const char *)
Returns: int32

guess_func_cc(fti, npurged, cc_flags)

 

Use 'func_type_data_t::guess_cc()'

Parameters:
  • fti, (C++ - const func_type_data_t &)
  • npurged, (C++ - int)
  • cc_flags, (C++ - int)
Returns: cm_t

guess_tinfo(tif, id)

 

Generate a type information about the id from the disassembly. id can be a structure/union/enum id or an address.

Parameters:
  • tif, (C++ - tinfo_t *)
  • id, (C++ - tid_t)
Returns: int
one of Guess tinfo codes

import_type(til, idx, name, flags=0)

 

Copy a named type from til to idb.

Parameters:
  • til - type library (C++: const til_t *)
  • idx - the position of the new type in the list of types (structures or enums). -1 means at the end of the list (C++: int)
  • name - the type name (C++: const char *)
  • flags - combination of Import type flags (C++: int)
Returns: tid_t
BADNODE on error

is_autosync(name, type)

 

is_autosync(name, tif) -> bool

Is the specified idb type automatically synchronized?

Parameters:
  • name, (C++ - const char *)
  • type, (C++ - const type_t *)
Returns: bool

is_code_far(cm)

 

Does the given model specify far code?.

Parameters:
  • cm, (C++ - cm_t)
Returns: bool

is_comp_unsure(comp)

 

See 'COMP_UNSURE' .

Parameters:
  • comp, (C++ - comp_t)
Returns: comp_t

is_data_far(cm)

 

Does the given model specify far data?.

Parameters:
  • cm, (C++ - cm_t)
Returns: bool

is_ordinal_name(name, ord=None)

 

Check if the name is an ordinal name. Ordinal names have the following format: '#' + set_de(ord)

Parameters:
  • name, (C++ - const char *)
  • ord, (C++ - uint32 *)
Returns: bool

is_purging_cc(cm)

 

Does the calling convention clean the stack arguments upon return?.this function is valid only for x86 code

Parameters:
  • cm, (C++ - cm_t)
Returns: bool

is_sdacl_byte(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)

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_tah_byte(t)

 

The TAH byte (type attribute header byte) denotes the start of type attributes. (see "tah-typeattrs" in the type bit definitions)

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_arithmetic(t)

 

Is the type an arithmetic type? (floating or integral)

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_array(t)

 

See 'BT_ARRAY' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_bitfld(t)

 

See 'BT_BITFIELD' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_bool(t)

 

See 'BTF_BOOL' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_char(t)

 

Does the type specify a char value? (signed or unsigned, see 'Basic type: integer' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_complex(t)

 

See 'BT_COMPLEX' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_const(t)

 

See 'BTM_CONST' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_double(t)

 

See 'BTF_DOUBLE' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_enum(t)

 

See 'BTF_ENUM' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_ext_arithmetic(t)

 

Is the type an extended arithmetic type? (arithmetic or enum)

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_ext_integral(t)

 

Is the type an extended integral type? (integral or enum)

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_float(t)

 

See 'BTF_FLOAT' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_floating(t)

 

Is the type a floating point type?

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_func(t)

 

See 'BT_FUNC' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_int(bt)

 

Does the type_t specify one of the basic types in 'Basic type: integer' ?

Parameters:
  • bt, (C++ - type_t)
Returns: bool

is_type_int128(t)

 

Does the type specify a 128-bit value? (signed or unsigned, see 'Basic type: integer' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_int16(t)

 

Does the type specify a 16-bit value? (signed or unsigned, see 'Basic type: integer' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_int32(t)

 

Does the type specify a 32-bit value? (signed or unsigned, see 'Basic type: integer' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_int64(t)

 

Does the type specify a 64-bit value? (signed or unsigned, see 'Basic type: integer' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_integral(t)

 

Is the type an integral type (char/short/int/long/bool)?

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_ldouble(t)

 

See 'BTF_LDOUBLE' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_paf(t)

 

Is the type a pointer, array, or function type?

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_partial(t)

 

Identifies an unknown or void type with a known size (see 'Basic type: unknown & void' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_ptr(t)

 

See 'BT_PTR' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_ptr_or_array(t)

 

Is the type a pointer or array type?

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_struct(t)

 

See 'BTF_STRUCT' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_struni(t)

 

Is the type a struct or union?

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_sue(t)

 

Is the type a struct/union/enum?

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_tbyte(t)

 

See 'BTF_FLOAT' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_typedef(t)

 

See 'BTF_TYPEDEF' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_uchar(t)

 

See 'BTF_UCHAR' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_uint(t)

 

See 'BTF_UINT' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_uint128(t)

 

See 'BTF_UINT128' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_uint16(t)

 

See 'BTF_UINT16' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_uint32(t)

 

See 'BTF_UINT32' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_uint64(t)

 

See 'BTF_UINT64' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_union(t)

 

See 'BTF_UNION' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_unknown(t)

 

See 'BT_UNKNOWN' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_void(t)

 

See 'BTF_VOID' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_type_volatile(t)

 

See 'BTM_VOLATILE' .

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_typeid_last(t)

 

Is the type_t the last byte of type declaration? (there are no additional bytes after a basic type, see '_BT_LAST_BASIC' )

Parameters:
  • t, (C++ - type_t)
Returns: bool

is_user_cc(cm)

 

Does the calling convention specify argument locations explicitly?

Parameters:
  • cm, (C++ - cm_t)
Returns: bool

is_vararg_cc(cm)

 

Does the calling convention use ellipsis?

Parameters:
  • cm, (C++ - cm_t)
Returns: bool

load_til(name, tildir=None)

 

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

Parameters:
  • name - filename of the til. If it's an absolute path, tildir is ignored. NB: the file extension is forced to .til (C++: const char *)
  • tildir - directory where to load the til from. NULL means default til subdirectories. (C++: const char *)
Returns: til_t
pointer to resulting til, NULL if failed and error message is in errbuf

load_til_header(tildir, name)

 

Get human-readable til description.

Parameters:
  • tildir, (C++ - const char *)
  • name, (C++ - const char *)
Returns: til_t

lower_type(til, tif, name=None, _helper=None)

 

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, etcWe 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 childrentypes walked through by recursion.

Parameters:
  • til, (C++ - til_t *)
  • tif, (C++ - tinfo_t *)
  • name, (C++ - const char *)
  • _helper, (C++ - lowertype_helper_t *)
Returns: int

new_til(name, desc)

 

Initialize a til.

Parameters:
  • name, (C++ - const char *)
  • desc, (C++ - const char *)
Returns: til_t

next_named_type(ti, name, ntf_flags)

 

Enumerate types. Returns mangled names. Never returns anonymous types. To include it, enumerate types by ordinals.

Parameters:
  • ti, (C++ - const til_t *)
  • name, (C++ - const char *)
  • ntf_flags, (C++ - int)
Returns: char const *

optimize_argloc(vloc, size, gaps)

 

Verify and optimize scattered argloc into simple form. All new arglocs must be processed by this function.

Parameters:
  • vloc, (C++ - argloc_t *)
  • size, (C++ - int)
  • gaps, (C++ - const rangeset_t *)
Returns: bool

pack_idcobj_to_bv(obj, tif, bytes, objoff, 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

Parameters:
  • obj, (C++ - const idc_value_t *)
  • tif, (C++ - const tinfo_t &)
  • bytes, (C++ - relobj_t *)
  • objoff, (C++ - void *)
  • pio_flags, (C++ - int)
Returns: error_t

pack_idcobj_to_idb(obj, tif, ea, pio_flags=0)

 

Write a typed idc object to the database.

Parameters:
  • obj, (C++ - const idc_value_t *)
  • tif, (C++ - const tinfo_t &)
  • ea, (C++ - ea_t)
  • pio_flags, (C++ - int)
Returns: error_t

pack_object_to_bv(py_obj, ti, _type, _fields, base_ea, pio_flags=0)

 

Packs a typed object to a string

Parameters:
  • ti - Type info. 'None' can be passed.
  • tp - type string
  • fields - fields string (may be empty or None)
  • base_ea - base ea used to relocate the pointers in the packed object
  • pio_flags - flags used while unpacking
Returns: PyObject *
tuple(0, err_code) on failure tuple(1, packed_buf) on success

pack_object_to_idb(py_obj, ti, _type, _fields, ea, pio_flags=0)

 

Write a typed object to the database. Raises an exception if wrong parameters were passed or conversion fails Returns the error_t returned by idaapi.pack_object_to_idb

Parameters:
  • ti - Type info. 'None' can be passed.
  • tp - type string
  • fields - fields string (may be empty or None)
  • ea - ea to be used while packing
  • pio_flags - flags used while unpacking
Returns: PyObject *

parse_decl(tif, til, decl, flags)

 

Parse ONE declaration. If the input string contains more than one declaration, the first complete type declaration ( 'PT_TYP' ) or the last variable declaration ( 'PT_VAR' ) will be used.name & tif may be empty after the call!

Parameters:
  • tif - type info (C++: tinfo_t *)
  • til - type library to use. may be NULL (C++: til_t *)
  • decl - C declaration to parse (C++: const char *)
  • flags - combination of Type parsing flags bits (C++: int)
Returns: str

parse_decls(til, input, printer, hti_flags)

 

Parse many declarations and store them in a til. If there are any errors, they will be printed using 'printer'. This function uses default include path and predefined macros from the database settings. It always uses the 'HTI_DCL' bit.

Parameters:
  • til - type library to store the result (C++: til_t *)
  • input - input string or file name (see hti_flags) (C++: const char *)
  • printer - function to output error messages (use msg or NULL or your own callback) (C++: printer_t *)
  • hti_flags - combination of Type formatting flags (C++: int)
Returns: int
number of errors, 0 means ok.

print_argloc(vloc, size=0, vflags=0)

 

Convert an argloc to human readable form.

Parameters:
  • vloc, (C++ - const argloc_t &)
  • size, (C++ - int)
  • vflags, (C++ - int)
Returns: str

print_decls(printer, til, py_ordinals, flags)

 

Print types (and possibly their dependencies) in a format suitable for use in a header file. This is the reverse 'parse_decls()' .

Parameters:
  • printer - a handler for printing text (C++: text_sink_t &)
  • til - the type library holding the ordinals (C++: til_t *)
  • flags - flags for the algorithm. A combination of PDF_* constants (C++: uint32)
Returns: PyObject *

print_type(ea, prtype_flags)

 

Get type declaration for the specified address.

Parameters:
  • ea - address (C++: ea_t)
  • prtype_flags - combination of Type printing flags (C++: int)
Returns: str
success

remove_pointer(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()

@param tif (C++: const  tinfo_t  &)

Returns: tinfo_t

remove_tinfo_pointer(tif, name, til)

 

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.

Parameters:
  • tif, (C++ - tinfo_t *)
  • til, (C++ - const til_t *)
Returns: PyObject *

replace_ordinal_typerefs(til, tif)

 

Replace references to ordinal types by name references. This function 'unties' the type from the current local type library and makes it easier to export it.

Parameters:
  • til - type library to use. may be NULL. (C++: til_t *)
  • tif - type to modify (in/out) (C++: tinfo_t *)
Returns: int

set_abi_name(abiname, user_level=False)

 

Set abi name (see 'Compiler IDs' )

Parameters:
  • abiname, (C++ - const char *)
  • user_level, (C++ - bool)
Returns: bool

set_c_header_path(incdir)

 

Set include directory path the target compiler.

Parameters:
  • incdir, (C++ - const char *)

set_c_macros(macros)

 

Set predefined macros for the target compiler.

Parameters:
  • macros, (C++ - const char *)

set_compiler(cc, flags, abiname=None)

 

Change current compiler.

Parameters:
  • cc - compiler to switch to (C++: const compiler_info_t &)
  • flags - Set compiler flags (C++: int)
  • abiname - ABI name (C++: const char *)
Returns: bool
success

set_compiler_id(id, abiname=None)

 

Set the compiler id (see 'Compiler IDs' )

Parameters:
  • id, (C++ - comp_t)
  • abiname, (C++ - const char *)
Returns: bool

set_numbered_type(ti, ordinal, ntf_flags, name, type, fields=None, cmt=None, fldcmts=None, sclass=None)

 

Store a type in the til. 'name' may be NULL for anonymous types. The specified ordinal must be free (no other type is using it). For ntf_flags, only 'NTF_REPLACE' is consulted.

Parameters:
  • ti, (C++ - til_t *)
  • ordinal, (C++ - uint32)
  • ntf_flags, (C++ - int)
  • name, (C++ - const char *)
  • type, (C++ - const type_t *)
  • fields, (C++ - const p_list *)
  • cmt, (C++ - const char *)
  • fldcmts, (C++ - const p_list *)
  • sclass, (C++ - const sclass_t *)
Returns: tinfo_code_t

set_type_alias(ti, src_ordinal, dst_ordinal)

 

Create a type alias. Redirects all references to source type to the destination type. This is equivalent to instantaneous replacement all reference to srctype by dsttype.

Parameters:
  • ti, (C++ - til_t *)
  • src_ordinal, (C++ - uint32)
  • dst_ordinal, (C++ - uint32)
Returns: bool

store_til(ti, tildir, 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()' .

Parameters:
  • ti - type library to store (C++: til_t *)
  • tildir - directory where to store the til. NULL means current directory. (C++: const char *)
  • name - filename of the til. If it's an absolute path, tildir is ignored. NB: the file extension is forced to .til (C++: const char *)
Returns: bool
success

unpack_idcobj_from_bv(obj, tif, bytes, pio_flags=0)

 

Read a typed idc object from the byte vector.

Parameters:
  • obj, (C++ - idc_value_t *)
  • tif, (C++ - const tinfo_t &)
  • bytes, (C++ - const bytevec_t &)
  • pio_flags, (C++ - int)
Returns: error_t

unpack_idcobj_from_idb(obj, tif, ea, off0, pio_flags=0)

 

Collection of register objects.

Read a typed idc object from the database

Parameters:
  • obj, (C++ - idc_value_t *)
  • tif, (C++ - const tinfo_t &)
  • ea, (C++ - ea_t)
  • off0, (C++ - const bytevec_t *)
  • pio_flags, (C++ - int)
Returns: error_t

unpack_object_from_bv(ti, _type, _fields, bytes, pio_flags=0)

 

Unpacks a buffer into an object. Returns the error_t returned by idaapi.pack_object_to_idb

Parameters:
  • ti - Type info. 'None' can be passed.
  • tp - type string
  • fields - fields string (may be empty or None)
  • bytes - the bytes to unpack
  • pio_flags - flags used while unpacking
Returns: PyObject *
  • tuple(0, err) on failure
  • tuple(1, obj) on success

verify_argloc(vloc, size, gaps)

 

Verify 'argloc_t' .

Parameters:
  • vloc, (C++ - const argloc_t &)
  • size - total size of the variable (C++: int)
  • gaps - if not NULL, specifies gaps in structure definition. these gaps should not map to any argloc, but everything else must be covered (C++: const rangeset_t *)
Returns: int
0 if ok, otherwise an interr code.