# Configuration

The decompiler has a configuration file. It is installed into the 'cfg' subdirectory of the IDA installation. The configuration file is named 'hexrays.cfg'. It is a simple text file, which can be edited to your taste. Currently the following keywords are defined:

## LOCTYPE\_BGCOLOR

Background color of local type declarations. Currently this color is not used.\
Default: default background of the disassembly view

## VARDECL\_BGCOLOR

Background color of local variable declarations. It is specified as a hexadecimal number 0xBBGGRR where BB is the blue component, GG is the green component, and RR is the red component. Color -1 means the default background color (usually white).\
Default: default background of the disassembly view

## FUNCBODY\_BGCOLOR

Background color of the function body. It is specified the same way as VARDECL\_BGCOLOR.\
Default: default background of the disassembly view

## MARK\_BGCOLOR

Background color of the function if it is [marked as decompiled](https://docs.hex-rays.com/9.0/user-guide/decompiler/interactive/cmd_mark). It is specified the same way as VARDECL\_BGCOLOR.\
Default: very light green

## BLOCK\_INDENT

Number of spaces to use for block indentations.\
Default: 2

## COMMENT\_INDENT

The position to start indented comments.\
Default: 48

## RIGHT\_MARGIN

As soon as the line length approaches this value, the decompiler will try to split it. However, it some cases the line may be longer.\
Default: 120

## MAX\_NCOMMAS

In order to keep the expressions relatively simple, the decompiler limits the number of comma operators in an expression. If there are too many of them, the decompiler will add a goto statement and replace the expression with a block statement. For example, instead of

```
   if ( cond || (x=*p,y=func(),x+y0) )
     body;
```

we may end up with:

```
   if ( cond )
     goto LABEL;
   x = *p;
   y = func();
   if ( x + y  0 )
 LABEL:
     body;
```

\
Default: 8

## DEFAULT\_RADIX

Specifies the default radix for numeric constants. Possible values: 0, 10, 16. Zero means "decimal for signed, hex for unsigned".\
Default: 0

## MAX\_FUNCSIZE

Specifies the maximal decompilable function size, in KBs. Only reachable basic blocks are taken into consideration.\
Default: 64

## HEXOPTIONS

Combination of various analysis and display options:

### HO\_JUMPOUT\_HELPERS

If enabled, the decompiler will handle out-of-function jumps by generating a call to the JUMPOUT() function. If disables, such functions will not be decompiled.\
Default: enabled

### HO\_DISPLAY\_CASTS

If enabled, the decompiler will display cast operators in the output listing.\
Default: enabled

### HO\_HIDE\_UNORDERED

If enabled, the decompiler will hide unordered floating point comparisons. If this option is turned off, unordered comparisons will be displayed as calls to a helper function: \_\_UNORDERED\_\_(a, b)\
Default: enabled

### HO\_SSE\_INTRINSICS

If enabled, the decompiler will generate [intrinsic functions](https://docs.hex-rays.com/9.0/user-guide/decompiler/intrinsics) for SSE instructions that use XMM/MMX registers. If this option is turned off, these instructions will be displayed using inline assembly.\
Default: enabled

### HO\_IGNORE\_OVERLAPS

If enabled, the decompiler will produce output even if the local variable allocation has failed. In this case the output may be wrong and will contain some [overlapped variables](https://docs.hex-rays.com/9.0/user-guide/decompiler/overvars).\
Default: enabled

### HO\_FAST\_STRUCTURAL

If enabled, fast structural analysis will be used. It generates less number of nested if-statements but may occasionally produce some unnecessary gotos. It is much faster on huge functions.

### HO\_CONST\_STRINGS

Only print string literals if they reside in read-only memory (e.g. .rodata segment). When off, all strings are printed as literals. You can override decompiler's decision by adding 'const' or 'volatile' to the string variable's type declaration.

### HO\_SIGNBIT\_CHECKS

Convert signed comparisons of unsigned variables with zero into bit checks.\
Before:

```
   (signed int)x < 0
```

After:

```
   (x & 0x80000000) != 0
```

For signed variables, perform the opposite conversion.

### HO\_UNMERGE\_TAILS

Reverse effects of branch tail optimizations: reduce number of gotos by duplicating code

### HO\_KEEP\_CURLIES

Keep curly braces for single-statement blocks

### HO\_DEL\_ADDR\_CMPS

Optimize away address comparisons.\
Example:

```
   &a < &b
 
```

will be replaced by 0 or 1.\
This optimization works only for non-relocatable files.

### HO\_SHOW\_CSTR\_CASTS

Print casts from string literals to pointers to **char**/**uchar**. For example:

```
   (unsigned __int8 *)"Hello"
  
```

### HO\_ESC\_CLOSES\_VIEW

Pressing **Esc** closes the pseudocode view

### HO\_SPOIL\_FLAGREGS

Assume all functions spoil flag registers ZF,CF,SF,OF,PF (including functions with explicitly specified spoiled lists)

### HO\_KEEP\_INDIRECT\_READS\*\*

Keep all indirect memory reads (even with unused results) so as not to lose possible invalid address access

### HO\_KEEP\_EH\_CODE

Keep exception related code (e.g. calls to \_Unwind\_SjLj\_Register)

### HO\_SHOW\_PAC\_INSNS

Translate ARMv8.3 Pointer Authentication instructions into intrinsic function calls (otherwise ignore all PAC instructions)

### HO\_KEEP\_POTENTIAL\_DIV0

Preserve potential divisions by zero (if not set, all unused divisions will be deleted)

### HO\_MIPS\_ADDSUB\_TRAP

Generate the integer overflow trap call for 'add', 'sub', 'neg' insns

### HO\_MIPS\_IGN\_DIV0\_TRAP

Ignore the division by zero trap generated by the compiler (only for MIPS)

### HO\_HONEST\_READFLAGS

Consider \_\_readflags as depending on cpu flags default: off, because the result is correct but awfully unreadable

### HO\_NON\_FATAL\_INTERR

Permit decompilation after an internal error (normally the decompiler does not permit new decompilations after an internal error in the current session)

### HO\_SINGLE\_LINE\_PROTO

Never use multiline function declarations, even for functions with a long argument list

### HO\_DECOMPILE\_LIBFUNCS

Decompile library functions too (in batch mode)

### HO\_PROP\_VOLATILE\_LDX

Propagate ldx instructions without checking for volatile memory access

## WARNINGS

Specifies the warning messages that should be displayed after decompilation. Please refer to hexrays.cfg file for the details.\
Default: all warnings are on

## CMPFUNCS

Specified list of function names that are considered "strcmp-like". For them the decompiler will prefer to use comparison against zero like

```
    strcmp(a, b) == 0
               
```

as a condition. Underscores, j\_ prefixes and \_NN suffixes will be ignored when comparing function names

## MSVC Control Flow Guard names

### CFGUARD\_CHECK

Name of Control Flow Guard check function. Calls of this function will not be included into the pseudocode.\
Default: *"guard\_check\_icall\_fptr"*

### CFGUARD\_DISPATCH

Name of Control Flow Guard dispatch function. Each call of this function will be replaced by 'call rax' instruction when generating pseudocode.\
Default: *"guard\_dispatch\_icall\_fptr"*
