inf_attr

The following functions allow you to set/get common parameters.
Please note that not all parameters can be set directly.

long get_inf_attr(long offset); success set_inf_attr(long offset, long value);

// Set or clear bits in parameter // offset - same as for get_inf_attr()/set_inf_attr() functions // bits - bit mask // on - boolean value, set or clear bits // Convenience function void set_flag(long offset, long bits, long on);

// 'offset' may be one of the following:

#define INF_VERSION 4 // short; Version of database #define INF_PROCNAME 6 // char[16];Name of current processor #define INF_GENFLAGS 22 // ushort; General flags: #define INFFL_AUTO 0x01 // Autoanalysis is enabled? #define INFFL_ALLASM 0x02 // May use constructs not supported by // the target assembler #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 INFFL_CHKOPS 0x20 // check manual operands? #define INFFL_NMOPS 0x40 // allow non-matched operands? #define INFFL_GRAPH_VIEW 0x80 // currently using graph options (\dto{graph}) #define INF_LFLAGS 24 // uint32 IDP-dependent flags #define LFLG_PC_FPP 0x00000001 // decode floating point // processor instructions? #define LFLG_PC_FLAT 0x00000002 // Flat model? #define LFLG_64BIT 0x00000004 // 64-bit program? #define LFLG_IS_DLL 0x00000008 // is dynamic library? #define LFLG_FLAT_OFF32 0x00000010 // treat REF_OFF32 as 32-bit offset for 16bit segments (otherwise try SEG16:OFF16) #define LFLG_MSF 0x00000020 // byte order: is MSB first? #define LFLG_WIDE_HBF 0x00000040 // bit order of wide bytes: high byte first? #define LFLG_DBG_NOPATH 0x00000080 // do not store input full path #define LFLG_SNAPSHOT 0x00000100 // is memory snapshot? #define LFLG_PACK 0x00000200 // pack the database? #define LFLG_COMPRESS 0x00000400 // compress the database? #define LFLG_KERNMODE 0x00000800 // is kernel mode binary?

#define INF_CHANGE_COUNTER 28 // uint32; database change counter; keeps track of byte and segment modifications

#define INF_FILETYPE 32 // short; type of input file (see ida.hpp) #define FT_EXE_OLD 0 // MS DOS EXE File (obsolete) #define FT_COM_OLD 1 // MS DOS COM File (obsolete) #define FT_BIN 2 // Binary File #define FT_DRV 3 // MS DOS Driver #define FT_WIN 4 // New Executable (NE) #define FT_HEX 5 // Intel Hex Object File #define FT_MEX 6 // MOS Technology Hex Object File #define FT_LX 7 // Linear Executable (LX) #define FT_LE 8 // Linear Executable (LE) #define FT_NLM 9 // Netware Loadable Module (NLM) #define FT_COFF 10 // Common Object File Format (COFF) #define FT_PE 11 // Portable Executable (PE) #define FT_OMF 12 // Object Module Format #define FT_SREC 13 // R-records #define FT_ZIP 14 // ZIP file (this file is never loaded to IDA database) #define FT_OMFLIB 15 // Library of OMF Modules #define FT_AR 16 // ar library #define FT_LOADER 17 // file is loaded using LOADER DLL #define FT_ELF 18 // Executable and Linkable Format (ELF) #define FT_W32RUN 19 // Watcom DOS32 Extender (W32RUN) #define FT_AOUT 20 // Linux a.out (AOUT) #define FT_PRC 21 // PalmPilot program file #define FT_EXE 22 // MS DOS EXE File #define FT_COM 23 // MS DOS COM File #define FT_AIXAR 24 // AIX ar library #define FT_MACHO 25 // Mac OS X Mach-O file #define INF_OSTYPE 34 // short; FLIRT: OS type the program is for #define OSTYPE_MSDOS 0x0001 #define OSTYPE_WIN 0x0002 #define OSTYPE_OS2 0x0004 #define OSTYPE_NETW 0x0008 #define INF_APPTYPE 36 // short; FLIRT: Application type #define APPT_CONSOLE 0x0001 // console #define APPT_GRAPHIC 0x0002 // graphics #define APPT_PROGRAM 0x0004 // EXE #define APPT_LIBRARY 0x0008 // DLL #define APPT_DRIVER 0x0010 // DRIVER #define APPT_1THREAD 0x0020 // Singlethread #define APPT_MTHREAD 0x0040 // Multithread #define APPT_16BIT 0x0080 // 16 bit application #define APPT_32BIT 0x0100 // 32 bit application #define INF_ASMTYPE 38 // char; target assembler number (0..n) #define INF_SPECSEGS 39 // uchar; What format do special segments use? 0-unspecified, 4-entries are 4 bytes, 8- entries are 8 bytes // program execution

