IDA SDK

- Main Page
- Header Files
- Classes
- Modules

- File List
- File Members

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

## Detailed Description

Contains the inf structure definition and some functions common to the whole IDA project.

The inf structure is saved in the database and contains information specific to the current program being disassembled. Initially it is filled with values from ida.cfg.

Although it is not a good idea to change values in inf structure (because you will overwrite values taken from ida.cfg), you are allowed to do it if you feel it necessary.

## Classes
struct | compiler_info_t
| Information about the target compiler. More...
struct | idainfo
| The database parameters. More...
struct | dual_text_options_t
| Dual options are different for the text and graph views. More...
struct | text_options_t
| Maintain text options for both flat view and graph view. More...

## Functions
bool idaapi | showRepeatables (void)
| Is IDA configured to show all repeatable comments?
bool idaapi | showAllComments (void)
| Is IDA configured to show all comment lines?
bool idaapi | showComments (void)
| Is IDA configured to show any comments at all?
bool idaapi | should_trace_sp (void)
| Is IDA configured to trace the stack pointer?
bool idaapi | should_create_stkvars (void)
| Is IDA configured to create stack variables?
int | calc_default_idaplace_flags (void)
| Get default disassembly line options (see Disassembly line options)
ea_t idaapi | toEA (sel_t reg_cs, ea_t reg_ip)
| Convert (seg,off) value to a linear address.
idaman char *ida_export | idb2scr (char *name)
| Helper function to convert input/output data (OEM<->ANSI conversions). More...
idaman char *ida_export | scr2idb (char *name)
| Helper function to convert input/output data (OEM<->ANSI conversions). More...
char *idaapi | ansi2idb (char *name)
| Helper function to convert strings from the input file to database encoding under windows.
idaman void ida_export | dto_copy_to_inf (const dual_text_options_t *, idainfo *_inf)
| Helper function for dual_text_options_t::copy_to_inf()
idaman void ida_export | dto_copy_from_inf (dual_text_options_t *, const idainfo *_inf)
| Helper function for dual_text_options_t::copy_from_inf()
idaman void ida_export | dto_init (dual_text_options_t *dt, bool for_graph)
| Helper function for dual_text_options_t::init()

