Configuration

The core reads ~/.config/radare2/radare2rc while starting. You can add e commands to this file to tune the radare2 configuration to your taste.

To prevent radare2 from parsing this file at startup, pass it the -N option.

All the configuration of radare2 is done with the eval commands. A typical startup configuration file looks like this:

  1. $ cat ~/.radare2rc
  2. e scr.color = 1
  3. e dbg.bep = loader

The configuration can also be changed with -e <config=value> command-line option. This way you can adjust configuration from the command line, keeping the .radare2rc file intact. For example, to start with empty configuration and then adjust scr.color and asm.syntax the following line may be used:

  1. $ radare2 -N -e scr.color=1 -e asm.syntax=intel -d /bin/ls

Internally, the configuration is stored in a hash table. The variables are grouped in namespaces: cfg., file., dbg., scr. and so on.

To get a list of all configuration variables just type e in the command line prompt. To limit the output to a selected namespace, pass it with an ending dot to e. For example, e file. will display all variables defined inside the “file” namespace.

To get help about e command type e?:

  1. Usage: e [var[=value]] Evaluable vars
  2. | e?asm.bytes show description
  3. | e?? list config vars with description
  4. | e a get value of var 'a'
  5. | e a=b set var 'a' the 'b' value
  6. | e var=? print all valid values of var
  7. | e var=?? print all valid values of var with description
  8. | e.a=b same as 'e a=b' but without using a space
  9. | e,k=v,k=v,k=v comma separated k[=v]
  10. | e- reset config vars
  11. | e* dump config vars in r commands
  12. | e!a invert the boolean value of 'a' var
  13. | ec [k] [color] set color for given key (prompt, offset, ...)
  14. | eevar open editor to change the value of var
  15. | ed open editor to change the ~/.radare2rc
  16. | ej list config vars in JSON
  17. | env [k[=v]] get/set environment variable
  18. | er [key] set config key as readonly. no way back
  19. | es [space] list all eval spaces [or keys]
  20. | et [key] show type of given config variable
  21. | ev [key] list config vars in verbose format
  22. | evj [key] list config vars in verbose format in JSON

A simpler alternative to the e command is accessible from the visual mode. Type Ve to enter it, use arrows (up, down, left, right) to navigate the configuration, and q to exit it. The start screen for the visual configuration edit looks like this:

  1. [EvalSpace]
  2. > anal
  3. asm
  4. scr
  5. asm
  6. bin
  7. cfg
  8. diff
  9. dir
  10. dbg
  11. cmd
  12. fs
  13. hex
  14. http
  15. graph
  16. hud
  17. scr
  18. search
  19. io

For configuration values that can take one of several values, you can use the =? operator to get a list of valid values:

  1. [0x00000000]> e scr.nkey = ?
  2. scr.nkey = fun, hit, flag