#define INF_AF 40 // uint32; Analysis flags: #define AF_CODE 0x00000001 // Trace execution flow #define AF_MARKCODE 0x00000002 // Mark typical code sequences as code #define AF_JUMPTBL 0x00000004 // Locate and create jump tables #define AF_PURDAT 0x00000008 // Control flow to data segment is ignored #define AF_USED 0x00000010 // Analyze and create all xrefs #define AF_UNK 0x00000020 // Delete instructions with no xrefs

#define AF_PROCPTR 0x00000040 // Create function if data xref data->code32 exists #define AF_PROC 0x00000080 // Create functions if call is present #define AF_FTAIL 0x00000100 // Create function tails #define AF_LVAR 0x00000200 // Create stack variables #define AF_STKARG 0x00000400 // Propagate stack argument information #define AF_REGARG 0x00000800 // Propagate register argument information #define AF_TRACE 0x00001000 // Trace stack pointer #define AF_VERSP 0x00002000 // Perform full SP-analysis. (\ph{verify_sp}) #define AF_ANORET 0x00004000 // Perform 'no-return' analysis #define AF_MEMFUNC 0x00008000 // Try to guess member function types #define AF_TRFUNC 0x00010000 // Truncate functions upon code deletion

#define AF_STRLIT 0x00020000 // Create string literal if data xref exists #define AF_CHKUNI 0x00040000 // Check for unicode strings #define AF_FIXUP 0x00080000 // Create offsets and segments using fixup info #define AF_DREFOFF 0x00100000 // Create offset if data xref to seg32 exists #define AF_IMMOFF 0x00200000 // Convert 32bit instruction operand to offset #define AF_DATOFF 0x00400000 // Automatically convert data to offsets

#define AF_FLIRT 0x00800000 // Use flirt signatures #define AF_SIGCMT 0x01000000 // Append a signature name comment for recognized anonymous library functions #define AF_SIGMLT 0x02000000 // Allow recognition of several copies of the same function #define AF_HFLIRT 0x04000000 // Automatically hide library functions

#define AF_JFUNC 0x08000000 // Rename jump functions as j_... #define AF_NULLSUB 0x10000000 // Rename empty functions as nullsub_...

#define AF_DODATA 0x20000000 // Coagulate data segs at the final pass #define AF_DOCODE 0x40000000 // Coagulate code segs at the final pass #define AF_FINAL 0x80000000 // Final pass of analysis

#define INF_AF2 44 // uint32; Analysis flags 2

#define AF2_DOEH 0x00000001 // Handle EH information

#define INF_BASEADDR 48 // uval_t; base paragraph of the program #define INF_START_SS 52 // int32; value of SS at the start #define INF_START_CS 56 // int32; value of CS at the start #define INF_START_IP 60 // ea_t; IP register value at the start of #define INF_START_EA 64 // ea_t; Linear address of program entry point #define INF_START_SP 68 // ea_t; SP register value at the start of #define INF_MAIN 72 // ea_t; address of main() #define INF_MIN_EA 76 // ea_t; The lowest address used // in the program #define INF_MAX_EA 80 // ea_t; The highest address used // in the program - 1 #define INF_OMIN_EA 84 #define INF_OMAX_EA 88 #define INF_LOW_OFF 92 // ea_t; low limit of voids #define INF_HIGH_OFF 96 // ea_t; high limit of voids #define INF_MAXREF 100 // uval_t; max xref depth #define INF_START_PRIVRANGE 104 // uval_t; Range of addresses reserved for internal use. #define INF_END_PRIVRANGE 108 // uval_t; Initially (MAXADDR, MAXADDR+0x100000)