## Macros
#define | EA64_ALIGN(n)
| Maintain 64-bit alignments in 64-bit mode.
#define | LFLG_PC_FPP 0x01
| decode floating point processor instructions?
#define | LFLG_PC_FLAT 0x02
| 32-bit program?
#define | LFLG_64BIT 0x04
| 64-bit program?
#define | LFLG_DBG_NOPATH 0x08
| do not store input full path in debugger process options
#define | LFLG_SNAPSHOT 0x10
| memory snapshot was taken?
#define | LFLG_IS_DLL 0x20
| Is dynamic library?
#define | LFLG_UNUSED 0x40
#define | LFLG_FLAT_OFF32 0x80
| treat REF_OFF32 as 32-bit offset for 16bit segments (otherwise try SEG16:OFF16)
#define | DEMNAM_MASK 3
| mask for name form
#define | DEMNAM_CMNT 0
| display demangled names as comments
#define | DEMNAM_NAME 1
| display demangled names as regular names
#define | DEMNAM_NONE 2
| don't display demangled names
#define | DEMNAM_GCC3 4
| assume gcc3 names (valid for gnu compiler)
#define | DEMNAM_FIRST 8
| override type info
#define | AF_FIXUP 0x0001
| Create offsets and segments using fixup info.
#define | AF_MARKCODE 0x0002
| Mark typical code sequences as code.
#define | AF_UNK 0x0004
| Delete instructions with no xrefs.
#define | AF_CODE 0x0008
| Trace execution flow.
#define | AF_PROC 0x0010
| Create functions if call is present.
#define | AF_USED 0x0020
| Analyze and create all xrefs.
#define | AF_FLIRT 0x0040
| Use flirt signatures.
#define | AF_PROCPTR 0x0080
| Create function if data xref data->code32 exists.
#define | AF_JFUNC 0x0100
| Rename jump functions as j_...
#define | AF_NULLSUB 0x0200
| Rename empty functions as nullsub_...
#define | AF_LVAR 0x0400
| Create stack variables.
#define | AF_TRACE 0x0800
| Trace stack pointer.
#define | AF_ASCII 0x1000
| Create ascii string if data xref exists.
#define | AF_IMMOFF 0x2000
| Convert 32bit instruction operand to offset.
#define | AF_DREFOFF 0x4000
| Create offset if data xref to seg32 exists.
#define | AF_FINAL 0x8000
| Final pass of analysis.
#define | LMT_THIN 0x01
| thin borders
#define | LMT_THICK 0x02
| thick borders
#define | LMT_EMPTY 0x04
| empty lines at the end of basic blocks
#define | INFFL_LZERO 0x01
| generate leading zeroes in numbers
#define | INFFL_ALLASM 0x02
| may use constructs not supported by More...
#define | INFFL_LOADIDC 0x04
| loading an idc file that contains database info
#define | INFFL_NOUSER 0x08
| do not store user info in the database
#define | INFFL_READONLY 0x10
| (internal) temporary interdiction to modify the database
#define | SW_SEGXRF 0x01
| show segments in xrefs?
#define | SW_XRFMRK 0x02
| show xref type marks?
#define | SW_XRFFNC 0x04
| show function offsets?
#define | SW_XRFVAL 0x08
| show xref values? (otherwise-"...")
#define | SW_RPTCMT 0x01
| show repeatable comments?
#define | SW_ALLCMT 0x02
| comment all lines?
#define | SW_NOCMT 0x04
| no comments at all
#define | SW_LINNUM 0x08
| show source line numbers
#define | SW_TESTMODE 0x10
| testida.idc is running
#define | SW_SHHID_ITEM 0x20
| show hidden instructions
#define | SW_SHHID_FUNC 0x40
| show hidden functions
#define | SW_SHHID_SEGM 0x80
| show hidden segments
#define | NM_REL_OFF 0
#define | NM_PTR_OFF 1
#define | NM_NAM_OFF 2
#define | NM_REL_EA 3
#define | NM_PTR_EA 4
#define | NM_NAM_EA 5
#define | NM_EA 6
#define | NM_EA4 7
#define | NM_EA8 8
#define | NM_SHORT 9
#define | NM_SERIAL 10
#define | PREF_SEGADR 0x01
| show segment addresses?
#define | PREF_FNCOFF 0x02
| show function offsets?
#define | PREF_STACK 0x04
| show stack pointer?
#define | PREF_VARMARK 0x08
| show asterisk for variable addresses?
#define | ASCF_GEN 0x01
| generate ASCII names?
#define | ASCF_AUTO 0x02
| ASCII names have 'autogenerated' bit?
#define | ASCF_SERIAL 0x04
| generate serial names?
#define | ASCF_UNICODE 0x08
| unicode strings are present?
#define | ASCF_COMMENT 0x10
| generate auto comment for ascii references?
#define | ASCF_SAVECASE 0x20
| preserve case of ascii strings for identifiers
#define | LN_NORMAL 0x01
| include normal names
#define | LN_PUBLIC 0x02
| include public names
#define | LN_AUTO 0x04
| include autogenerated names
#define | LN_WEAK 0x08
| include weak names
#define | AF2_JUMPTBL 0x0001
| Locate and create jump tables.
#define | AF2_DODATA 0x0002
| Coagulate data segs at the final pass.
#define | AF2_HFLIRT 0x0004
| Automatically hide library functions.
#define | AF2_STKARG 0x0008
| Propagate stack argument information.
#define | AF2_REGARG 0x0010
| Propagate register argument information.
#define | AF2_CHKUNI 0x0020
| Check for unicode strings.
#define | AF2_SIGCMT 0x0040
| Append a signature name comment for recognized anonymous library functions.
#define | AF2_SIGMLT 0x0080
| Allow recognition of several copies of the same function.
#define | AF2_FTAIL 0x0100
| Create function tails.
#define | AF2_DATOFF 0x0200
| Automatically convert data to offsets.
#define | AF2_ANORET 0x0400
| Perform 'no-return' analysis.
#define | AF2_VERSP 0x0800
| Perform full SP-analysis. ( processor_t::verify_sp)
#define | AF2_DOCODE 0x1000
| Coagulate code segs at the final pass.
#define | AF2_TRFUNC 0x2000
| Truncate functions upon code deletion.
#define | AF2_PURDAT 0x4000
| Control flow to data segment is ignored.
#define | AF2_MEMFUNC 0x8000
| Try to guess member function types.
#define | ABI_8ALIGN4 0x00000001
| 4 byte alignment for 8byte scalars (__int64/double) inside structures?
#define | ABI_PACK_STKARGS 0x00000002
| do not align stack arguments to stack slots
#define | ABI_BIGARG_ALIGN 0x00000004
| use natural type alignment for argument if the alignment exceeds native word size More...
#define | ABI_STACK_LDBL 0x00000008
| long double areuments are passed on stack
#define | ABI_STACK_VARARGS 0x00000010
| varargs are always passed on stack (even when there are free registers)
#define | ABI_HARD_FLOAT 0x00000020
| use the floating-point register set
#define | IDAPLACE_HEXDUMP 0x000F
| produce hex dump
#define | IDAPLACE_STACK 0x0010
| produce 2/4/8 bytes per undefined item. More...
#define | IDAPLACE_SEGADDR 0x0040
| display line prefixes with the segment part
#define | MAXADDR 0xFF000000L
#define | IDB_OEM
| IDA databases are in the OEM encoding (user comments, etc)
#define | IDB_EXT32 "idb"
| Database file extension for 32-bit programs.
#define | IDB_EXT64 "i64"
| Database file extension for 64-bit programs.
#define | IDB_EXT IDB_EXT32
| Database file extension.

