IDA C++ SDK 9.2
Loading...
Searching...
No Matches
Type string related declarations

Type related functions and class. More...

Enumerations

enum  type_source_t {
  GUESSED_NONE , GUESSED_WEAK , GUESSED_FUNC , GUESSED_DATA ,
  TS_NOELL = 0x8000000 , TS_SHRINK = 0x4000000 , TS_DONTREF = 0x2000000 , TS_MASK = 0xE000000
}
 Type source (where the type information comes from) More...

Functions

const char *hexapi dstr (const tinfo_t *tif)
 Print the specified type info.
bool hexapi is_type_correct (const type_t *ptr)
 Verify a type string.
bool hexapi is_small_udt (const tinfo_t &tif)
 Is a small structure or union?
bool hexapi is_nonbool_type (const tinfo_t &type)
 Is definitely a non-boolean type?
bool hexapi is_bool_type (const tinfo_t &type)
 Is a boolean type?
THREAD_SAFE bool is_ptr_or_array (type_t t)
 Is a pointer or array type?
THREAD_SAFE bool is_paf (type_t t)
 Is a pointer, array, or function type?
THREAD_SAFE bool is_inplace_def (const tinfo_t &type)
 Is struct/union/enum definition (not declaration)?
int hexapi partial_type_num (const tinfo_t &type)
 Calculate number of partial subtypes.
tinfo_t hexapi get_float_type (int width)
 Get a type of a floating point value with the specified width.
tinfo_t hexapi get_int_type_by_width_and_sign (int srcwidth, type_sign_t sign)
 Create a type info by width and sign.
tinfo_t hexapi get_unk_type (int size)
 Create a partial type info by width.
tinfo_t hexapi dummy_ptrtype (int ptrsize, bool isfp)
 Generate a dummy pointer type.
tinfo_t hexapi make_pointer (const tinfo_t &type)
 Create a pointer type.
tinfo_t hexapi create_typedef (const char *name)
 Create a reference to a named type.
tinfo_t create_typedef (int n)
 Create a reference to an ordinal type.
bool hexapi get_type (uval_t id, tinfo_t *tif, type_source_t guess)
 Get a global type.
bool hexapi set_type (uval_t id, const tinfo_t &tif, type_source_t source, bool force=false)
 Set a global type.

Detailed Description

Type related functions and class.

Enumeration Type Documentation

◆ type_source_t

Type source (where the type information comes from)

Enumerator
GUESSED_NONE 
GUESSED_WEAK 
GUESSED_FUNC 
GUESSED_DATA 
TS_NOELL 
TS_SHRINK 
TS_DONTREF 
TS_MASK 

Function Documentation

◆ dstr()

const char * dstr ( const tinfo_t * tif)
inline

Print the specified type info.

This function can be used from a debugger by typing "tif->dstr()"

◆ is_type_correct()

bool is_type_correct ( const type_t * ptr)
inline

Verify a type string.

Returns
true if type string is correct

◆ is_small_udt()

bool is_small_udt ( const tinfo_t & tif)
inline

Is a small structure or union?

Returns
true if the type is a small UDT (user defined type). Small UDTs fit into a register (or pair or registers) as a rule.

◆ is_nonbool_type()

bool is_nonbool_type ( const tinfo_t & type)
inline

Is definitely a non-boolean type?

Returns
true if the type is a non-boolean type (non bool and well defined)

◆ is_bool_type()

bool is_bool_type ( const tinfo_t & type)
inline

Is a boolean type?

Returns
true if the type is a boolean type

◆ is_ptr_or_array()

THREAD_SAFE bool is_ptr_or_array ( type_t t)
inline

Is a pointer or array type?

◆ is_paf()

THREAD_SAFE bool is_paf ( type_t t)
inline

Is a pointer, array, or function type?

◆ is_inplace_def()

THREAD_SAFE bool is_inplace_def ( const tinfo_t & type)
inline

Is struct/union/enum definition (not declaration)?

◆ partial_type_num()

int partial_type_num ( const tinfo_t & type)
inline

Calculate number of partial subtypes.

Returns
number of partial subtypes. The bigger is this number, the uglier is the type.

◆ get_float_type()

tinfo_t get_float_type ( int width)
inline

Get a type of a floating point value with the specified width.

Returns
type info object
Parameters
widthwidth of the desired type

◆ get_int_type_by_width_and_sign()

tinfo_t get_int_type_by_width_and_sign ( int srcwidth,
type_sign_t sign )
inline

Create a type info by width and sign.

Returns a simple type (examples: int, short) with the given width and sign.

Parameters
srcwidthsize of the type in bytes
signsign of the type

◆ get_unk_type()

tinfo_t get_unk_type ( int size)
inline

Create a partial type info by width.

Returns a partially defined type (examples: _DWORD, _BYTE) with the given width.

Parameters
sizesize of the type in bytes

◆ dummy_ptrtype()

tinfo_t dummy_ptrtype ( int ptrsize,
bool isfp )
inline

Generate a dummy pointer type.

Parameters
ptrsizesize of pointed object
isfpis floating point object?

◆ make_pointer()

tinfo_t make_pointer ( const tinfo_t & type)
inline

Create a pointer type.

This function performs the following conversion: "type" -> "type*"

Parameters
typeobject type.
Returns
"type*". for example, if 'char' is passed as the argument,

◆ create_typedef() [1/2]

tinfo_t create_typedef ( const char * name)
inline

Create a reference to a named type.

Parameters
nametype name
Returns
type which refers to the specified name. For example, if name is "DWORD", the type info which refers to "DWORD" is created.

◆ create_typedef() [2/2]

tinfo_t create_typedef ( int n)
inline

Create a reference to an ordinal type.

Parameters
nordinal number of the type
Returns
type which refers to the specified ordinal. For example, if n is 1, the type info which refers to ordinal type 1 is created.

◆ get_type()

bool get_type ( uval_t id,
tinfo_t * tif,
type_source_t guess )
inline

Get a global type.

Global types are types of addressable objects and struct/union/enum types

Parameters
idaddress or id of the object
tifbuffer for the answer
guesswhat kind of types to consider
Returns
success

◆ set_type()

bool set_type ( uval_t id,
const tinfo_t & tif,
type_source_t source,
bool force = false )
inline

Set a global type.

Parameters
idaddress or id of the object
tifnew type info
sourcewhere the type comes from
forcetrue means to set the type as is, false means to merge the new type with the possibly existing old type info.
Returns
success