#define INF_NETDELTA 112 // sval_t; Delta value to be added to all adresses for mapping to netnodes. // Initially 0. // CROSS REFERENCES #define INF_XREFNUM 116 // char; Number of references to generate // 0 - xrefs won't be generated at all #define INF_TYPE_XREFS 117 // char; Number of references to generate // in the struct & enum windows // 0 - xrefs won't be generated at all #define INF_REFCMTS 118 // uchar; number of comment lines to // generate for refs to ASCII // string or demangled name // 0 - such comments won't be // generated at all #define INF_XREFS 119 // char; xrefs representation: #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-"...")

// NAMES #define INF_MAX_AUTONAME_LEN 120 // ushort; max autogenerated name length (without zero byte) #define INF_NAMETYPE 122 // char; dummy names represenation type #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 INF_SHORT_DN 124 // int32; short form of demangled names #define INF_LONG_DN 128 // int32; long form of demangled names // see demangle.h for definitions #define INF_DEMNAMES 132 // char; display demangled names as: #define DEMNAM_CMNT 0 // comments #define DEMNAM_NAME 1 // regular names #define DEMNAM_NONE 2 // don't display #define DEMNAM_GCC3 4 // assume gcc3 names (valid for gnu compiler) #define DEMNAM_FIRST 8 // override type info #define INF_LISTNAMES 133 // uchar; What names should be included in the list? #define LN_NORMAL 0x01 // normal names #define LN_PUBLIC 0x02 // public names #define LN_AUTO 0x04 // autogenerated names #define LN_WEAK 0x08 // weak names

// DISASSEMBLY LISTING DETAILS #define INF_INDENT 134 // char; Indention for instructions #define INF_COMMENT 135 // char; Indention for comments #define INF_MARGIN 136 // ushort; max length of data lines #define INF_LENXREF 138 // ushort; max length of line with xrefs #define INF_OUTFLAGS 140 // uint32; output flags #define OFLG_SHOW_VOID 0x0002 // Display void marks? #define OFLG_SHOW_AUTO 0x0004 // Display autoanalysis indicator? #define OFLG_GEN_NULL 0x0010 // Generate empty lines? #define OFLG_SHOW_PREF 0x0020 // Show line prefixes? #define OFLG_PREF_SEG 0x0040 // line prefixes with segment name? #define OFLG_LZERO 0x0080 // generate leading zeroes in numbers #define OFLG_GEN_ORG 0x0100 // Generate 'org' directives? #define OFLG_GEN_ASSUME 0x0200 // Generate 'assume' directives? #define OFLG_GEN_TRYBLKS 0x0400 // Generate try/catch directives? #define INF_CMTFLAG 144 // char; comments: #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 INF_BORDER 145 // char; Generate borders? #define INF_BINPREF 146 // short; # of instruction bytes to show // in line prefix #define INF_PREFFLAG 148 // char; line prefix type: #define PREF_SEGADR 0x01 // show segment addresses? #define PREF_FNCOFF 0x02 // show function offsets? #define PREF_STACK 0x04 // show stack pointer?

// STRING LITERALS #define INF_STRLIT_FLAGS 149 // uchar; string literal flags #define STRF_GEN 0x01 // generate names? #define STRF_AUTO 0x02 // names have 'autogenerated' bit? #define STRF_SERIAL 0x04 // generate serial names? #define STRF_COMMENT 0x10 // generate auto comment for string references? #define STRF_SAVECASE 0x20 // preserve case of strings for identifiers #define INF_STRLIT_BREAK 150 // char; string literal line break symbol #define INF_STRLIT_ZEROES 151 // char; leading zeroes #define INF_STRTYPE 152 // int32; current ascii string type // is considered as several bytes: // low byte: // Number of bytes per "units" in a string. #define STRWIDTH_1B 0 #define STRWIDTH_2B 1 #define STRWIDTH_4B 2 #define STRWIDTH_MASK 0x03 // The string layout; how the string is laid out in data. #define STRLYT_TERMCHR 0 #define STRLYT_PASCAL1 1 #define STRLYT_PASCAL2 2 #define STRLYT_PASCAL4 3 #define STRLYT_MASK 0xFC #define STRLYT_SHIFT 2

#define INF_STRLIT_PREF 156 // char[16];ASCII names prefix #define INF_STRLIT_SERNUM 172 // uval_t; serial number

// DATA ITEMS #define INF_DATATYPES 176 // uval_t; data types allowed in data carousel