## Typedefs
typedef uchar | comp_t
| target compiler id
typedef uchar | cm_t
| calling convention and memory model

## Enumerations
enum | filetype_t { f_EXE_old, f_COM_old, f_BIN, f_DRV, f_WIN, f_HEX, f_MEX, f_LX, f_LE, f_NLM, f_COFF, f_PE, f_OMF, f_SREC, f_ZIP, f_OMFLIB, f_AR, f_LOADER, f_ELF, f_W32RUN, f_AOUT, f_PRC, f_EXE, f_COM, f_AIXAR, f_MACHO }
| Known input file formats (kept in idainfo::filetype): More...
enum | storage_type_t { STT_CUR = -1, STT_VA = 0, STT_MM = 1, STT_DBG = 2 }
| Storage types for flag bits. More...

## Variables
idaman idainfo ida_export_data | inf
| program specific information
idaman text_options_t ida_export_data | dto
| text and graph view options

## Macro Definition Documentation

#define ABI_BIGARG_ALIGN 0x00000004

use natural type alignment for argument if the alignment exceeds native word size

(e.g. __int64 argument should be 8byte aligned on some 32bit platforms)

## Enumeration Type Documentation

enum filetype_t

Known input file formats (kept in idainfo::filetype):

Enumerator
f_EXE_old | MS DOS EXE File.
f_COM_old | MS DOS COM File.
f_BIN | Binary File.
f_DRV | MS DOS Driver.
f_WIN | New Executable (NE)
f_HEX | Intel Hex Object File.
f_MEX | MOS Technology Hex Object File.
f_LX | Linear Executable (LX)
f_LE | Linear Executable (LE)
f_NLM | Netware Loadable Module (NLM)
f_COFF | Common Object File Format (COFF)
f_PE | Portable Executable (PE)
f_OMF | Object Module Format.
f_SREC | R-records.
f_ZIP | ZIP file (this file is never loaded to IDA database)
f_OMFLIB | Library of OMF Modules.
f_AR | ar library
f_LOADER | file is loaded using LOADER DLL
f_ELF | Executable and Linkable Format (ELF)
f_W32RUN | Watcom DOS32 Extender (W32RUN)
f_AOUT | Linux a.out (AOUT)
f_PRC | PalmPilot program file.
f_EXE | MS DOS EXE File.
f_COM | MS DOS COM File.
f_AIXAR | AIX ar library.
f_MACHO | Max OS X.

enum storage_type_t

Storage types for flag bits.

Enumerator
STT_CUR | use current storage type (may be used only as a function argument)
STT_VA | regular storage: virtual arrays, an explicit flag for each byte
STT_MM | memory map: sparse storage. useful for huge objects
STT_DBG | memory map: temporary debugger storage. used internally

## Function Documentation

idaman char* ida_export idb2scr | ( | char * | name | ) |

Helper function to convert input/output data (OEM<->ANSI conversions).

Returns
  the destination string

idaman char* ida_export scr2idb | ( | char * | name | ) |

Helper function to convert input/output data (OEM<->ANSI conversions).

Returns
  the destination string