// COMPILER #define INF_COMPILER 180 // uchar; compiler #define COMP_MASK 0x0F // mask to apply to get the pure compiler id #define COMP_UNK 0x00 // Unknown #define COMP_MS 0x01 // Visual C++ #define COMP_BC 0x02 // Borland C++ #define COMP_WATCOM 0x03 // Watcom C++ #define COMP_GNU 0x06 // GNU C++ #define COMP_VISAGE 0x07 // Visual Age C++ #define COMP_BP 0x08 // Delphi #define INF_MODEL 181 // uchar; memory model & calling convention #define INF_SIZEOF_INT 182 // uchar; sizeof(int) #define INF_SIZEOF_BOOL 183 // uchar; sizeof(bool) #define INF_SIZEOF_ENUM 184 // uchar; sizeof(enum) #define INF_SIZEOF_ALGN 185 // uchar; default alignment #define INF_SIZEOF_SHORT 186 #define INF_SIZEOF_LONG 187 #define INF_SIZEOF_LLONG 188 #define INF_SIZEOF_LDBL 189 // uchar; sizeof(long double) #define INF_ABIBITS 192 // uint32; ABI features #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 (e.g. __int64 argument should be 8byte aligned on some 32bit platforms) #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 ABI_SET_BY_USER 0x00000040 // compiler/abi were set by user flag and require SETCOMP_BY_USER flag to be changed #define INF_APPCALL_OPTIONS 196 // uint32; appcall options

#ifdef _EA64_ // redefine the offsets for 64-bit version #define INF_VERSION 4 #define INF_PROCNAME 6 #define INF_GENFLAGS 22 #define INF_LFLAGS 24 #define INF_CHANGE_COUNTER 28 #define INF_FILETYPE 32 #define INF_OSTYPE 34 #define INF_APPTYPE 36 #define INF_ASMTYPE 38 #define INF_SPECSEGS 39 #define INF_AF 40 #define INF_AF2 44 #define INF_BASEADDR 48 #define INF_START_SS 56 #define INF_START_CS 64 #define INF_START_IP 72 #define INF_START_EA 80 #define INF_START_SP 88 #define INF_MAIN 96 #define INF_MIN_EA 104 #define INF_MAX_EA 112 #define INF_OMIN_EA 120 #define INF_OMAX_EA 128 #define INF_LOW_OFF 136 #define INF_HIGH_OFF 144 #define INF_MAXREF 152 #define INF_START_PRIVRANGE 160 #define INF_END_PRIVRANGE 168 #define INF_NETDELTA 176 #define INF_XREFNUM 184 #define INF_TYPE_XREFS 185 #define INF_REFCMTS 186 #define INF_XREFS 187 #define INF_MAX_AUTONAME_LEN 188 #define INF_NAMETYPE 190 #define INF_SHORT_DN 192 #define INF_LONG_DN 196 #define INF_DEMNAMES 200 #define INF_LISTNAMES 201 #define INF_INDENT 202 #define INF_COMMENT 203 #define INF_MARGIN 204 #define INF_LENXREF 206 #define INF_OUTFLAGS 208 #define INF_CMTFLAG 212 #define INF_BORDER 213 #define INF_BINPREF 214 #define INF_PREFFLAG 216 #define INF_STRLIT_FLAGS 217 #define INF_STRLIT_BREAK 218 #define INF_STRLIT_ZEROES 219 #define INF_STRTYPE 220 #define INF_STRLIT_PREF 224 #define INF_STRLIT_SERNUM 240 #define INF_DATATYPES 248 #define INF_COMPILER 256 #define INF_MODEL 257 #define INF_SIZEOF_INT 258 #define INF_SIZEOF_BOOL 259 #define INF_SIZEOF_ENUM 260 #define INF_SIZEOF_ALGN 261 #define INF_SIZEOF_SHORT 262 #define INF_SIZEOF_LONG 263 #define INF_SIZEOF_LLONG 264 #define INF_SIZEOF_LDBL 265 #define INF_ABIBITS 268 #define INF_APPCALL_OPTIONS 272 #endif // __EA64__

static set_flag(off, bit, value) { auto v = get_inf_attr(off); v = value ? (bit | v) : (~bit & v); return set_inf_attr(off, v); }

Index | Previous topic | Next topic